Instituto Nacional de ciberseguridad. Sección Incibe
Instituto Nacional de Ciberseguridad. Sección INCIBE-CERT

CVE-2022-50457

Gravedad CVSS v3.1:
MEDIA
Tipo:
No Disponible / Otro tipo
Fecha de publicación:
01/10/2025
Última modificación:
16/01/2026

Descripción

*** Pendiente de traducción *** In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> mtd: core: Fix refcount error in del_mtd_device()<br /> <br /> del_mtd_device() will call of_node_put() to mtd_get_of_node(mtd), which<br /> is mtd-&gt;dev.of_node. However, memset(&amp;mtd-&gt;dev, 0) is called before<br /> of_node_put(). As the result, of_node_put() won&amp;#39;t do anything in<br /> del_mtd_device(), and causes the refcount leak.<br /> <br /> del_mtd_device()<br /> memset(&amp;mtd-&gt;dev, 0, sizeof(mtd-&gt;dev) # clear mtd-&gt;dev<br /> of_node_put()<br /> mtd_get_of_node(mtd) # mtd-&gt;dev is cleared, can&amp;#39;t locate of_node<br /> # of_node_put(NULL) won&amp;#39;t do anything<br /> <br /> Fix the error by caching the pointer of the device_node.<br /> <br /> OF: ERROR: memory leak, expected refcount 1 instead of 2,<br /> of_node_get()/of_node_put() unbalanced - destroy cset entry: attach<br /> overlay node /spi/spi-sram@0<br /> CPU: 3 PID: 275 Comm: python3 Tainted: G N 6.1.0-rc3+ #54<br /> 0d8a1edddf51f172ff5226989a7565c6313b08e2<br /> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS<br /> rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014<br /> Call Trace:<br /> <br /> dump_stack_lvl+0x67/0x83<br /> kobject_get+0x155/0x160<br /> of_node_get+0x1f/0x30<br /> of_fwnode_get+0x43/0x70<br /> fwnode_handle_get+0x54/0x80<br /> fwnode_get_nth_parent+0xc9/0xe0<br /> fwnode_full_name_string+0x3f/0xa0<br /> device_node_string+0x30f/0x750<br /> pointer+0x598/0x7a0<br /> vsnprintf+0x62d/0x9b0<br /> ...<br /> cfs_overlay_release+0x30/0x90<br /> config_item_release+0xbe/0x1a0<br /> config_item_put+0x5e/0x80<br /> configfs_rmdir+0x3bd/0x540<br /> vfs_rmdir+0x18c/0x320<br /> do_rmdir+0x198/0x330<br /> __x64_sys_rmdir+0x2c/0x40<br /> do_syscall_64+0x37/0x90<br /> entry_SYSCALL_64_after_hwframe+0x63/0xcd<br /> <br /> [: Light reword of the commit log]

Productos y versiones vulnerables

CPE Desde Hasta
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.17 (incluyendo) 6.0.16 (excluyendo)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.1 (incluyendo) 6.1.2 (excluyendo)