{"id":"CVE-2026-99520","aliases":["CVE-2026-99520"],"related":[],"kind":"vulnerability","state":"published","title":"pps: generators: fix use-after-free when closing a removed device","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\npps: generators: fix use-after-free when closing a removed device\n\nThe cdev of a PPS generator is embedded in struct pps_gen_device, but\nnothing ties the lifetime of that structure to the cdev: pps_gen is\nfreed by the release function of its device, and an open file holds a\ndevice reference only until pps_gen_cdev_release() drops it.\n\nWhen the generator is unregistered while /dev/pps-genN is open, that\nput_device() drops the last reference and frees pps_gen, and __fput()\nthen calls cdev_put() on the freed cdev:\n\n  BUG: KASAN: slab-use-after-free in cdev_put+0x53/0x60\n  Read of size 8 at addr ffff88801383e138 by task ppsgen64/149\n  Call Trace:\n   cdev_put+0x53/0x60\n   __fput+0x745/0xad0\n   fput_close_sync+0xd9/0x1b0\n   __x64_sys_close+0x86/0xf0\n  ...\n  Freed by task 149:\n   kfree+0x25a/0x6d0\n   device_release+0xca/0x3c0\n   kobject_put+0x169/0x320\n   pps_gen_cdev_release+0x51/0x80\n   __fput+0x36a/0xad0\n\npps.c had the same bug, fixed in commit c79a39dc8d06 (\"pps: Fix a\nuse-after-free\").\n\nFix it the usual way: embed the struct device in pps_gen_device and\nregister both with cdev_device_add(). This makes the device the parent\nof the cdev, so the cdev holds a device reference until the last file\nis closed.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\npps: generators: fix use-after-free when closing a removed device\n\nThe cdev of a PPS generator is embedded in struct pps_gen_device, but\nnothing ties the lifetime of that structure to the cdev: pps_gen is\nfreed by the release function of its device, and an open file holds a\ndevice reference only until pps_gen_cdev_release() drops it.\n\nWhen the generator is unregistered while /dev/pps-genN is open, that\nput_device() drops the last reference and frees pps_gen, and __fput()\nthen calls cdev_put() on the freed cdev:\n\n  BUG: KASAN: slab-use-after-free in cdev_put+0x53/0x60\n  Read of size 8 at addr ffff88801383e138 by task ppsgen64/149\n  Call Trace:\n   cdev_put+0x53/0x60\n   __fput+0x745/0xad0\n   fput_close_sync+0xd9/0x1b0\n   __x64_sys_close+0x86/0xf0\n  ...\n  Freed by task 149:\n   kfree+0x25a/0x6d0\n   device_release+0xca/0x3c0\n   kobject_put+0x169/0x320\n   pps_gen_cdev_release+0x51/0x80\n   __fput+0x36a/0xad0\n\npps.c had the same bug, fixed in commit c79a39dc8d06 (\"pps: Fix a\nuse-after-free\").\n\nFix it the usual way: embed the struct device in pps_gen_device and\nregister both with cdev_device_add(). This makes the device the parent\nof the cdev, so the cdev holds a device reference until the last file\nis closed.","source":"cvelist"}],"published":"2026-11-19T14:44:25.121Z","modified":"2026-11-19T15:18:07.573Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"86b525bed2758878e788c9fb6b8fb281fd61bdb0","fixed":"63dc56500a91591ad9b42e09ca4646b0a4d03406","status":"affected"},{"type":"git","introduced":"86b525bed2758878e788c9fb6b8fb281fd61bdb0","fixed":"3c94478114384d97795029160ceb539ade38cc43","status":"affected"},{"type":"git","introduced":"86b525bed2758878e788c9fb6b8fb281fd61bdb0","fixed":"d19552611cb2eb6329826871565e5309bec2f288","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.14","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.14","status":"unaffected"},{"type":"semver","introduced":"6.18.61","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.2","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/63dc56500a91591ad9b42e09ca4646b0a4d03406","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3c94478114384d97795029160ceb539ade38cc43","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d19552611cb2eb6329826871565e5309bec2f288","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-99520","url":"https://www.cve.org/CVERecord?id=CVE-2026-99520","licence":"CVE Terms of Use","modified":"2026-11-19T14:44:25.121Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-99520","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99520","licence":"Public domain","modified":"2026-11-19T15:18:07.573Z"}],"updatedAt":"2026-11-25T22:59:52.101Z","epss":{"score":0.00166,"percentile":0.06175,"date":"2026-12-02T12:00:21.000Z"}}