In the Linux kernel, the following vulnerability has been resolved:
fsnotify: clear PARENT_WATCHED flags lazily
In some setups directories can have many (usually negative) dentries. Hence _fsnotifyupdatechilddentryflags() function can take a significant amount of time. Since the bulk of this function happens under inode->ilock this causes a significant contention on the lock when we remove the watch from the directory as the _fsnotifyupdatechilddentryflags() call from fsnotifyrecalcmask() races with _fsnotifyupdatechilddentryflags() calls from _fsnotifyparent() happening on children. This can lead upto softlockup reports reported by users.
Fix the problem by calling fsnotifyupdatechildrendentryflags() to set PARENT_WATCHED flags only when parent starts watching children.
When parent stops watching children, clear false positive PARENTWATCHED flags lazily in _fsnotify_parent() for each accessed child.
{ "vanir_signatures": [ { "signature_version": "v1", "target": { "file": "include/linux/fsnotify_backend.h" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d8c42405fc3507cc43ba7e4986a773c3fc633f6e", "deprecated": false, "digest": { "line_hashes": [ "268996248620321159848506628428132533270", "198363465651826001099036282753851829926", "328563151215705538944235843516394429302", "112308327741513160445427878430932550641", "178937512771524495418046925077999106611", "336732349298361860183772166326631357800", "155850649757546848055610713496587064314", "136295995095124565480450699111358729203", "27157811598624949074164646992781817777", "11263002910200185900735473950606811360" ], "threshold": 0.9 }, "id": "CVE-2024-47660-0633da15" }, { "signature_version": "v1", "target": { "function": "__fsnotify_parent", "file": "fs/notify/fsnotify.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d8c42405fc3507cc43ba7e4986a773c3fc633f6e", "deprecated": false, "digest": { "length": 1091.0, "function_hash": "132546590188404206646047883486487093889" }, "id": "CVE-2024-47660-15df1388" }, { "signature_version": "v1", "target": { "function": "__fsnotify_parent", "file": "fs/notify/fsnotify.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@172e422ffea20a89bfdc672741c1aad6fbb5044e", "deprecated": false, "digest": { "length": 1046.0, "function_hash": "260588361384442245775856287289772909901" }, "id": "CVE-2024-47660-19730a6d" }, { "signature_version": "v1", "target": { "function": "fsnotify_inode_watches_children", "file": "include/linux/fsnotify_backend.h" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@172e422ffea20a89bfdc672741c1aad6fbb5044e", "deprecated": false, "digest": { "length": 179.0, "function_hash": "29181080342166073954667206088507054843" }, "id": "CVE-2024-47660-44bbddfb" }, { "signature_version": "v1", "target": { "file": "fs/notify/fsnotify.h" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@172e422ffea20a89bfdc672741c1aad6fbb5044e", "deprecated": false, "digest": { "line_hashes": [ "66850788959351015273666463168052819028", "197771102846683510458149588210958617641", "204169844104393591200005513468102103305" ], "threshold": 0.9 }, "id": "CVE-2024-47660-5a931536" }, { "signature_version": "v1", "target": { "file": "fs/notify/fsnotify.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3f3ef1d9f66b93913ce2171120d9226b55acd41d", "deprecated": false, "digest": { "line_hashes": [ "14930179635948999184593580960373034643", "127975482068473300966056897495652334663", "212543977496041913079330138772260447006", "85105772696967875040809810874464870383", "87961731598905456860679171496013163839", "77339241136851765558461898611415343530", "302664961239107190916533285666470054200", "33438356010034435280375850589954746066", "154450072484285444829569276363779330130", "45377957777698619642090417845430690321", "236259521946509273681874863158726239906", "182663925328534395947488618001499521721", "142685902774572659640114511236933384633", "284705809987898364760126924419366994227", "265967045795199153816311060625866419328", "47268251095253836031405681936793252900", "159648197079446386144233939685549460912", "186861673417280390848356974111015252403", "260345286970030746974744014974866971812", "80071099968351145089901314189726226844", "176998386606970513649605172786308594911", "264199077974781854685104318182835871988", "66689289873129106004552517053598690956", "63073433195784638226439168287579229259" ], "threshold": 0.9 }, "id": "CVE-2024-47660-5d95ecb5" }, { "signature_version": "v1", "target": { "file": "fs/notify/fsnotify.h" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d8c42405fc3507cc43ba7e4986a773c3fc633f6e", "deprecated": false, "digest": { "line_hashes": [ "89048350336048991108715695145584435698", "111636647509727740718999255593434294309", "204169844104393591200005513468102103305" ], "threshold": 0.9 }, "id": "CVE-2024-47660-5fe0e7f7" }, { "signature_version": "v1", "target": { "file": "include/linux/fsnotify_backend.h" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@172e422ffea20a89bfdc672741c1aad6fbb5044e", "deprecated": false, "digest": { "line_hashes": [ "268996248620321159848506628428132533270", "198363465651826001099036282753851829926", "328563151215705538944235843516394429302", "112308327741513160445427878430932550641", "178937512771524495418046925077999106611", "336732349298361860183772166326631357800", "155850649757546848055610713496587064314", "136295995095124565480450699111358729203", "27157811598624949074164646992781817777", "11263002910200185900735473950606811360" ], "threshold": 0.9 }, "id": "CVE-2024-47660-646c4a8c" }, { "signature_version": "v1", "target": { "function": "__fsnotify_update_child_dentry_flags", "file": "fs/notify/fsnotify.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d8c42405fc3507cc43ba7e4986a773c3fc633f6e", "deprecated": false, "digest": { "length": 651.0, "function_hash": "59360895718221256212915009759997797934" }, "id": "CVE-2024-47660-6bcaabde" }, { "signature_version": "v1", "target": { "file": "fs/notify/fsnotify.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d8c42405fc3507cc43ba7e4986a773c3fc633f6e", "deprecated": false, "digest": { "line_hashes": [ "14930179635948999184593580960373034643", "127975482068473300966056897495652334663", "212543977496041913079330138772260447006", "85105772696967875040809810874464870383", "87961731598905456860679171496013163839", "77339241136851765558461898611415343530", "302664961239107190916533285666470054200", "33438356010034435280375850589954746066", "154450072484285444829569276363779330130", "45377957777698619642090417845430690321", "236259521946509273681874863158726239906", "182663925328534395947488618001499521721", "142685902774572659640114511236933384633", "284705809987898364760126924419366994227", "265967045795199153816311060625866419328", "47268251095253836031405681936793252900", "159648197079446386144233939685549460912", "186861673417280390848356974111015252403", "260345286970030746974744014974866971812", "80071099968351145089901314189726226844", "176998386606970513649605172786308594911", "264199077974781854685104318182835871988", "66689289873129106004552517053598690956", "63073433195784638226439168287579229259" ], "threshold": 0.9 }, "id": "CVE-2024-47660-72694162" }, { "signature_version": "v1", "target": { "file": "fs/notify/mark.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@172e422ffea20a89bfdc672741c1aad6fbb5044e", "deprecated": false, "digest": { "line_hashes": [ "235600063496472941847103153971906013057", "78870945046796825857117051016798969444", "44990637662202321549776607708885529784", "67940077138029054066711117534737166532", "202813193760195482901937516684395870118", "55017931653052702576876146241984877870", "305768907616836165013043727522619684348", "45801055202938502045936035588659508921", "183455154172620496154590777818036924932", "141992322519769970608204815622772824081", "29963555265377072651755160225993092217", "119288350165190705860853822492649762932", "293525164230202944468931993666731090464" ], "threshold": 0.9 }, "id": "CVE-2024-47660-75fbd5b4" }, { "signature_version": "v1", "target": { "function": "__fsnotify_parent", "file": "fs/notify/fsnotify.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3f3ef1d9f66b93913ce2171120d9226b55acd41d", "deprecated": false, "digest": { "length": 1091.0, "function_hash": "132546590188404206646047883486487093889" }, "id": "CVE-2024-47660-7f9d7ab4" }, { "signature_version": "v1", "target": { "function": "fsnotify_inode_watches_children", "file": "include/linux/fsnotify_backend.h" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d8c42405fc3507cc43ba7e4986a773c3fc633f6e", "deprecated": false, "digest": { "length": 179.0, "function_hash": "29181080342166073954667206088507054843" }, "id": "CVE-2024-47660-80ef1d7d" }, { "signature_version": "v1", "target": { "function": "fsnotify_recalc_mask", "file": "fs/notify/mark.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@172e422ffea20a89bfdc672741c1aad6fbb5044e", "deprecated": false, "digest": { "length": 225.0, "function_hash": "32209476703198732229903072547292854641" }, "id": "CVE-2024-47660-86eb3561" }, { "signature_version": "v1", "target": { "function": "fsnotify_inode_watches_children", "file": "include/linux/fsnotify_backend.h" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3f3ef1d9f66b93913ce2171120d9226b55acd41d", "deprecated": false, "digest": { "length": 179.0, "function_hash": "29181080342166073954667206088507054843" }, "id": "CVE-2024-47660-9ac49a32" }, { "signature_version": "v1", "target": { "file": "include/linux/fsnotify_backend.h" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3f3ef1d9f66b93913ce2171120d9226b55acd41d", "deprecated": false, "digest": { "line_hashes": [ "268996248620321159848506628428132533270", "198363465651826001099036282753851829926", "328563151215705538944235843516394429302", "112308327741513160445427878430932550641", "178937512771524495418046925077999106611", "336732349298361860183772166326631357800", "155850649757546848055610713496587064314", "136295995095124565480450699111358729203", "27157811598624949074164646992781817777", "11263002910200185900735473950606811360" ], "threshold": 0.9 }, "id": "CVE-2024-47660-9b530515" }, { "signature_version": "v1", "target": { "file": "fs/notify/mark.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3f3ef1d9f66b93913ce2171120d9226b55acd41d", "deprecated": false, "digest": { "line_hashes": [ "235600063496472941847103153971906013057", "78870945046796825857117051016798969444", "44990637662202321549776607708885529784", "67940077138029054066711117534737166532", "202813193760195482901937516684395870118", "55017931653052702576876146241984877870", "305768907616836165013043727522619684348", "45801055202938502045936035588659508921", "183455154172620496154590777818036924932", "141992322519769970608204815622772824081", "29963555265377072651755160225993092217", "119288350165190705860853822492649762932", "293525164230202944468931993666731090464" ], "threshold": 0.9 }, "id": "CVE-2024-47660-a4af23eb" }, { "signature_version": "v1", "target": { "file": "fs/notify/fsnotify.h" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3f3ef1d9f66b93913ce2171120d9226b55acd41d", "deprecated": false, "digest": { "line_hashes": [ "89048350336048991108715695145584435698", "111636647509727740718999255593434294309", "204169844104393591200005513468102103305" ], "threshold": 0.9 }, "id": "CVE-2024-47660-a817edd1" }, { "signature_version": "v1", "target": { "file": "fs/notify/mark.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d8c42405fc3507cc43ba7e4986a773c3fc633f6e", "deprecated": false, "digest": { "line_hashes": [ "235600063496472941847103153971906013057", "78870945046796825857117051016798969444", "44990637662202321549776607708885529784", "67940077138029054066711117534737166532", "202813193760195482901937516684395870118", "55017931653052702576876146241984877870", "305768907616836165013043727522619684348", "45801055202938502045936035588659508921", "183455154172620496154590777818036924932", "141992322519769970608204815622772824081", "29963555265377072651755160225993092217", "119288350165190705860853822492649762932", "293525164230202944468931993666731090464" ], "threshold": 0.9 }, "id": "CVE-2024-47660-adb78717" }, { "signature_version": "v1", "target": { "function": "fsnotify_recalc_mask", "file": "fs/notify/mark.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d8c42405fc3507cc43ba7e4986a773c3fc633f6e", "deprecated": false, "digest": { "length": 225.0, "function_hash": "32209476703198732229903072547292854641" }, "id": "CVE-2024-47660-aeb11bc4" }, { "signature_version": "v1", "target": { "file": "fs/notify/fsnotify.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@172e422ffea20a89bfdc672741c1aad6fbb5044e", "deprecated": false, "digest": { "line_hashes": [ "237821057210692100367991881029740232398", "278301952535207405464721527884080444631", "212543977496041913079330138772260447006", "85105772696967875040809810874464870383", "87961731598905456860679171496013163839", "77339241136851765558461898611415343530", "302664961239107190916533285666470054200", "33438356010034435280375850589954746066", "154450072484285444829569276363779330130", "45377957777698619642090417845430690321", "236259521946509273681874863158726239906", "182663925328534395947488618001499521721", "142685902774572659640114511236933384633", "284705809987898364760126924419366994227", "265967045795199153816311060625866419328", "47268251095253836031405681936793252900", "159648197079446386144233939685549460912", "167069256357776089140425433929309222636", "295214046934659626054588089098394973571", "38829234338349774570973194485508664244", "176998386606970513649605172786308594911", "264199077974781854685104318182835871988", "66689289873129106004552517053598690956", "63073433195784638226439168287579229259" ], "threshold": 0.9 }, "id": "CVE-2024-47660-b7dae5d6" }, { "signature_version": "v1", "target": { "function": "fsnotify_recalc_mask", "file": "fs/notify/mark.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3f3ef1d9f66b93913ce2171120d9226b55acd41d", "deprecated": false, "digest": { "length": 225.0, "function_hash": "32209476703198732229903072547292854641" }, "id": "CVE-2024-47660-ce58e375" }, { "signature_version": "v1", "target": { "function": "__fsnotify_update_child_dentry_flags", "file": "fs/notify/fsnotify.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3f3ef1d9f66b93913ce2171120d9226b55acd41d", "deprecated": false, "digest": { "length": 651.0, "function_hash": "59360895718221256212915009759997797934" }, "id": "CVE-2024-47660-d0194e03" }, { "signature_version": "v1", "target": { "function": "__fsnotify_update_child_dentry_flags", "file": "fs/notify/fsnotify.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@172e422ffea20a89bfdc672741c1aad6fbb5044e", "deprecated": false, "digest": { "length": 651.0, "function_hash": "77238700940203871923586502650776407667" }, "id": "CVE-2024-47660-f22e7b00" } ] }