CVE-2021-47440

Severity CVSS v4.0:
Pending analysis
Type:
CWE-476 NULL Pointer Dereference
Publication date:
22/05/2024
Last modified:
02/04/2025

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> net: encx24j600: check error in devm_regmap_init_encx24j600<br /> <br /> devm_regmap_init may return error which caused by like out of memory,<br /> this will results in null pointer dereference later when reading<br /> or writing register:<br /> <br /> general protection fault in encx24j600_spi_probe<br /> KASAN: null-ptr-deref in range [0x0000000000000090-0x0000000000000097]<br /> CPU: 0 PID: 286 Comm: spi-encx24j600- Not tainted 5.15.0-rc2-00142-g9978db750e31-dirty #11 9c53a778c1306b1b02359f3c2bbedc0222cba652<br /> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014<br /> RIP: 0010:regcache_cache_bypass drivers/base/regmap/regcache.c:540<br /> Code: 54 41 89 f4 55 53 48 89 fb 48 83 ec 08 e8 26 94 a8 fe 48 8d bb a0 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 3c 02 00 0f 85 4a 03 00 00 4c 8d ab b0 00 00 00 48 8b ab a0 00<br /> RSP: 0018:ffffc900010476b8 EFLAGS: 00010207<br /> RAX: dffffc0000000000 RBX: fffffffffffffff4 RCX: 0000000000000000<br /> RDX: 0000000000000012 RSI: ffff888002de0000 RDI: 0000000000000094<br /> RBP: ffff888013c9a000 R08: 0000000000000000 R09: fffffbfff3f9cc6a<br /> R10: ffffc900010476e8 R11: fffffbfff3f9cc69 R12: 0000000000000001<br /> R13: 000000000000000a R14: ffff888013c9af54 R15: ffff888013c9ad08<br /> FS: 00007ffa984ab580(0000) GS:ffff88801fe00000(0000) knlGS:0000000000000000<br /> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033<br /> CR2: 000055a6384136c8 CR3: 000000003bbe6003 CR4: 0000000000770ef0<br /> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000<br /> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400<br /> PKRU: 55555554<br /> Call Trace:<br /> encx24j600_spi_probe drivers/net/ethernet/microchip/encx24j600.c:459<br /> spi_probe drivers/spi/spi.c:397<br /> really_probe drivers/base/dd.c:517<br /> __driver_probe_device drivers/base/dd.c:751<br /> driver_probe_device drivers/base/dd.c:782<br /> __device_attach_driver drivers/base/dd.c:899<br /> bus_for_each_drv drivers/base/bus.c:427<br /> __device_attach drivers/base/dd.c:971<br /> bus_probe_device drivers/base/bus.c:487<br /> device_add drivers/base/core.c:3364<br /> __spi_add_device drivers/spi/spi.c:599<br /> spi_add_device drivers/spi/spi.c:641<br /> spi_new_device drivers/spi/spi.c:717<br /> new_device_store+0x18c/0x1f1 [spi_stub 4e02719357f1ff33f5a43d00630982840568e85e]<br /> dev_attr_store drivers/base/core.c:2074<br /> sysfs_kf_write fs/sysfs/file.c:139<br /> kernfs_fop_write_iter fs/kernfs/file.c:300<br /> new_sync_write fs/read_write.c:508 (discriminator 4)<br /> vfs_write fs/read_write.c:594<br /> ksys_write fs/read_write.c:648<br /> do_syscall_64 arch/x86/entry/common.c:50<br /> entry_SYSCALL_64_after_hwframe arch/x86/entry/entry_64.S:113<br /> <br /> Add error check in devm_regmap_init_encx24j600 to avoid this situation.

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 4.4 (including) 4.4.290 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 4.5 (including) 4.9.288 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 4.10 (including) 4.14.252 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 4.15 (including) 4.19.213 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 4.20 (including) 5.4.155 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.5 (including) 5.10.75 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.11 (including) 5.14.14 (excluding)
cpe:2.3:o:linux:linux_kernel:5.15:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.15:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.15:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.15:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.15:rc5:*:*:*:*:*:*