mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Samir M <samir@linux.ibm.com>
To: linux-kernel@vger.kernel.org, Madhavan Srinivasan <maddy@linux.ibm.com>
Subject: [mainline] LTP: lsm_list_modules02 test failing - syscall returns incorrect LSM IDs.
Date: Mon, 13 Apr 2026 19:11:43 +0530	[thread overview]
Message-ID: <35f5edcc-bc12-4f4b-84c7-0ff9d007e2c5@linux.ibm.com> (raw)

Hi,

I'm reporting a bug in the lsm_list_modules() syscall on kernel version 
7.0.0-rc7. The syscall is returning LSM IDs that don't match the active 
LSMs shown in /sys/kernel/security/lsm.

Problem Summary:
================
The lsm_list_modules() syscall returns LSM IDs for modules that are NOT 
active (safesetid, apparmor), while failing to return IDs for modules 
that ARE active (yama, ima).

Active LSMs (from /sys/kernel/security/lsm):
lockdown,capability,landlock,yama,selinux,bpf,ima,evm

Kernel Configuration:
=====================
# CONFIG_SECURITY_APPARMOR is not set
# CONFIG_SECURITY_SAFESETID is not set

This confirms AppArmor and SafeSetID are NOT compiled into the kernel.

Test Output:
============
Running: /opt/ltp/testcases/bin/lsm_list_modules02

tst_buffers.c:57: TINFO: Test is using guarded buffers
tst_test.c:2059: TINFO: LTP version: 20260130-105-g07b599e48
tst_test.c:2062: TINFO: Tested kernel: 7.0.0-rc7 #1 SMP PREEMPT ppc64le
tst_kconfig.c:90: TINFO: Parsing kernel config 
'/lib/modules/7.0.0-rc7/build/.config'
tst_test.c:1887: TINFO: Overall timeout per run is 0h 05m 24s
lsm_list_modules02.c:40: TPASS: lsm_list_modules(ids, size, 0) returned 8
lsm_list_modules02.c:42: TPASS: lsm_num == lsm_names_count (8)
lsm_list_modules02.c:43: TPASS: *size == lsm_num * sizeof(uint64_t) (64)
lsm_list_modules02.c:110: TFAIL: 'safesetid' has not been found
lsm_list_modules02.c:104: TPASS: 'capability' is enabled
lsm_list_modules02.c:104: TPASS: 'bpf' is enabled
lsm_list_modules02.c:110: TFAIL: 'apparmor' has not been found
lsm_list_modules02.c:104: TPASS: 'selinux' is enabled
lsm_list_modules02.c:104: TPASS: 'lockdown' is enabled
lsm_list_modules02.c:104: TPASS: 'landlock' is enabled
lsm_list_modules02.c:104: TPASS: 'evm' is enabled

Summary:
passed   9
failed   2
broken   0
skipped  0
warnings 0

The Issue:
==========
The lsm_list_modules() syscall is returning:
- safesetid (NOT in /sys/kernel/security/lsm and NOT compiled in kernel)
- apparmor (NOT in /sys/kernel/security/lsm and NOT compiled in kernel)

But it's NOT returning:
- yama (IS in /sys/kernel/security/lsm)
- ima (IS in /sys/kernel/security/lsm)

Expected Behavior:
==================
The lsm_list_modules() syscall should return LSM IDs that exactly match 
the active LSMs listed in /sys/kernel/security/lsm. It should not return 
IDs for LSMs that are not compiled into the kernel or not active.

Reproduction Steps:
===================
1. Install LTP at /opt/ltp
2. Verify active LSMs: cat /sys/kernel/security/lsm
3. Check kernel config to confirm AppArmor and SafeSetID are not compiled
4. Run: /opt/ltp/testcases/bin/lsm_list_modules02

Environment:
============
Kernel Version: 7.0.0-rc7
Architecture: ppc64le
LTP Version: 20260130-105-g07b599e48

This appears to be a bug in the lsm_list_modules() syscall 
implementation where it's not correctly reporting the active LSM modules.

If you happen to fix the above issue, then please add below tag.
Reported-by: Samir M <samir@linux.ibm.com>

Thanks,
Samir


                 reply	other threads:[~2026-04-13 13:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=35f5edcc-bc12-4f4b-84c7-0ff9d007e2c5@linux.ibm.com \
    --to=samir@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maddy@linux.ibm.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

Powered by JetHome