From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BDE937647B; Tue, 21 Jul 2026 20:26:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784665577; cv=none; b=V7rRM0kGcOG0lh92IqPKDdKURD7dXIvpAvnQv2tCmBHEVyw92iUjx9JzYDNKjvO1YNkojlwcGWoRdqq+oAzsU2UfiVK/hdAa//M4JJk4D6qIvuc3VkHOP4dHJ7frPTIZSTgRJict0L33Arzrdi8cjoPajw1v8ndWpw3occ+U+6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784665577; c=relaxed/simple; bh=JYv3dYw1yyjaRhc2K9hliSf7bo/4nu1Tq+PValdUSqY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mtr+UYl4ZnvL0pXWwuTLbYJtjuF6qthiHCqlKDCSFVi7L4T8JSDf+p76JoyRi3nNhXYzqDPpx5KnXVwOXYZ3pYgUqsY/yMYNpTjG13mrdPhU3PPtGbOOe75jWn4uoGILiDHk/jUwMUu0W69/yeNSGnNCG0+CpWXcw6JxcX9l9/Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nnQuGH4X; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="nnQuGH4X" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B3711F00A3A; Tue, 21 Jul 2026 20:26:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784665575; bh=tirfryqdPPLlNkB1NRGogGHj70IayO7cC7bXOpIaMi4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nnQuGH4XHx+Fb4YydDHYQ3EAe+C1jG3LRiifC2nOUnuh7SOa5yi15QgLWLZez0cFA k4DhLDGJtsGfUbI6gNZgClGqii7GQC1spHlbTU9Zwi3NcBZpNtzTYgEwexbEDmGLtc VZQBUkpLNEYAaKfmTJXJu5OXc+HLS5XQ3DPMbizo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Matvey Kovalev , David Howells , Marc Dionne , linux-afs@lists.infradead.org, "Christian Brauner (Amutable)" Subject: [PATCH 6.6 0355/1266] afs: fix NULL pointer dereference in afs_get_tree() Date: Tue, 21 Jul 2026 17:13:12 +0200 Message-ID: <20260721152449.774999009@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152441.786066624@linuxfoundation.org> References: <20260721152441.786066624@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matvey Kovalev commit 0b70716081c6462be9b2928ad736d0d527b09678 upstream. afs_alloc_sbi() uses kzalloc for memory allocation. And, if ctx->dyn_root is not null, as->cell and as->volume are null. In trace_afs_get_tree() they are dereferenced. KASAN error message: KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 2 PID: 18478 Comm: syz-executor.7 Not tainted 5.10.246-syzkaller #0 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 RIP: 0010:perf_trace_afs_get_tree+0x1d9/0x550 include/trace/events/afs.h:1365 Call Trace: trace_afs_get_tree include/trace/events/afs.h:1365 [inline] afs_get_tree+0x922/0x1350 fs/afs/super.c:599 vfs_get_tree+0x8e/0x300 fs/super.c:1572 do_new_mount fs/namespace.c:3011 [inline] path_mount+0x14a5/0x2220 fs/namespace.c:3341 do_mount fs/namespace.c:3354 [inline] __do_sys_mount fs/namespace.c:3562 [inline] __se_sys_mount fs/namespace.c:3539 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3539 do_syscall_64+0x33/0x50 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x67/0xd1 Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 80548b03991f5 ("afs: Add more tracepoints") Cc: stable@vger.kernel.org Signed-off-by: Matvey Kovalev Signed-off-by: David Howells Link: https://patch.msgid.link/20260622090856.2746629-4-dhowells@redhat.com cc: Marc Dionne cc: linux-afs@lists.infradead.org Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman --- fs/afs/super.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/afs/super.c +++ b/fs/afs/super.c @@ -597,7 +597,8 @@ static int afs_get_tree(struct fs_contex } fc->root = dget(sb->s_root); - trace_afs_get_tree(as->cell, as->volume); + if (!ctx->dyn_root) + trace_afs_get_tree(as->cell, as->volume); _leave(" = 0 [%p]", sb); return 0;