From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796400431; b=fWPDmAhm/cVB2L7PsLBtOMYvwHSAr7SktCqo+T3tXrh6rNGJ42tF5uTPylROEFiv7NBa rxURq0GH343cFivdL0KSkvar7o8DiE0zj3TdoRiaYn4WSUYJZfO/41qGt3huftwBUxHWl RWhP6tDsVou4Va3Cmi5SCfDlaL3Qm0HyISh5+RJJTBZEj/kTDiDOsBK0KqkRocZqbYovG WPf9fn42kiZhma1/CggtRXj8VtVcsB4Cwu8aJFArzGTCDKvzkH8Kn1rA+yRbDQKvtT/Dl uEjehezyXg7/ZQ2gSfahRdDyBRY2hEkSBhg6X659Uq3ywbI1uiDn+U600B8HQa+P1nQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796400431; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=aW2Vfl+T6F8CVWJ34tS178RE23m6WMtYGEdwtqQgqfY=; b=XxRHvzQK33OZab/pi0etk7tqulpuk250UWQVE4oESuO2tWZXheMWniANrP0zmdFP48M4 5exOEDApijMrCzv+UGSiIxgMtsjmNJ48NtLQ51FOp0YldUWwHuXZ4Kpu+F19nMYxnT8sb RDDi7VnbteYg3iac9ocEkTKQJWDY98rW4K6dFI7B4IYZxtN+29L+jCINDDtMxkMD7/E3w ZCGZWEdVpIsMNhn0RMCncmoNG8HwRBct2/dujFMNYGklK/BElrhv3wCbMVrcYzxzbu9Zi H8Ym0A8i9CoUYNkQpZX0a7o/HcsGIfuPjRyQYbcbxWWA2Y5bcMJMpoDEYeXCgoyfGTw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=U5Q9Daz5; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEECA606A322 for ; Fri, 4 Dec 2026 16:07:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=U5Q9Daz5 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E1831F000C2; Fri, 4 Dec 2026 16:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796400431; bh=aW2Vfl+T6F8CVWJ34tS178RE23m6WMtYGEdwtqQgqfY=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=U5Q9Daz5Va92ViqPnlwjtGGhRCRcM/b8NORUc/pHPqxb6WUOPgwIhRueML6vdUNyv CobxDfhPW16xhuj1eAMdn3JHS677GvVnRU6ySNwU3w99dwr5JRJzw2TFNQpXeA8W+i OAxtNKpS7W1Quwbxg46+pRgNGlOZRM1Q48h5LYrJLePCj4r4A6m8iWTFhuFx1XjdCA 9iTNXDhCk7F3MvHZIbyD92/U5m1WIktX0pbwrAF9xo/s5Oj5hHGtpyFo5wfL/ecH2C AIYr2bnEGgzS0p7fb86nQBMjme+d6NfFhuYAcVqnXnyqBsj7FJzXkbjNEI68vTseFY +Orx4qwTYhPUA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 bpf-next 2/6] bpf: Don't allow the IMA helpers on inode_getxattr and inode_getattr Reply-To: sashiko-reviews@lists.linux.dev To: "Anton Protopopov" , bpf@vger.kernel.org In-Reply-To: <20261204155438.1413411-3-a.s.protopopov@gmail.com> References: <20261204155438.1413411-1-a.s.protopopov@gmail.com> <20261204155438.1413411-3-a.s.protopopov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 16:07:11 +0000 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] bpf: Fixes trailer cites 423f16108c9d instead of 27672f0d280a -- commit 1530c83bfb984cb9b336b48e9f99703d6ca8c173 Author: Anton Protopopov > bpf: Don't allow the IMA helpers on inode_getxattr and inode_getattr > > The bpf_ima_inode_hash() and bpf_ima_file_hash() helpers take > iint->mutex in __ima_inode_hash(). IMA takes iint->mutex before the > inode lock in process_measurement(). So a program which calls them > with the inode locked can deadlock against a concurrent open of the > file. > > The inode_getxattr and inode_getattr hooks are sometimes called with > the inode locked. EVM reads xattrs with vfs_getxattr() to update > security.evm from the post setxattr, removexattr and setattr hooks, > which run with the inode locked. And nfsd_setattr() locks the inode > before fh_fill_pre_attrs() calls vfs_getattr(). IMA also verifies > security.evm with iint->mutex held and EVM reads the xattrs with > vfs_getxattr(). So a program on inode_getxattr can wait for the mutex > which its own task holds. > > The hooks can't go to d_inode_locked_hooks as most callers don't hold > the lock. Don't allow the helpers on them. > > Fixes: 423f16108c9d ("bpf: Augment the set of sleepable LSM hooks") > Signed-off-by: Anton Protopopov [Severity: Low] Commit 423f16108c9d ("bpf: Augment the set of sleepable LSM hooks") only marked bpf_lsm_inode_getattr and bpf_lsm_inode_getxattr as sleepable, and both remain sleepable after this patch. bpf_ima_inode_hash() and bpf_ima_inode_hash_allowed() were introduced later. Should this use: Fixes: 27672f0d280a ("bpf: Add a BPF helper for getting the IMA hash of a= n inode") --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204155438.1413= 411-1-a.s.protopopov@gmail.com?part=3D2