Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2022-50457— mtd: core: Fix refcount error in del_mtd_device()

EPSS 0.01% · P2
Get alerts for future matching vulnerabilitiesLog in to subscribe

I. Basic Information for CVE-2022-50457

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
mtd: core: Fix refcount error in del_mtd_device()
Source: NVD (National Vulnerability Database)
Vulnerability Description
In the Linux kernel, the following vulnerability has been resolved: mtd: core: Fix refcount error in del_mtd_device() del_mtd_device() will call of_node_put() to mtd_get_of_node(mtd), which is mtd->dev.of_node. However, memset(&mtd->dev, 0) is called before of_node_put(). As the result, of_node_put() won't do anything in del_mtd_device(), and causes the refcount leak. del_mtd_device() memset(&mtd->dev, 0, sizeof(mtd->dev) # clear mtd->dev of_node_put() mtd_get_of_node(mtd) # mtd->dev is cleared, can't locate of_node # of_node_put(NULL) won't do anything Fix the error by caching the pointer of the device_node. OF: ERROR: memory leak, expected refcount 1 instead of 2, of_node_get()/of_node_put() unbalanced - destroy cset entry: attach overlay node /spi/spi-sram@0 CPU: 3 PID: 275 Comm: python3 Tainted: G N 6.1.0-rc3+ #54 0d8a1edddf51f172ff5226989a7565c6313b08e2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x67/0x83 kobject_get+0x155/0x160 of_node_get+0x1f/0x30 of_fwnode_get+0x43/0x70 fwnode_handle_get+0x54/0x80 fwnode_get_nth_parent+0xc9/0xe0 fwnode_full_name_string+0x3f/0xa0 device_node_string+0x30f/0x750 pointer+0x598/0x7a0 vsnprintf+0x62d/0x9b0 ... cfs_overlay_release+0x30/0x90 config_item_release+0xbe/0x1a0 config_item_put+0x5e/0x80 configfs_rmdir+0x3bd/0x540 vfs_rmdir+0x18c/0x320 do_rmdir+0x198/0x330 __x64_sys_rmdir+0x2c/0x40 do_syscall_64+0x37/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd [<miquel.raynal@bootlin.com>: Light reword of the commit log]
Source: NVD (National Vulnerability Database)
CVSS Information
N/A
Source: NVD (National Vulnerability Database)
Vulnerability Type
N/A
Source: NVD (National Vulnerability Database)
Vulnerability Title
Linux kernel 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于del_mtd_device函数中设备节点引用计数处理不当,可能导致内存泄漏。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

VendorProductAffected VersionsCPESubscribe
LinuxLinux 00596576a05145a1b5672897a82ef87af00becf4 ~ f6016557f1ef7735963bd8691592d2797bbf91d2 -
LinuxLinux 5.17 -

II. Public POCs for CVE-2022-50457

#POC DescriptionSource LinkShenlong Link
AI-Generated POCPremium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2022-50457

登录查看更多情报信息。

Same Patch Batch · Linux · 2025-10-01 · 169 CVEs total

CVE-2022-50462MIPS: vpe-mt: fix possible memory leak while module exiting
CVE-2022-50448mm/uffd: fix warning without PTE_MARKER_UFFD_WP compiled in
CVE-2022-50452net: sched: cake: fix null pointer access issue when cake_init() fails
CVE-2022-50451fs/ntfs3: Fix memory leak on ntfs_fill_super() error path
CVE-2022-50453gpiolib: cdev: fix NULL-pointer dereferences
CVE-2022-50454drm/nouveau: fix a use-after-free in nouveau_gem_prime_import_sg_table()
CVE-2022-50456btrfs: fix resolving backrefs for inline extent followed by prealloc
CVE-2022-50458clk: tegra: Fix refcount leak in tegra210_clock_init
CVE-2022-50460cifs: Fix xid leak in cifs_flock()
CVE-2022-50459scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername()
CVE-2022-50461net: ethernet: ti: am65-cpsw: Fix PM runtime leakage in am65_cpsw_nuss_ndo_slave_open()
CVE-2022-50467scsi: lpfc: Fix null ndlp ptr dereference in abnormal exit path for GFT_ID
CVE-2023-53488IB/hfi1: Fix possible panic during hotplug remove
CVE-2023-53489tcp/udp: Fix memleaks of sk and zerocopy skbs with TX timestamp.
CVE-2022-50469staging: rtl8723bs: fix potential memory leak in rtw_init_drv_sw()
CVE-2022-50468platform/chrome: cros_usbpd_notify: Fix error handling in cros_usbpd_notify_init()
CVE-2022-50465ext4: fix leaking uninitialized memory in fast-commit journal
CVE-2022-50463powerpc/52xx: Fix a resource leak in an error handling path
CVE-2022-50464mt76: mt7915: Fix PCI device refcount leak in mt7915_pci_init_hif2()
CVE-2022-50449clk: samsung: Fix memory leak in _samsung_clk_register_pll()

Showing top 20 of 169 CVEs. View all on vendor page &rarr; →

IV. Related Vulnerabilities

V. Comments for CVE-2022-50457

No comments yet


Leave a comment