summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2025-02-18 19:22:47 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-03-07 18:25:29 +0100
commita38b394f465010568ebc23eb29e17b9e4f173ce2 (patch)
treecd50c4541449dcd5ab1a18bad465afb5d8c1d8a7 /include
parentb5c7428d3488af060d2b588fc55aa0a7d626e314 (diff)
downloadlinux-a38b394f465010568ebc23eb29e17b9e4f173ce2.tar.gz
linux-a38b394f465010568ebc23eb29e17b9e4f173ce2.tar.bz2
linux-a38b394f465010568ebc23eb29e17b9e4f173ce2.zip
afs: Fix the server_list to unuse a displaced server rather than putting it
[ Upstream commit add117e48df4788a86a21bd0515833c0a6db1ad1 ] 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: 977e5f8ed0ab ("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>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions