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=1796305501; b=fbUPCCP25OWo8cbYOAV2dXzAkA7fJvfx7vYIXyWAL+sL2j2EEDJMFMFPhzAdwVwJLbKO uXba2RDjuW+Xp8BWvBrsdkFg3onFlROsRxZy8SmqkW69pz7DaktSGAoS7URYTVK8pH5f1 omB5hN0epAiBoKWb+qYaozpeNBn+Hp8Gde4rCeIetK9k0NDsLCgqsImj+sI35FphrVJj8 p8yiiTBkMd6dPsHczHyifQSsQFX40TA4o4UA18jh4T4FRG8YO8JgdkpD2DGnXIeY98opC pKZLju38x53uTgjeTSDvmK/x6LrDDynzL0NfiHyB9gq0NwVyS125uzBuXCEKQeOPBXw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796305501; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=rFOKMelAsj8ciqs3fGJWcoRGAAs7/vsOSZU526q9jf4=; b=W0lFmft7Vpy6xnBySkbNCOV2LJhdMNj6zNXZPhxQnoyI2r/1+9v3jfx3fJXKdCOWD2pR hKI1tRKKiaBFZtDjq5fDymv39BUh2FUuvCzNrm7KRE0rCI3dBfnk0pZwEFls3CvWd1V1+ rn/tmPPk3WYygz9ygkjBOsEd52ie0M1BEC/KHYTu9d98U3HW6YyiMWDwzXs0zS/0daaTW VFexamYbCWP41kkdjQm35vsIALZB2H8hiQK3RDL4eqExc4AR3NMQb1V89qPO1MnjlBYby r0w8h8lZxYTe6aWG2o5ek9T85G+GhwPr/ZPbjktUg31cpxxZiGWkXhWgGhmNOdpXu/g== 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=KWeqmV01; 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 36337606A322 for ; Thu, 3 Dec 2026 13:45:01 +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=KWeqmV01 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2E041F000C1; Thu, 3 Dec 2026 13:45:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796305501; bh=rFOKMelAsj8ciqs3fGJWcoRGAAs7/vsOSZU526q9jf4=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=KWeqmV01GrIRvZ/Tq0B7N4wAyivuAPUOR4t3gJGBmfTf+PqWGGxTrezRy5KbZXE92 vVU/hHoopUJWmzo6NEwAHIcOrle/LROmZzvh4mvwlBZM+lroRfXCJiiSgyhReJQHxO Lm3yxdAJGYLDhPOhqbPObzuEIWrHu9kSKMxMnRhKbT4xdl3mgKUJ9lmsPIYTk31N1s XL8RCFcAt0HuH7FUtkh32i43KdJ6q4z1/3jyF8eCxtvSTwDw19Tj5x04ZKoCvZwBWs hjwzxNcLkwimqSXv+azGLMVamC4XuY+yj5/aouWrhpLrfkewwWNBQSQ9QPWmFI7iuQ wi5OGnvByLNdQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v1 bpf-next 3/3] selftests/bpf: Test xattr kfuncs on the new sleepable inode hooks Reply-To: sashiko-reviews@lists.linux.dev To: "Anton Protopopov" , bpf@vger.kernel.org In-Reply-To: <20261203134411.1092433-4-a.s.protopopov@gmail.com> References: <20261203134411.1092433-1-a.s.protopopov@gmail.com> <20261203134411.1092433-4-a.s.protopopov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 13:45:00 +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: - [Medium] selftests/bpf: test_inode_xattr() fails on missing ACL or fileattr support -- commit 4210eebb6e4c6f13c9f673ce6c5fcebebb0b66cb Author: Anton Protopopov selftests/bpf: Test xattr kfuncs on the new sleepable inode hooks This commit adds the inode_xattr subtest to fs_kfuncs to exercise bpf_get_inode_xattr(), bpf_set_dentry_xattr(), and bpf_remove_dentry_xattr() on the new sleepable inode LSM hooks, along with verifier accept and reject tests for inode_copy_up. > diff --git a/tools/testing/selftests/bpf/prog_tests/fs_kfuncs.c b/tools/t= esting/selftests/bpf/prog_tests/fs_kfuncs.c > index 43a26ec69a8e3..ad467c7663808 100644 > --- a/tools/testing/selftests/bpf/prog_tests/fs_kfuncs.c > +++ b/tools/testing/selftests/bpf/prog_tests/fs_kfuncs.c > @@ -194,6 +202,102 @@ static void test_set_remove_xattr(void) > remove(testfile); > } [ ... ] > + /* inode_set_acl, inode_remove_acl and inode_file_setattr change xattrs= */ > + err =3D setxattr(file, "system.posix_acl_access", &acl, sizeof(acl), 0); > + if (ASSERT_OK(err, "set acl")) { > + ASSERT_EQ(skel->data->set_acl_ret, 0, "set_acl_ret"); > + ASSERT_TRUE(has_bar(skel, file), "bar after set acl"); > + > + ASSERT_OK(removexattr(file, "system.posix_acl_access"), "remove acl"); > + ASSERT_EQ(skel->data->remove_acl_ret, 0, "remove_acl_ret"); > + err =3D getxattr(file, skel->rodata->xattr_bar, NULL, 0); > + ASSERT_TRUE(err =3D=3D -1 && errno =3D=3D ENODATA, "bar after remove a= cl"); > + } > + > + if (ASSERT_OK(ioctl(fd, FS_IOC_GETFLAGS, &flags), "FS_IOC_GETFLAGS") && > + ASSERT_OK(ioctl(fd, FS_IOC_SETFLAGS, &flags), "FS_IOC_SETFLAGS")) { > + ASSERT_EQ(skel->data->file_setattr_ret, 0, "file_setattr_ret"); > + ASSERT_TRUE(has_bar(skel, file), "bar after file setattr"); > + } [Severity: Medium] Should test_inode_xattr() skip when POSIX ACLs or FS_IOC_GETFLAGS/FS_IOC_SETFLAGS are not supported on /tmp, instead of failing? tools/testing/selftests/bpf/config enables CONFIG_TMPFS and CONFIG_TMPFS_XATTR without CONFIG_TMPFS_POSIX_ACL, so on a tmpfs /tmp the initial xattr probe passes and setting system.posix_acl_access fails with EOPNOTSUPP. With CONFIG_FS_POSIX_ACL=3Dy on a filesystem without POSIX ACL support, vfs_set_acl() calls security_inode_set_acl() before set_posix_acl() returns -EOPNOTSUPP. That leaves security.bpf.bar set on file when the if block is skipped, leaking into the FS_IOC_SETFLAGS has_bar() check. Similarly, xattr-capable filesystems without fileattr_get/fileattr_set (such as 9p) return ENOTTY or EOPNOTSUPP from FS_IOC_GETFLAGS, failing ASSERT_OK() instead of calling test__skip(). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203134411.1092= 433-1-a.s.protopopov@gmail.com?part=3D3