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 E0C23408029 for ; Wed, 27 May 2026 13:06:35 +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=1779887197; cv=none; b=oSM1YWuXJRPPh1IUQd3uz7temDvD5tk4T0D1HfU4uwQnjoP1ItlRcGKfKhe9mXAle5NbbM+kETXcywa3BlbPyGLla/WrGiLXlQ9i5kypFJhMPIJ9UNNjo0+DBsIJ1bFFeUAb5GvVEdRXbxtJGQ9eKfp59ACn8qtdo3+rpMGFwGk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779887197; c=relaxed/simple; bh=inhHx7+12Q7Tish0vrJV7Mi0ah92xPqyjKwW934QU3A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RpmWW6AcRKM7an1ZAVL21f7lWWBrn2HXiqd55nW/ukvBUmvBdvJAHCV5l4rctX21Y1rd0xOKIY5VzZ+lHHNJW99k2OkCX6Y9pEDcOBZbDtE3H0/NLm9wsCMx1/oM4fCRiX0uvsn9jlUV3qOqdFjbWyr69emf6KP4yULSaq+UeNw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GNSgoV0Z; 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="GNSgoV0Z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F42F1F000E9; Wed, 27 May 2026 13:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779887195; bh=8Pb4VlJwoCyKSlspZNn0HHWEwOvPe19tG0He+p45ye4=; h=From:To:Cc:Subject:Date:Reply-To; b=GNSgoV0ZWrrHCkAOJ/QiEjOyKJYUTEqNEVzvex+6Yh08+eJ0b8P0fLm9BorJJcTAq XfOuns3KpcRQ/yU4N+bvFRr3LzOvLoZ2AbXQmLA3++/d8lQpC/JzlVHGARzetFgne/ 5AktqJA58jOd+/ZpRaAy6PkAopcc80cEBRr1JL10= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-46079: rbd: fix null-ptr-deref when device_add_disk() fails Date: Wed, 27 May 2026 15:00:10 +0200 Message-ID: <2026052700-CVE-2026-46079-52e7@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=6258; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ccWBB4n0tlBce1HOMZtOaXpxgvTXOfMEfF7PXCtMccg=; b=owGbwMvMwCRo6H6F97bub03G02pJDFlir6Z0vbinya3unxXdWrHr1oNVR9Rmr9DUPf1tflbZ4 d0v7ked6ohlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJzPNlmO8Z9uQaf4cnT0Dg 5rTd2Uf3u75z380wT/Vzn32pn+7kxtWHzxsIcIadfrz7NAA= 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: rbd: fix null-ptr-deref when device_add_disk() fails do_rbd_add() publishes the device with device_add() before calling device_add_disk(). If device_add_disk() fails after device_add() succeeds, the error path calls rbd_free_disk() directly and then later falls through to rbd_dev_device_release(), which calls rbd_free_disk() again. This double teardown can leave blk-mq cleanup operating on invalid state and trigger a null-ptr-deref in __blk_mq_free_map_and_rqs(), reached from blk_mq_free_tag_set(). Fix this by following the normal remove ordering: call device_del() before rbd_dev_device_release() when device_add_disk() fails after device_add(). That keeps the teardown sequence consistent and avoids re-entering disk cleanup through the wrong path. The bug was first flagged by an experimental analysis tool we are developing for kernel memory-management bugs while analyzing v6.13-rc1. The tool is still under development and is not yet publicly available. We reproduced the bug on v7.0 with a real Ceph backend and a QEMU x86_64 guest booted with KASAN and CONFIG_FAILSLAB enabled. The reproducer confines failslab injections to the __add_disk() range and injects fail-nth while mapping an RBD image through /sys/bus/rbd/add_single_major. On the unpatched kernel, fail-nth=4 reliably triggered the fault: Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 0 UID: 0 PID: 273 Comm: bash Not tainted 7.0.0-01247-gd60bc1401583 #6 PREEMPT(lazy) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1 04/01/2014 RIP: 0010:__blk_mq_free_map_and_rqs+0x8c/0x240 Code: 00 00 48 8b 6b 60 41 89 f4 49 c1 e4 03 4c 01 e5 45 85 ed 0f 85 0a 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 e9 48 c1 e9 03 <80> 3c 01 00 0f 85 31 01 00 00 4c 8b 6d 00 4d 85 ed 0f 84 e2 00 00 RSP: 0018:ff1100000ab0fac8 EFLAGS: 00000246 RAX: dffffc0000000000 RBX: ff1100000c4806a0 RCX: 0000000000000000 RDX: 0000000000000002 RSI: 0000000000000000 RDI: ff1100000c4806f4 RBP: 0000000000000000 R08: 0000000000000001 R09: ffe21c000189001b R10: ff1100000c4800df R11: ff1100006cf37be0 R12: 0000000000000000 R13: 0000000000000000 R14: ff1100000c480700 R15: ff1100000c480004 FS: 00007f0fbe8fe740(0000) GS:ff110000e5851000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fe53473b2e0 CR3: 0000000012eef000 CR4: 00000000007516f0 PKRU: 55555554 Call Trace: blk_mq_free_tag_set+0x77/0x460 do_rbd_add+0x1446/0x2b80 ? __pfx_do_rbd_add+0x10/0x10 ? lock_acquire+0x18c/0x300 ? find_held_lock+0x2b/0x80 ? sysfs_file_kobj+0xb6/0x1b0 ? __pfx_sysfs_kf_write+0x10/0x10 kernfs_fop_write_iter+0x2f4/0x4a0 vfs_write+0x98e/0x1000 ? expand_files+0x51f/0x850 ? __pfx_vfs_write+0x10/0x10 ksys_write+0xf2/0x1d0 ? __pfx_ksys_write+0x10/0x10 do_syscall_64+0x115/0x690 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f0fbea15907 Code: 10 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24 RSP: 002b:00007ffe22346ea8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000058 RCX: 00007f0fbea15907 RDX: 0000000000000058 RSI: 0000563ace6c0ef0 RDI: 0000000000000001 RBP: 0000563ace6c0ef0 R08: 0000563ace6c0ef0 R09: 6b6435726d694141 R10: 5250337279762f78 R11: 0000000000000246 R12: 0000000000000058 R13: 00007f0fbeb1c780 R14: ff1100000c480700 R15: ff1100000c480004 With this fix applied, rerunning the reproducer over fail-nth=1..256 yields no KASAN reports. [ idryomov: rename err_out_device_del -> err_out_device ] The Linux kernel CVE team has assigned CVE-2026-46079 to this issue. Affected and fixed versions =========================== Issue introduced in 5.16 with commit 27c97abc30e2b9ad2288977c0ecbef4d50553f57 and fixed in 6.6.140 with commit 2f4809a879f0750c7790bbeeae86c9505797a06f Issue introduced in 5.16 with commit 27c97abc30e2b9ad2288977c0ecbef4d50553f57 and fixed in 6.12.86 with commit 564cd8f4aeb9a938e470c5c91922fd02e4d41acc Issue introduced in 5.16 with commit 27c97abc30e2b9ad2288977c0ecbef4d50553f57 and fixed in 6.18.27 with commit ad0126ffcba8777109852979eaaa6dca6703abdb Issue introduced in 5.16 with commit 27c97abc30e2b9ad2288977c0ecbef4d50553f57 and fixed in 7.0.4 with commit 059fb7656723c1b77c2fc0e64b7aa99d6bb65e8e Issue introduced in 5.16 with commit 27c97abc30e2b9ad2288977c0ecbef4d50553f57 and fixed in 7.1-rc1 with commit d1fef92e414433ca7b89abf85cb0df42b8d475eb 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-46079 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: drivers/block/rbd.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/2f4809a879f0750c7790bbeeae86c9505797a06f https://git.kernel.org/stable/c/564cd8f4aeb9a938e470c5c91922fd02e4d41acc https://git.kernel.org/stable/c/ad0126ffcba8777109852979eaaa6dca6703abdb https://git.kernel.org/stable/c/059fb7656723c1b77c2fc0e64b7aa99d6bb65e8e https://git.kernel.org/stable/c/d1fef92e414433ca7b89abf85cb0df42b8d475eb