All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.com>
Cc: Stephen Smalley <stephen.smalley.work@gmail.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v4 1/2] core: add tst_selinux_enabled() utility
Date: Wed, 23 Jul 2025 14:51:26 +0200	[thread overview]
Message-ID: <20250723125126.GB154226@pevik> (raw)
In-Reply-To: <54a9a8ba-4d1e-4476-81f5-dceaadc8a82a@suse.com>

Hi all,

> On 7/22/25 3:48 PM, Stephen Smalley wrote:
> > I guess my only question here is whether the tests all require SELinux
> > to be enforcing or if some of them are just exercising SELinux
> > functionality that would also pass when permissive. And whether you
> > care about testing that case.

> Hi Stephen,

> this particular reproducer doesn't need more than knowing a LSM is up and
> running, so we can trigger the bug on listxattr.
> In our case, we chosen SELinux because it's popular and this approach is
> more practical than checking every single LSM implementation in the system,
> verifying if it's enabled or not, no matter SELinux is configured in
> permissive or enforcing mode.

Thanks for info. Feel free to merge this as is and add support for other LSM
later. Either you send a patch later or please share what's needed to be done.

FYI with disabled SELinux and using other LSM
$ cat /proc/cmdline
... BOOT_IMAGE=/boot/vmlinuz-6.16.0-rc1-236-g8c6bc74c7f891-1.ga27462d-vanilla security=selinux selinux=0 enforcing=0 ima_policy=critical_data

cat /sys/kernel/security/lsm
lockdown,capability,landlock,yama,bpf,ima,evm

and with modified your test to not check for SELinux does not reproduce the bug:
# ./listxattr04
...
listxattr04.c:52: TPASS: listxattr() correctly read attributes length

I suppose at least capability, IMA, EVM and BPF aren't triggering it (there are
definitely used by the kernel). Maybe it requires AppArmor or use other LSM
(which might require their own kernel command line).
Because any LSM means any kernel would be vulnerable. If it's just SELinux and
AppArmor fewer kernels are affected.

Kind regards,
Petr

> - Andrea


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2025-07-23 12:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-22  6:55 [LTP] [PATCH v4 0/2] Add listxattr04 test reproducer Andrea Cervesato
2025-07-22  6:55 ` [LTP] [PATCH v4 1/2] core: add tst_selinux_enabled() utility Andrea Cervesato
2025-07-22 10:51   ` Petr Vorel
2025-07-22 12:06   ` Petr Vorel
2025-07-22 13:18     ` Stephen Smalley
2025-07-22 13:20       ` Stephen Smalley
2025-07-22 13:42         ` Petr Vorel
2025-07-22 13:48           ` Stephen Smalley
2025-07-23 11:17             ` Andrea Cervesato via ltp
2025-07-23 12:51               ` Petr Vorel [this message]
2025-07-23 11:19     ` Andrea Cervesato via ltp
2025-07-23 12:41       ` Petr Vorel
2025-07-23 12:43         ` Andrea Cervesato via ltp
2025-07-23 12:46           ` Stephen Smalley
2025-07-23 13:13             ` Stephen Smalley
2025-07-23 13:15               ` Andrea Cervesato via ltp
2025-07-23 19:50                 ` Petr Vorel
2025-07-22 19:12   ` Wei Gao via ltp
2025-07-22  6:55 ` [LTP] [PATCH v4 2/2] Add listxattr04 reproducer Andrea Cervesato
2025-07-22 14:11   ` Petr Vorel
2025-07-22 14:11     ` Petr Vorel

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=20250723125126.GB154226@pevik \
    --to=pvorel@suse.cz \
    --cc=andrea.cervesato@suse.com \
    --cc=ltp@lists.linux.it \
    --cc=stephen.smalley.work@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.