Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CC2A405877 for ; Wed, 27 May 2026 13:00:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779886860; cv=none; b=BBEqqEYga4VeDKtapPBRzkTZJd6+JLcIJ0zmyRcM1TETUKgXRhGgwYn5/omKPwiRW+XytqFR9JS2UKKnCSRTuEkU5vn6jdCmnpBwZUnYItCe3rxo2nkOgg6T8PMgskuEUit+a5WzQ6Ua5tsTI0D1XCW+Bg7I08PeXc0N3KWXxMc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779886860; c=relaxed/simple; bh=ey5Fde3Ntin1KcGXqrp6zTqDZIYA7btQLjGGUKNcS0A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hzkNrFxyVrC4FrHnnH2V3sEfPrCBrno+9tabKAjQXFlmeMV6JQjjMOeXdnFx97BZuvDROlLrlv0Eb5e9lZLwMtkHF8eCupmNvhs/TtxLAR7PYN+BFogFe7NAhu3zptw5FERqZtTq8E19tGfUnbWL/+tKYbcxz6nEM5K6GYJzVOY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Rb5UyEnj; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Rb5UyEnj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E8241F00A3A; Wed, 27 May 2026 13:00:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779886859; bh=C+7FaiylmpbUFcbccNdTvUqU9C+YgEHTf8R/u9diyBg=; h=From:To:Cc:Subject:Date:Reply-To; b=Rb5UyEnjCJJlxMjrULvun9MlwJBe5VPTnBqysrJIYXGY2CF34vtOBW7WZaE2zKoue stiQLpAvdpi4u/ytzcStHKdvTEX3n7pFlvevgzzlY14Fycm+hU4TgtPEEAbVA1dyT2 8pkkGtav6xkBXe5sGVhwV70aELGF40iu/QDcpMGs= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-45990: slub: fix data loss and overflow in krealloc() Date: Wed, 27 May 2026 14:58:41 +0200 Message-ID: <2026052739-CVE-2026-45990-09a7@gregkh> X-Mailer: git-send-email 2.54.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4017; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Jr8vpYIutm5+MQY0hfsE3e7T573FVxDhMbMJu0242UI=; b=owGbwMvMwCRo6H6F97bub03G02pJDFlir+pN4i/xZSZviT+VtKz6ssyzyklPV5VMKROsfpZqM Xkzo8fWjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiI9n2G+XWM93Y4nnqzyGp5 6NGJzxZUuLyq1WSYKxDbdN7U2+dCvMHHfF1x83fzNk0QBAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: slub: fix data loss and overflow in krealloc() Commit 2cd8231796b5 ("mm/slub: allow to set node and align in k[v]realloc") introduced the ability to force a reallocation if the original object does not satisfy new alignment or NUMA node, even when the object is being shrunk. This introduced two bugs in the reallocation fallback path: 1. Data loss during NUMA migration: The jump to 'alloc_new' happens before 'ks' and 'orig_size' are initialized. As a result, the memcpy() in the 'alloc_new' block would copy 0 bytes into the new allocation. 2. Buffer overflow during shrinking: When shrinking an object while forcing a new alignment, 'new_size' is smaller than the old size. However, the memcpy() used the old size ('orig_size ?: ks'), leading to an out-of-bounds write. The same overflow bug exists in the kvrealloc() fallback path, where the old bucket size ksize(p) is copied into the new buffer without being bounded by the new size. A simple reproducer: // e.g. add to lkdtm as KREALLOC_SHRINK_OVERFLOW while (1) { void *p = kmalloc(128, GFP_KERNEL); p = krealloc_node_align(p, 64, 256, GFP_KERNEL, NUMA_NO_NODE); kfree(p); } demonstrates the issue: ================================================================== BUG: KFENCE: out-of-bounds write in memcpy_orig+0x68/0x130 Out-of-bounds write at 0xffff8883ad757038 (120B right of kfence-#47): memcpy_orig+0x68/0x130 krealloc_node_align_noprof+0x1c8/0x340 lkdtm_KREALLOC_SHRINK_OVERFLOW+0x8c/0xc0 [lkdtm] lkdtm_do_action+0x3a/0x60 [lkdtm] ... kfence-#47: 0xffff8883ad756fc0-0xffff8883ad756fff, size=64, cache=kmalloc-64 allocated by task 316 on cpu 7 at 97.680481s (0.021813s ago): krealloc_node_align_noprof+0x19c/0x340 lkdtm_KREALLOC_SHRINK_OVERFLOW+0x8c/0xc0 [lkdtm] lkdtm_do_action+0x3a/0x60 [lkdtm] ... ================================================================== Fix it by moving the old size calculation to the top of __do_krealloc() and bounding all copy lengths by the new allocation size. The Linux kernel CVE team has assigned CVE-2026-45990 to this issue. Affected and fixed versions =========================== Issue introduced in 6.18 with commit 2cd8231796b5e7133b1c3d66ad7d2a3c42c97258 and fixed in 6.18.27 with commit 38387ccc0fbe38d14fb4c2ad7ee1d7404e5e59fd Issue introduced in 6.18 with commit 2cd8231796b5e7133b1c3d66ad7d2a3c42c97258 and fixed in 7.0.4 with commit 550fa6b5aabb096554536ac1e3ec96b76cbb35fd Issue introduced in 6.18 with commit 2cd8231796b5e7133b1c3d66ad7d2a3c42c97258 and fixed in 7.1-rc1 with commit 082a6d03a2d685a83a332666b500ad3966349588 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-45990 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: mm/slub.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/38387ccc0fbe38d14fb4c2ad7ee1d7404e5e59fd https://git.kernel.org/stable/c/550fa6b5aabb096554536ac1e3ec96b76cbb35fd https://git.kernel.org/stable/c/082a6d03a2d685a83a332666b500ad3966349588