Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4C7FB18FDD5 for ; Wed, 16 Apr 2025 14:17:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744813044; cv=none; b=RrFmmDz709tKl8cu7d8oRkFj8jMh7+jKGlfPUyYsQqFfA4d49cFgEwoB6ING8TikrWZ4p1F3t9aiKsDs2qbToT2hT0XCoORiJts4G2FQzEboEqayhrlrwySvCg8/eiE2XdAIDIq3R7c23ei/cLV4K7SbDxD7pIkOBjLSrm5p5pg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744813044; c=relaxed/simple; bh=HZhzDNXuzK4/WOYfuvoBaOlD/tVRzcUgMkqOaFiZLR8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=sJPho+uUIGSSoMrmosId+slBZVdlosYa+0XH9S4Qr4+XRFH8UWT1pC8NueVC6u/60tZF3aFwSn1ujzSwsCDbbZmw8sHWG8Rv+BDKT4tjVy4sqGRYinfg8HzhxDk1lSAN8Zqi1j8Ec2lqvgQCtPo2j8Idi8B27A7s/psmetnJRBk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ncu3OUiu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Ncu3OUiu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0CE8C4CEE2; Wed, 16 Apr 2025 14:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744813044; bh=HZhzDNXuzK4/WOYfuvoBaOlD/tVRzcUgMkqOaFiZLR8=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Ncu3OUiu8uyWaJtRfJyOgkNtGPHP4HazTd2CnBY4LJPLIcHXz+GGy1DBmfEMCno3N AAM8jEGglq0+7BM/3MrqrscDehkrfTkvVF8aljjQuElIrEfuuK61xPgjfF6AOnYwy2 kxRuh8Ab1wO+JpnEjS8iR4I9fHeRKMIoHHo8pRZQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-22070: fs/9p: fix NULL pointer dereference on mkdir Date: Wed, 16 Apr 2025 16:12:41 +0200 Message-ID: <2025041610-CVE-2025-22070-4509@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=4192; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=HZhzDNXuzK4/WOYfuvoBaOlD/tVRzcUgMkqOaFiZLR8=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn/d+3aZO0ZGs7cOtWrOKpaOkPQYwPf/ff10yZv4W7O3 72w8vKrjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhI9h+G+UFXRPKZ5218PV15 LoP05YuCj+foljLMs5yhYPPihv3eeQ6TeExc7kR372m4AwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: fs/9p: fix NULL pointer dereference on mkdir When a 9p tree was mounted with option 'posixacl', parent directory had a default ACL set for its subdirectories, e.g.: setfacl -m default:group:simpsons:rwx parentdir then creating a subdirectory crashed 9p client, as v9fs_fid_add() call in function v9fs_vfs_mkdir_dotl() sets the passed 'fid' pointer to NULL (since dafbe689736) even though the subsequent v9fs_set_create_acl() call expects a valid non-NULL 'fid' pointer: [ 37.273191] BUG: kernel NULL pointer dereference, address: 0000000000000000 ... [ 37.322338] Call Trace: [ 37.323043] [ 37.323621] ? __die (arch/x86/kernel/dumpstack.c:421 arch/x86/kernel/dumpstack.c:434) [ 37.324448] ? page_fault_oops (arch/x86/mm/fault.c:714) [ 37.325532] ? search_module_extables (kernel/module/main.c:3733) [ 37.326742] ? p9_client_walk (net/9p/client.c:1165) 9pnet [ 37.328006] ? search_bpf_extables (kernel/bpf/core.c:804) [ 37.329142] ? exc_page_fault (./arch/x86/include/asm/paravirt.h:686 arch/x86/mm/fault.c:1488 arch/x86/mm/fault.c:1538) [ 37.330196] ? asm_exc_page_fault (./arch/x86/include/asm/idtentry.h:574) [ 37.331330] ? p9_client_walk (net/9p/client.c:1165) 9pnet [ 37.332562] ? v9fs_fid_xattr_get (fs/9p/xattr.c:30) 9p [ 37.333824] v9fs_fid_xattr_set (fs/9p/fid.h:23 fs/9p/xattr.c:121) 9p [ 37.335077] v9fs_set_acl (fs/9p/acl.c:276) 9p [ 37.336112] v9fs_set_create_acl (fs/9p/acl.c:307) 9p [ 37.337326] v9fs_vfs_mkdir_dotl (fs/9p/vfs_inode_dotl.c:411) 9p [ 37.338590] vfs_mkdir (fs/namei.c:4313) [ 37.339535] do_mkdirat (fs/namei.c:4336) [ 37.340465] __x64_sys_mkdir (fs/namei.c:4354) [ 37.341455] do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) [ 37.342447] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) Fix this by simply swapping the sequence of these two calls in v9fs_vfs_mkdir_dotl(), i.e. calling v9fs_set_create_acl() before v9fs_fid_add(). The Linux kernel CVE team has assigned CVE-2025-22070 to this issue. Affected and fixed versions =========================== Issue introduced in 6.0 with commit dafbe689736f62c696ac64809b17bdc752cfbe76 and fixed in 6.12.23 with commit 8522051c58d68146b93e8a5ba9987e83b3d64e7b Issue introduced in 6.0 with commit dafbe689736f62c696ac64809b17bdc752cfbe76 and fixed in 6.13.11 with commit 2139dea5c53e3bb63ac49a6901c85e525a80ee8a Issue introduced in 6.0 with commit dafbe689736f62c696ac64809b17bdc752cfbe76 and fixed in 6.14.2 with commit 6517b395cb1e43fbf3962dd93e6fb4a5e5ab100e Issue introduced in 6.0 with commit dafbe689736f62c696ac64809b17bdc752cfbe76 and fixed in 6.15-rc1 with commit 3f61ac7c65bdb26accb52f9db66313597e759821 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-22070 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: fs/9p/vfs_inode_dotl.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/8522051c58d68146b93e8a5ba9987e83b3d64e7b https://git.kernel.org/stable/c/2139dea5c53e3bb63ac49a6901c85e525a80ee8a https://git.kernel.org/stable/c/6517b395cb1e43fbf3962dd93e6fb4a5e5ab100e https://git.kernel.org/stable/c/3f61ac7c65bdb26accb52f9db66313597e759821