linux/fs/cachefiles
NeilBrown 1635c2acdd
cachefiles: fix incorrect dentry refcount in cachefiles_cull()
The patch mentioned below changed cachefiles_bury_object() to expect 2
references to the 'rep' dentry.  Three of the callers were changed to
use start_removing_dentry() which takes an extra reference so in those
cases the call gets the expected references.

However there is another call to cachefiles_bury_object() in
cachefiles_cull() which did not need to be changed to use
start_removing_dentry() and so was not properly considered.
It still passed the dentry with just one reference so the net result is
that a reference is lost.

To meet the expectations of cachefiles_bury_object(), cachefiles_cull()
must take an extra reference before the call.  It will be dropped by
cachefiles_bury_object().

Reported-by: Marc Dionne <marc.dionne@auristor.com>
Fixes: 7bb1eb45e4 ("VFS: introduce start_removing_dentry()")
Signed-off-by: NeilBrown <neil@brown.name>
Link: https://patch.msgid.link/177456350181.1851489.16359967086642190170@noble.neil.brown.name
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2026-03-31 11:52:08 +02:00
..
cache.c cachefiles: fix slab-use-after-free in cachefiles_withdraw_cookie() 2024-07-03 10:36:15 +02:00
daemon.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
error_inject.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
interface.c VFS: introduce start_removing_dentry() 2025-11-14 13:15:57 +01:00
internal.h cachefiles: Use lookup_one() rather than lookup_one_len() 2025-04-07 09:25:32 +02:00
io.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig netfs, fscache: Combine fscache with netfs 2023-12-24 15:08:46 +00:00
key.c vfs-6.16-rc1.async.dir 2025-05-26 08:02:43 -07:00
main.c cachefiles: Implement object lifecycle funcs 2022-01-07 13:42:08 +00:00
Makefile cachefiles: notify the user daemon when looking up cookie 2022-05-18 00:11:17 +08:00
namei.c cachefiles: fix incorrect dentry refcount in cachefiles_cull() 2026-03-31 11:52:08 +02:00
ondemand.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
security.c cachefiles: Parse the "secctx" immediately 2024-12-20 22:07:56 +01:00
volume.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xattr.c cachefiles: Add auxiliary data trace 2024-12-20 22:34:05 +01:00