[RFC 0/1] fsnotify: clear PARENT_WATCHED flags lazily for v5.4

Diangang Li posted 1 patch 4 weeks, 1 day ago
fs/notify/fsnotify.c             | 31 +++++++++++++++++++++----------
fs/notify/fsnotify.h             |  2 +-
fs/notify/mark.c                 | 32 +++++++++++++++++++++++++++++---
include/linux/fsnotify_backend.h |  8 +++++---
4 files changed, 56 insertions(+), 17 deletions(-)
[RFC 0/1] fsnotify: clear PARENT_WATCHED flags lazily for v5.4
Posted by Diangang Li 4 weeks, 1 day ago
Hi Amir, Jan, et al,

Commit `41f49be2e51a71` ("fsnotify: clear PARENT_WATCHED flags lazily")
has resolved the softlockup in `__fsnotify_parent` when there are millions
of negative dentries. The Linux kernel CVE team has assigned CVE-2024-47660
to this issue[1]. I noticed that the CVE patch was only backported to the
5.10 stable tree, and not to 5.4. Is there any specific reason or analysis
regarding the 5.4 branch? We have encountered this issue in our production
environments running kernel 5.4. After manually applying and deconflicting
this patch, the problem was resolved.

Any comments or suggestions regarding this backport would be appreciated.

Thanks,
Diangang

[1]: https://lore.kernel.org/all/2024100959-CVE-2024-47660-2d61@gregkh/

Amir Goldstein (1):
  fsnotify: clear PARENT_WATCHED flags lazily

 fs/notify/fsnotify.c             | 31 +++++++++++++++++++++----------
 fs/notify/fsnotify.h             |  2 +-
 fs/notify/mark.c                 | 32 +++++++++++++++++++++++++++++---
 include/linux/fsnotify_backend.h |  8 +++++---
 4 files changed, 56 insertions(+), 17 deletions(-)

-- 
2.39.5
Re: [RFC 0/1] fsnotify: clear PARENT_WATCHED flags lazily for v5.4
Posted by Jan Kara 4 weeks, 1 day ago
On Wed 03-09-25 17:34:12, Diangang Li wrote:
> Hi Amir, Jan, et al,
> 
> Commit `41f49be2e51a71` ("fsnotify: clear PARENT_WATCHED flags lazily")
> has resolved the softlockup in `__fsnotify_parent` when there are millions
> of negative dentries. The Linux kernel CVE team has assigned CVE-2024-47660
> to this issue[1]. I noticed that the CVE patch was only backported to the
> 5.10 stable tree, and not to 5.4. Is there any specific reason or analysis
> regarding the 5.4 branch? We have encountered this issue in our production
> environments running kernel 5.4. After manually applying and deconflicting
> this patch, the problem was resolved.
> 
> Any comments or suggestions regarding this backport would be appreciated.

I don't have any objections against including this in 5.4-stable branch.
Probably it was not applied because of some patch conflict. Feel free to
send the backport to stable@vger.kernel.org, I believe Greg will gladly
pickup the patch.

								Honza

> 
> Thanks,
> Diangang
> 
> [1]: https://lore.kernel.org/all/2024100959-CVE-2024-47660-2d61@gregkh/
> 
> Amir Goldstein (1):
>   fsnotify: clear PARENT_WATCHED flags lazily
> 
>  fs/notify/fsnotify.c             | 31 +++++++++++++++++++++----------
>  fs/notify/fsnotify.h             |  2 +-
>  fs/notify/mark.c                 | 32 +++++++++++++++++++++++++++++---
>  include/linux/fsnotify_backend.h |  8 +++++---
>  4 files changed, 56 insertions(+), 17 deletions(-)
> 
> -- 
> 2.39.5
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR
Re: [RFC 0/1] fsnotify: clear PARENT_WATCHED flags lazily for v5.4
Posted by Amir Goldstein 4 weeks, 1 day ago
On Wed, Sep 3, 2025 at 3:31 PM Jan Kara <jack@suse.cz> wrote:
>
> On Wed 03-09-25 17:34:12, Diangang Li wrote:
> > Hi Amir, Jan, et al,
> >
> > Commit `41f49be2e51a71` ("fsnotify: clear PARENT_WATCHED flags lazily")
> > has resolved the softlockup in `__fsnotify_parent` when there are millions
> > of negative dentries. The Linux kernel CVE team has assigned CVE-2024-47660
> > to this issue[1]. I noticed that the CVE patch was only backported to the
> > 5.10 stable tree, and not to 5.4. Is there any specific reason or analysis
> > regarding the 5.4 branch? We have encountered this issue in our production
> > environments running kernel 5.4. After manually applying and deconflicting
> > this patch, the problem was resolved.

All this above would be nice to send Greg for context
so he can distinguish your posting from AI bots posting backports without
having tested them or without having encountered the issue ;)

But IMO, it is more helpful to send these notes after the ---
line in the patch notes rather than having a single path with a cover letter
as a backport patch.

> >
> > Any comments or suggestions regarding this backport would be appreciated.
>
> I don't have any objections against including this in 5.4-stable branch.
> Probably it was not applied because of some patch conflict. Feel free to
> send the backport to stable@vger.kernel.org, I believe Greg will gladly
> pickup the patch.

Also you need to fix some technical issues with your patch submission.

1. Subject:
[RFC 1/1] fsnotify: clear PARENT_WATCHED flags lazily
change to
[PATCH 5.4] fsnotify: clear PARENT_WATCHED flags lazily

to explain that this is a backport and the target stable branch.

2. mainline reference:
commit 172e422ffea2 ("fsnotify: clear PARENT_WATCHED flags lazily")

The common pattern used in stable tree is:
commit 172e422ffea20a89bfdc672741c1aad6fbb5044e upstream.

3. Signed-offs:
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Diangang Li <lidiangang@bytedance.com>

Unless you are backporting a patch different that upstream version
it is probably better to cherry-pick the commit from upstream without
Sasha's signed-off.
Not a big deal, but at least that's how Greg expects it:
https://lore.kernel.org/stable/2025090200-uniquely-pumice-1afa@gregkh/

and you may add:
Reviewed-by: Amir Goldstein <amir73il@gmail.com>

Thanks,
Amir.