From: Cai Xinchen <caixinchen1@huawei.com>
To: Guicai Ma <maguicai@kylinos.cn>,
<nicolas.bouchinet@oss.cyber.gouv.fr>, <xiujianfeng@huawei.com>,
<paul@paul-moore.com>, <jmorris@namei.org>, <serge@hallyn.com>,
<shuah@kernel.org>, <kalevi@kolttonen.fi>
Cc: <linux-security-module@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
<bpf@vger.kernel.org>, <lujialin4@huawei.com>
Subject: Re: [PATCH v3 8/8] selftests/lsm: add lockdown securityfs test
Date: Mon, 30 Nov 2026 15:19:36 +0800 [thread overview]
Message-ID: <be0d3732-6c95-4503-b79e-5e4698f86182@huawei.com> (raw)
In-Reply-To: <20261127021029.2562038-1-maguicai@kylinos.cn>
Thanks for your review.
I will change $(call RUN_TESTS, lockdown_test) to $(call RUN_TESTS,
$(OUTPUT)/lockdown_test) in v4. And I will add CAP_DAC_OVERRIDE check
for non-root user and allow non-root user check read-format in v4.
Thanks for your tests.
On 11/27/2026 10:10 AM, Guicai Ma wrote:
> On Thu, Nov 26, 2026 at 09:13:15PM +0800, Cai Xinchen wrote:
>> +run_lockdown_test: all
>> + $(call RUN_TESTS, lockdown_test)
> As Sashiko noted, out-of-tree builds fail here because the binary lives
> under $(OUTPUT). Running with OUTPUT= set produces:
>
> # Warning: file lockdown_test is missing!
> not ok 1 selftests: lsm: lockdown_test
>
> Using $(OUTPUT)/lockdown_test here works both in-tree and out-of-tree.
>
>> + if (geteuid() != 0)
>> + SKIP(return, "requires root");
>> + if (status_writable())
>> + SKIP(return, "cannot open %s for writing: %s",
>> + LOCKDOWN_PATH, strerror(errno));
> Having both checks in FIXTURE_SETUP() makes non-root runs skip
> read_format as well, leaving the 0644 / open(O_WRONLY) EACCES behavior
> documented in 7/8 uncovered. Moving the write/root gate out of
> read_format (or adding an unprivileged open() check) would cover that
> part of the ABI too.
>
> I also ran the lockdown_test binary under QEMU/KVM on arm64 (mainline
> 9437ee8b6cf6 with this series applied, KASAN + lockdep,
> CONFIG_SECURITY_LOCKDOWN_LSM=y). Under lsm=lockdown, uid 65534 skipped
> all 5 cases, while root runs passed none -> integrity (5/5),
> integrity -> confidentiality (5/5), and confidentiality (4 pass, 1 skip
> on upgrade). Booting with lsm=yama skipped all 5 cases on ENOENT, with
> no KASAN or lockdep warnings.
>
> Thanks,
> Guicai Ma
prev parent reply other threads:[~2026-11-30 7:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 13:13 [PATCH v3 0/8] lockdown: fix the securityfs interface and add tests Cai Xinchen
2026-11-26 13:13 ` [PATCH v3 1/8] lockdown: Add break in lockdown_write Cai Xinchen
2026-11-26 13:13 ` [PATCH v3 2/8] lockdown: remove useless decrement operation Cai Xinchen
2026-11-26 13:13 ` [PATCH v3 3/8] lockdown: select SECURITYFS Cai Xinchen
2026-11-26 13:13 ` [PATCH v3 4/8] lsm: remove unused lockdown audit data Cai Xinchen
2026-11-26 13:13 ` [PATCH v3 5/8] lockdown: drop an unused include and move lockdown_reasons Cai Xinchen
2026-11-26 13:13 ` [PATCH v3 6/8] lockdown: bound the status string with scnprintf Cai Xinchen
2026-11-26 13:13 ` [PATCH v3 7/8] Documentation/ABI: document the lockdown securityfs file Cai Xinchen
2026-11-26 13:13 ` [PATCH v3 8/8] selftests/lsm: add lockdown securityfs test Cai Xinchen
2026-11-27 2:10 ` Guicai Ma
2026-11-30 7:19 ` Cai Xinchen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=be0d3732-6c95-4503-b79e-5e4698f86182@huawei.com \
--to=caixinchen1@huawei.com \
--cc=bpf@vger.kernel.org \
--cc=jmorris@namei.org \
--cc=kalevi@kolttonen.fi \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=lujialin4@huawei.com \
--cc=maguicai@kylinos.cn \
--cc=nicolas.bouchinet@oss.cyber.gouv.fr \
--cc=paul@paul-moore.com \
--cc=serge@hallyn.com \
--cc=shuah@kernel.org \
--cc=xiujianfeng@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®