{"api_version":"1","generated_at":"2026-11-30T20:00:28+00:00","cve":"CVE-2026-139677","urls":{"html":"https://cve.report/CVE-2026-139677","api":"https://cve.report/api/cve/CVE-2026-139677.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-139677","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-139677"},"summary":{"title":"kernfs: don't hold kernfs_rwsem across dir_emit()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nkernfs: don't hold kernfs_rwsem across dir_emit()\n\nkernfs_fop_readdir() holds kernfs_rwsem for reading across the whole\nlisting, dir_emit() included.  dir_emit() copies to userspace, so it can\nfault into reclaim while holding the lock that every create, remove and\nrename in the hierarchy needs.  sysfs and cgroupfs have one per machine.\n\nUnder memory pressure the monitoring daemons fault on their own\ngetdents(2) buffer with it held:\n\n        below: page allocation stall for 120 secs: order:0,\n        mode:0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO|__GFP_COMP)\n        nodemask=(null),cpuset=hostcritical.slice,mems_allowed=0\n        Call Trace:\n         <TASK>\n         dump_stack_lvl+0x5d/0x80\n         __alloc_frozen_pages_noprof+0x5f4d/0x6300\n         ? memcg_list_lru_alloc+0x73/0x320\n         ? ima_file_check+0xd0/0x7d0\n         vma_alloc_folio_noprof+0x145/0x560\n         handle_mm_fault+0x17c9/0x2720\n         ? find_vma+0x27/0x30\n         do_user_addr_fault+0x39f/0x6e0\n         exc_page_fault+0x8f/0x110\n         asm_exc_page_fault+0x22/0x30\n        RIP: 0010:filldir64+0xd7/0x1a0\n        [Code:/RSP:/RAX:..R15: register block elided]\n         kernfs_fop_readdir+0x2de/0x420\n         iterate_dir+0x8c/0x1f0\n         __se_sys_getdents64+0x61/0xe0\n         ? copy_page_from_iter+0x860/0x860\n         do_syscall_64+0x6a/0x250\n         entry_SYSCALL_64_after_hwframe+0x4b/0x53\n         </TASK>\n\nCommit 9aab10a0249e (\"kernfs: Don't re-lock kernfs_root::kernfs_rwsem in\nkernfs_fop_readdir().\") took the lock drop out because dir_emit() was\nhanded kernfs_node::name, which a rename can free.  The previous patch\nemits a copy instead, so drop the lock around dir_emit().\n\nA listing is no longer atomic within one getdents(2) call, which for\nmost sysfs and cgroup directories is all of it.  POSIX leaves that\nunspecified for an entry added or removed since opendir(3).","state":"PUBLISHED","assigner":"Linux","published_at":"2026-11-30 14:19:55","updated_at":"2026-11-30 14:19:55"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/a8c18ee33f5892e753e74001dcfb802a2f280831","name":"https://git.kernel.org/stable/c/a8c18ee33f5892e753e74001dcfb802a2f280831","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/341c65579de5b632eb7913bb68b3e375eeeb3ddf","name":"https://git.kernel.org/stable/c/341c65579de5b632eb7913bb68b3e375eeeb3ddf","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/18972293f131ef82eaf45f44c5599c3998292dfd","name":"https://git.kernel.org/stable/c/18972293f131ef82eaf45f44c5599c3998292dfd","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-139677","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139677","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 9aab10a0249eab4ec77c6a5e4f66442610c12a09 a8c18ee33f5892e753e74001dcfb802a2f280831 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 9aab10a0249eab4ec77c6a5e4f66442610c12a09 18972293f131ef82eaf45f44c5599c3998292dfd git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 9aab10a0249eab4ec77c6a5e4f66442610c12a09 341c65579de5b632eb7913bb68b3e375eeeb3ddf git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.15","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.15 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.65 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.6 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["fs/kernfs/dir.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"a8c18ee33f5892e753e74001dcfb802a2f280831","status":"affected","version":"9aab10a0249eab4ec77c6a5e4f66442610c12a09","versionType":"git"},{"lessThan":"18972293f131ef82eaf45f44c5599c3998292dfd","status":"affected","version":"9aab10a0249eab4ec77c6a5e4f66442610c12a09","versionType":"git"},{"lessThan":"341c65579de5b632eb7913bb68b3e375eeeb3ddf","status":"affected","version":"9aab10a0249eab4ec77c6a5e4f66442610c12a09","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["fs/kernfs/dir.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"6.15"},{"lessThan":"6.15","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.65","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.6","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.65","versionStartIncluding":"6.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.6","versionStartIncluding":"6.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"6.15","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nkernfs: don't hold kernfs_rwsem across dir_emit()\n\nkernfs_fop_readdir() holds kernfs_rwsem for reading across the whole\nlisting, dir_emit() included.  dir_emit() copies to userspace, so it can\nfault into reclaim while holding the lock that every create, remove and\nrename in the hierarchy needs.  sysfs and cgroupfs have one per machine.\n\nUnder memory pressure the monitoring daemons fault on their own\ngetdents(2) buffer with it held:\n\n        below: page allocation stall for 120 secs: order:0,\n        mode:0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO|__GFP_COMP)\n        nodemask=(null),cpuset=hostcritical.slice,mems_allowed=0\n        Call Trace:\n         <TASK>\n         dump_stack_lvl+0x5d/0x80\n         __alloc_frozen_pages_noprof+0x5f4d/0x6300\n         ? memcg_list_lru_alloc+0x73/0x320\n         ? ima_file_check+0xd0/0x7d0\n         vma_alloc_folio_noprof+0x145/0x560\n         handle_mm_fault+0x17c9/0x2720\n         ? find_vma+0x27/0x30\n         do_user_addr_fault+0x39f/0x6e0\n         exc_page_fault+0x8f/0x110\n         asm_exc_page_fault+0x22/0x30\n        RIP: 0010:filldir64+0xd7/0x1a0\n        [Code:/RSP:/RAX:..R15: register block elided]\n         kernfs_fop_readdir+0x2de/0x420\n         iterate_dir+0x8c/0x1f0\n         __se_sys_getdents64+0x61/0xe0\n         ? copy_page_from_iter+0x860/0x860\n         do_syscall_64+0x6a/0x250\n         entry_SYSCALL_64_after_hwframe+0x4b/0x53\n         </TASK>\n\nCommit 9aab10a0249e (\"kernfs: Don't re-lock kernfs_root::kernfs_rwsem in\nkernfs_fop_readdir().\") took the lock drop out because dir_emit() was\nhanded kernfs_node::name, which a rename can free.  The previous patch\nemits a copy instead, so drop the lock around dir_emit().\n\nA listing is no longer atomic within one getdents(2) call, which for\nmost sysfs and cgroup directories is all of it.  POSIX leaves that\nunspecified for an entry added or removed since opendir(3)."}],"providerMetadata":{"dateUpdated":"2026-11-30T13:36:57.653Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/a8c18ee33f5892e753e74001dcfb802a2f280831"},{"url":"https://git.kernel.org/stable/c/18972293f131ef82eaf45f44c5599c3998292dfd"},{"url":"https://git.kernel.org/stable/c/341c65579de5b632eb7913bb68b3e375eeeb3ddf"}],"title":"kernfs: don't hold kernfs_rwsem across dir_emit()","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-139677","datePublished":"2026-11-30T13:36:57.653Z","dateReserved":"2026-11-30T13:22:15.947Z","dateUpdated":"2026-11-30T13:36:57.653Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-30 14:19:55","lastModifiedDate":"2026-11-30 14:19:55","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"139677","Ordinal":"1","Title":"kernfs: don't hold kernfs_rwsem across dir_emit()","CVE":"CVE-2026-139677","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"139677","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nkernfs: don't hold kernfs_rwsem across dir_emit()\n\nkernfs_fop_readdir() holds kernfs_rwsem for reading across the whole\nlisting, dir_emit() included.  dir_emit() copies to userspace, so it can\nfault into reclaim while holding the lock that every create, remove and\nrename in the hierarchy needs.  sysfs and cgroupfs have one per machine.\n\nUnder memory pressure the monitoring daemons fault on their own\ngetdents(2) buffer with it held:\n\n        below: page allocation stall for 120 secs: order:0,\n        mode:0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO|__GFP_COMP)\n        nodemask=(null),cpuset=hostcritical.slice,mems_allowed=0\n        Call Trace:\n         <TASK>\n         dump_stack_lvl+0x5d/0x80\n         __alloc_frozen_pages_noprof+0x5f4d/0x6300\n         ? memcg_list_lru_alloc+0x73/0x320\n         ? ima_file_check+0xd0/0x7d0\n         vma_alloc_folio_noprof+0x145/0x560\n         handle_mm_fault+0x17c9/0x2720\n         ? find_vma+0x27/0x30\n         do_user_addr_fault+0x39f/0x6e0\n         exc_page_fault+0x8f/0x110\n         asm_exc_page_fault+0x22/0x30\n        RIP: 0010:filldir64+0xd7/0x1a0\n        [Code:/RSP:/RAX:..R15: register block elided]\n         kernfs_fop_readdir+0x2de/0x420\n         iterate_dir+0x8c/0x1f0\n         __se_sys_getdents64+0x61/0xe0\n         ? copy_page_from_iter+0x860/0x860\n         do_syscall_64+0x6a/0x250\n         entry_SYSCALL_64_after_hwframe+0x4b/0x53\n         </TASK>\n\nCommit 9aab10a0249e (\"kernfs: Don't re-lock kernfs_root::kernfs_rwsem in\nkernfs_fop_readdir().\") took the lock drop out because dir_emit() was\nhanded kernfs_node::name, which a rename can free.  The previous patch\nemits a copy instead, so drop the lock around dir_emit().\n\nA listing is no longer atomic within one getdents(2) call, which for\nmost sysfs and cgroup directories is all of it.  POSIX leaves that\nunspecified for an entry added or removed since opendir(3).","Type":"Description","Title":"kernfs: don't hold kernfs_rwsem across dir_emit()"}]}}}