]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
afs: Fix potential null pointer dereference in afs_put_server
authorZhen Ni <zhen.ni@easystack.cn>
Tue, 23 Sep 2025 07:51:04 +0000 (15:51 +0800)
committerChristian Brauner <brauner@kernel.org>
Thu, 25 Sep 2025 07:18:17 +0000 (09:18 +0200)
commit9158c6bb245113d4966df9b2ba602197a379412e
tree42c3adc764cfd70f0b9e1b7efdaf59faf8d66c18
parent66d938e89e940e512f4c3deac938ecef399c13f9
afs: Fix potential null pointer dereference in afs_put_server

afs_put_server() accessed server->debug_id before the NULL check, which
could lead to a null pointer dereference. Move the debug_id assignment,
ensuring we never dereference a NULL server pointer.

Fixes: 2757a4dc1849 ("afs: Fix access after dec in put functions")
Cc: stable@vger.kernel.org
Signed-off-by: Zhen Ni <zhen.ni@easystack.cn>
Acked-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeffrey Altman <jaltman@auristor.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/afs/server.c