{"id":"CVE-2022-49295","state":"PUBLISHED","title":"nbd: call genl_unregister_family() first in nbd_cleanup()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnbd: call genl_unregister_family() first in nbd_cleanup()\n\nOtherwise there may be race between module removal and the handling of\nnetlink command, which can lead to the oops as shown below:\n\n  BUG: kernel NULL pointer dereference, address: 0000000000000098\n  Oops: 0002 [#1] SMP PTI\n  CPU: 1 PID: 31299 Comm: nbd-client Tainted: G            E     5.14.0-rc4\n  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)\n  RIP: 0010:down_write+0x1a/0x50\n  Call Trace:\n   start_creating+0x89/0x130\n   debugfs_create_dir+0x1b/0x130\n   nbd_start_device+0x13d/0x390 [nbd]\n   nbd_genl_connect+0x42f/0x748 [nbd]\n   genl_family_rcv_msg_doit.isra.0+0xec/0x150\n   genl_rcv_msg+0xe5/0x1e0\n   netlink_rcv_skb+0x55/0x100\n   genl_rcv+0x29/0x40\n   netlink_unicast+0x1a8/0x250\n   netlink_sendmsg+0x21b/0x430\n   ____sys_sendmsg+0x2a4/0x2d0\n   ___sys_sendmsg+0x81/0xc0\n   __sys_sendmsg+0x62/0xb0\n   __x64_sys_sendmsg+0x1f/0x30\n   do_syscall_64+0x3b/0xc0\n   entry_SYSCALL_64_after_hwframe+0x44/0xae\n  Modules linked in: nbd(E-)","publishedAt":"2025-02-26T02:01:25.659Z","updatedAt":"2026-08-05T08:54:41.429Z","severity":{"score":7,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"8a1435c862ea09b06be7acda325128dc08458e25","versionType":"git"},{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"013a79f1b5c89290e2e97f1ebf14b14e0cf5fe5c","versionType":"git"},{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"1be608e1ee1f222464b2856bda9b85ab5184a33e","versionType":"git"},{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"c0868f6e728c3c28bef0e8bee89d2daf86a8bbca","versionType":"git"},{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"cbeafa7a79d08ecdb55f8f1d41a11323d0f709db","versionType":"git"},{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"6f505bbb8063fd3a238a4239d2d8c165e5279f6f","versionType":"git"},{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"3d5da1ffba3388c2ae2e6c598855a4d887d3bf79","versionType":"git"},{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"06c4da89c24e7023ea448cadf8e9daf06a0aae6e","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/block/nbd.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.12","versionType":"semver"},{"version":"4.14.283","status":"unaffected","lessThanOrEqual":"4.14.*","versionType":"semver"},{"version":"4.19.247","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.198","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.122","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.47","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"5.17.15","status":"unaffected","lessThanOrEqual":"5.17.*","versionType":"semver"},{"version":"5.18.4","status":"unaffected","lessThanOrEqual":"5.18.*","versionType":"semver"},{"version":"5.19","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/block/nbd.c"]}],"references":["https://git.kernel.org/stable/c/8a1435c862ea09b06be7acda325128dc08458e25","https://git.kernel.org/stable/c/013a79f1b5c89290e2e97f1ebf14b14e0cf5fe5c","https://git.kernel.org/stable/c/1be608e1ee1f222464b2856bda9b85ab5184a33e","https://git.kernel.org/stable/c/c0868f6e728c3c28bef0e8bee89d2daf86a8bbca","https://git.kernel.org/stable/c/cbeafa7a79d08ecdb55f8f1d41a11323d0f709db","https://git.kernel.org/stable/c/6f505bbb8063fd3a238a4239d2d8c165e5279f6f","https://git.kernel.org/stable/c/3d5da1ffba3388c2ae2e6c598855a4d887d3bf79","https://git.kernel.org/stable/c/06c4da89c24e7023ea448cadf8e9daf06a0aae6e"],"weaknesses":["CWE-476"],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/49xxx/CVE-2022-49295.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-49295","state":"PUBLISHED","datePublished":"2025-02-26T02:01:25.659Z","dateUpdated":"2026-08-05T08:54:41.429Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-02-26T01:49:39.302Z"},"containers":{"cna":{"title":"nbd: call genl_unregister_family() first in nbd_cleanup()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnbd: call genl_unregister_family() first in nbd_cleanup()\n\nOtherwise there may be race between module removal and the handling of\nnetlink command, which can lead to the oops as shown below:\n\n  BUG: kernel NULL pointer dereference, address: 0000000000000098\n  Oops: 0002 [#1] SMP PTI\n  CPU: 1 PID: 31299 Comm: nbd-client Tainted: G            E     5.14.0-rc4\n  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)\n  RIP: 0010:down_write+0x1a/0x50\n  Call Trace:\n   start_creating+0x89/0x130\n   debugfs_create_dir+0x1b/0x130\n   nbd_start_device+0x13d/0x390 [nbd]\n   nbd_genl_connect+0x42f/0x748 [nbd]\n   genl_family_rcv_msg_doit.isra.0+0xec/0x150\n   genl_rcv_msg+0xe5/0x1e0\n   netlink_rcv_skb+0x55/0x100\n   genl_rcv+0x29/0x40\n   netlink_unicast+0x1a8/0x250\n   netlink_sendmsg+0x21b/0x430\n   ____sys_sendmsg+0x2a4/0x2d0\n   ___sys_sendmsg+0x81/0xc0\n   __sys_sendmsg+0x62/0xb0\n   __x64_sys_sendmsg+0x1f/0x30\n   do_syscall_64+0x3b/0xc0\n   entry_SYSCALL_64_after_hwframe+0x44/0xae\n  Modules linked in: nbd(E-)"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"8a1435c862ea09b06be7acda325128dc08458e25","versionType":"git"},{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"013a79f1b5c89290e2e97f1ebf14b14e0cf5fe5c","versionType":"git"},{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"1be608e1ee1f222464b2856bda9b85ab5184a33e","versionType":"git"},{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"c0868f6e728c3c28bef0e8bee89d2daf86a8bbca","versionType":"git"},{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"cbeafa7a79d08ecdb55f8f1d41a11323d0f709db","versionType":"git"},{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"6f505bbb8063fd3a238a4239d2d8c165e5279f6f","versionType":"git"},{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"3d5da1ffba3388c2ae2e6c598855a4d887d3bf79","versionType":"git"},{"version":"e46c7287b1c27683a8e30ca825fb98e2b97f1099","status":"affected","lessThan":"06c4da89c24e7023ea448cadf8e9daf06a0aae6e","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/block/nbd.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.12","versionType":"semver"},{"version":"4.14.283","status":"unaffected","lessThanOrEqual":"4.14.*","versionType":"semver"},{"version":"4.19.247","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.198","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.122","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.47","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"5.17.15","status":"unaffected","lessThanOrEqual":"5.17.*","versionType":"semver"},{"version":"5.18.4","status":"unaffected","lessThanOrEqual":"5.18.*","versionType":"semver"},{"version":"5.19","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/block/nbd.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/8a1435c862ea09b06be7acda325128dc08458e25"},{"url":"https://git.kernel.org/stable/c/013a79f1b5c89290e2e97f1ebf14b14e0cf5fe5c"},{"url":"https://git.kernel.org/stable/c/1be608e1ee1f222464b2856bda9b85ab5184a33e"},{"url":"https://git.kernel.org/stable/c/c0868f6e728c3c28bef0e8bee89d2daf86a8bbca"},{"url":"https://git.kernel.org/stable/c/cbeafa7a79d08ecdb55f8f1d41a11323d0f709db"},{"url":"https://git.kernel.org/stable/c/6f505bbb8063fd3a238a4239d2d8c165e5279f6f"},{"url":"https://git.kernel.org/stable/c/3d5da1ffba3388c2ae2e6c598855a4d887d3bf79"},{"url":"https://git.kernel.org/stable/c/06c4da89c24e7023ea448cadf8e9daf06a0aae6e"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerability is reached via local Generic Netlink sendmsg to the nbd family (and concurrent local delete_module); it is not reachable from network packets or remote protocols.\nAC:H - Exploitation requires winning a race against nbd module removal (rmmod/delete_module), which an unprivileged attacker cannot initiate and which depends on a privileged actor unloading the module.\nPR:L - NBD_CMD_STATUS has no capability check and is usable by an unprivileged local user, so the cleanup race can be exercised without CAP_SYS_ADMIN; CAP_SYS_ADMIN in init_user_ns is only required for connect/disconnect/reconfigure.\nUI:N - No victim interaction is required; the attacker only needs to send netlink commands while the module exit path runs.\nS:U - Impact remains within the local kernel’s authority; this is not a VM escape, IOMMU bypass, or other cross-boundary breakout.\nC:H - The race is a use-after-free of nbd/debugfs/idr state during teardown, which can be leveraged for disclosure of freed kernel memory contents under the higher-severity UAF scoring rule.\nI:H - The same UAF on kernel objects during module cleanup can be abused for corruption/control-flow hijack primitives, not merely a crash.\nA:H - The documented outcome is a kernel NULL pointer dereference oops during nbd_genl_connect while the module is going away, which is a full availability impact."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T08:54:41.429Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"4.14.283"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"4.19.247"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"5.4.198"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"5.10.122"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"5.15.47"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"5.17.15"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"5.18.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.12","versionEndExcluding":"5.19"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":4.7,"attackVector":"LOCAL","baseSeverity":"MEDIUM","vectorString":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","integrityImpact":"NONE","userInteraction":"NONE","attackComplexity":"HIGH","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"NONE"}},{"other":{"type":"ssvc","content":{"id":"CVE-2022-49295","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2025-10-01T19:45:04.172443Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-476","lang":"en","type":"CWE","description":"CWE-476 NULL Pointer Dereference"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-10-01T19:46:59.873Z"}}]}}}