linux-yocto/fs/afs
David Howells 3f0ecb5b1b afs: Fix the server_list to unuse a displaced server rather than putting it
[ Upstream commit add117e48d ]

When allocating and building an afs_server_list struct object from a VLDB
record, we look up each server address to get the server record for it -
but a server may have more than one entry in the record and we discard the
duplicate pointers.  Currently, however, when we discard, we only put a
server record, not unuse it - but the lookup got as an active-user count.

The active-user count on an afs_server_list object determines its lifetime
whereas the refcount keeps the memory backing it around.  Failing to reduce
the active-user counter prevents the record from being cleaned up and can
lead to multiple copied being seen - and pointing to deleted afs_cell
objects and other such things.

Fix this by switching the incorrect 'put' to an 'unuse' instead.

Without this, occasionally, a dead server record can be seen in
/proc/net/afs/servers and list corruption may be observed:

    list_del corruption. prev->next should be ffff888102423e40, but was 0000000000000000. (prev=ffff88810140cd38)

Fixes: 977e5f8ed0 ("afs: Split the usage count on struct afs_server")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
Link: https://patch.msgid.link/20250218192250.296870-5-dhowells@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-03-07 16:56:43 +01:00
..
addr_list.c
afs_cm.h
afs_fs.h
afs_vl.h afs: Fix the maximum cell name length 2025-01-17 13:34:40 +01:00
afs.h afs: Fix the maximum cell name length 2025-01-17 13:34:40 +01:00
callback.c afs: fix the usage of read_seqbegin_or_lock() in afs_lookup_volume_rcu() 2024-02-05 20:12:48 +00:00
cell.c afs: Make it possible to find the volumes that are using a server 2025-03-07 16:56:43 +01:00
cmservice.c
dir_edit.c afs: Fix missing subdir edit when renamed between parent dirs 2024-11-08 16:26:43 +01:00
dir_silly.c
dir.c afs: Fix EEXIST error returned from afs_rmdir() to be ENOTEMPTY 2025-02-21 13:48:53 +01:00
dynroot.c
file.c afs: fix __afs_break_callback() / afs_drop_open_mmap() race 2024-08-29 17:30:34 +02:00
flock.c
fs_operation.c
fs_probe.c
fsclient.c
inode.c
internal.h afs: Make it possible to find the volumes that are using a server 2025-03-07 16:56:43 +01:00
Kconfig
main.c
Makefile
misc.c
mntpt.c afs: Don't cross .backup mountpoint from backup volume 2024-06-16 13:41:31 +02:00
proc.c
protocol_afs.h
protocol_uae.h
protocol_yfs.h
rotate.c
rxrpc.c
security.c
server_list.c afs: Fix the server_list to unuse a displaced server rather than putting it 2025-03-07 16:56:43 +01:00
server.c afs: Make it possible to find the volumes that are using a server 2025-03-07 16:56:43 +01:00
super.c
vl_alias.c afs: Make it possible to find the volumes that are using a server 2025-03-07 16:56:43 +01:00
vl_list.c
vl_probe.c
vl_rotate.c
vlclient.c afs: Fix the maximum cell name length 2025-01-17 13:34:40 +01:00
volume.c afs: Make it possible to find the volumes that are using a server 2025-03-07 16:56:43 +01:00
write.c
xattr.c
xdr_fs.h afs: Fix directory format encoding struct 2025-02-21 13:48:53 +01:00
yfsclient.c afs: Fix the fallback handling for the YFS.RemoveFile2 RPC call 2025-02-21 13:48:54 +01:00