[PATCH 6.12/6.18] afs: Fix leak of ungot volume

From: Alexander Martyniuk

Date: Tue Sep 08 2026 - 11:54:55 EST


From: David Howells <dhowells@xxxxxxxxxx>

commit d672c276f685a540ed2b2a8bafaed4650a89022c upstream.

Fix afs_lookup_volume_rcu() so that it doesn't leak a dying volume if
afs_try_get_volume() fails.

Fixes: 32222f09782f ("afs: Apply server breaks to mmap'd files in the call processor")
Closes: https://sashiko.dev/#/patchset/20260609081738.770127-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
Link: https://patch.msgid.link/20260622090856.2746629-17-dhowells@xxxxxxxxxx
cc: Marc Dionne <marc.dionne@xxxxxxxxxxxx>
cc: Deepakkumar Karn <dkarn@xxxxxxxxxx>
cc: linux-afs@xxxxxxxxxxxxxxxxxxx
Signed-off-by: Christian Brauner (Amutable) <brauner@xxxxxxxxxx>
Signed-off-by: Alexander Martyniuk <alexevgmart@xxxxxxxxx>
---
Backport fix for CVE-2026-80878
fs/afs/callback.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/afs/callback.c b/fs/afs/callback.c
index 0a09a9ca3c6b..652c4301d56e 100644
--- a/fs/afs/callback.c
+++ b/fs/afs/callback.c
@@ -138,6 +138,7 @@ static struct afs_volume *afs_lookup_volume_rcu(struct afs_cell *cell,

if (volume && afs_try_get_volume(volume, afs_volume_trace_get_callback))
break;
+ volume = NULL;
if (!need_seqretry(&cell->volume_lock, seq))
break;
}
--
2.43.0