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 CDCA244AB62; Tue, 21 Jul 2026 21:18:22 +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=1784668704; cv=none; b=eIM5zKawIrKAUDj4b+9REZJlfg1VxNoVBeoxoXFZHP9v5ClPIHMXKeHfL7MnvhCHSko8Wou89b3TFV+7IcysXKVm7H03V+pD27LBk/RZiHZp6B3M+fUqUr13wkhj6xnMpreQXeaO1k6maInVwmUsdmNFjM4sISYAUQuUzaJawKk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784668704; c=relaxed/simple; bh=M8xmPfQdJRRklSS6MqeZYAPrP0kboAGQoUzVFWqDHwg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D3bi9u90lPE+KwqBk9GpQi3XEPuiQp7pvFr9bAAwOcHnzCGiIY4vCW+jpvMqjUYbLnK62NDakTaGhFhEAmtpoqZha6dHbyW0NfMAnpogNqJHij4w0BJLAVgGYbTFho1abykV2ubu46480f7BjyMQNjkY24Wf/dqKRzclB4I7/Os= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Fg4WLnL8; 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="Fg4WLnL8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EC071F000E9; Tue, 21 Jul 2026 21:18:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784668702; bh=Vm9Y2TTvDGSbSCGQSNbIzQX5SRupOM0ypEKq+44r1GI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Fg4WLnL8cKwF53cD/preYLq81zBv/cD5IAly51yGjfWacN4jJ3QzDxXcUv/yGyVN9 MSI12NJnSzuKYsiMtDkXhs7BIQRY+3fIHT0vj+RY8Qs2ZiLdme5SfJGcxdONUyNRPi 3l6eOnjji4zVEmbeCWAi71csJHNk3b/JIV7MLJ5U= 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.1 0275/1067] afs: fix NULL pointer dereference in afs_get_tree() Date: Tue, 21 Jul 2026 17:14:36 +0200 Message-ID: <20260721152430.747149871@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152424.521567757@linuxfoundation.org> References: <20260721152424.521567757@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.1-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;