Linux Security Modules development
 help / color / mirror / Atom feed
* [PATCH 0/4] apparmor: provide the kernel feature set at build time
@ 2026-11-17 13:50 Maxime Bélair
  2026-11-17 13:50 ` [PATCH 1/4] apparmor: move the feature tables to a header Maxime Bélair
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Maxime Bélair @ 2026-11-17 13:50 UTC (permalink / raw)
  To: John Johansen, Georgia Garcia
  Cc: apparmor, linux-security-module, Maxime Bélair

AppArmor policy is compiled in user space for the feature set of the
kernel, and the cache of compiled policy is keyed on that set. The set
can only be read from /sys/kernel/security/apparmor/features once the
kernel runs, so the first boot into a kernel with a new feature set
compiles all of the policy.

Every entry of the feature set is a build-time constant. This series
writes the set to a file when the kernel is built and installs it as

  /lib/modules/<release>/apparmor/features

so that user space can compile the policy when the kernel is installed,
and the first boot takes it from the cache.

Patches 1 and 2 prepare the feature tables to be built into a host
program, patch 3 writes the file with that program, and patch 4
installs it with the modules.

The file is identical to the output of "aa-features-abi -x" on the
booted kernel.

Maxime Bélair (4):
  apparmor: move the feature tables to a header
  apparmor: make the feature tables build without kernel headers
  apparmor: write the feature set to a file at build time
  kbuild: install the AppArmor feature set with the modules

 Documentation/admin-guide/LSM/apparmor.rst |  15 ++
 scripts/Makefile.modinst                   |   6 +
 security/apparmor/.gitignore               |   3 +
 security/apparmor/Makefile                 |  25 ++-
 security/apparmor/apparmorfs.c             | 127 +--------------
 security/apparmor/capability.c             |   6 -
 security/apparmor/gen_features.c           | 100 ++++++++++++
 security/apparmor/include/capability.h     |   2 -
 security/apparmor/include/features.h       | 173 +++++++++++++++++++++
 security/apparmor/include/net.h            |   3 -
 security/apparmor/include/resource.h       |   2 -
 security/apparmor/include/task.h           |   4 -
 security/apparmor/net.c                    |  15 --
 security/apparmor/resource.c               |   5 -
 14 files changed, 328 insertions(+), 158 deletions(-)
 create mode 100644 security/apparmor/gen_features.c
 create mode 100644 security/apparmor/include/features.h

-- 
2.51.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-17 14:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 13:50 [PATCH 0/4] apparmor: provide the kernel feature set at build time Maxime Bélair
2026-11-17 13:50 ` [PATCH 1/4] apparmor: move the feature tables to a header Maxime Bélair
2026-11-17 13:55   ` sashiko-bot
2026-11-17 13:50 ` [PATCH 2/4] apparmor: make the feature tables build without kernel headers Maxime Bélair
2026-11-17 13:55   ` sashiko-bot
2026-11-17 13:50 ` [PATCH 3/4] apparmor: write the feature set to a file at build time Maxime Bélair
2026-11-17 14:00   ` sashiko-bot
2026-11-17 13:50 ` [PATCH 4/4] kbuild: install the AppArmor feature set with the modules Maxime Bélair
2026-11-17 13:58   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox