What is not mediated

operations no rule covers for security researchers for application developers

Operations a confined program can perform without any rule being consulted. Reading file metadata and changing extended attributes and timestamps. ioctl on an open descriptor. Mounts made through the file-descriptor mount calls. System V IPC and keyrings. Each with the hook that is missing and a run on a real kernel - and what a profile's file rules do promise.

On the map: security

▶ Watch this deck — 9 scenes, ~7 min

Worth seeing first

Part of journeys

01 Some operations never ask

NO RULE TO WRITE profile demo /usr/bin/demo { /etc/demo/public r, } everything else: denied? on /etc/demo/secret: denied and logged open for reading open the directory chmod truncate same file, same run: ok, no log line stat access readlink chdir open(O_PATH) fstat getxattr setxattr utimensat ioctl on an open descriptor three reasons an operation never reaches a rule: 1 AppArmor has no function for the kernel's question 2 the kernel asks nobody 3 the answer is always yes then: what a profile does promise
One profile, one file with no rule, one run. Denied and logged: open for reading, listing the directory, chmod, truncate. Allowed with no log record: stat, access, readlink, chdir, O_PATH, reading and setting extended attributes, setting timestamps, ioctl.

Under a profile with no rule for a file, opening, listing, chmod and truncate are denied and logged, while stat, readlink, chdir, extended attributes, timestamps and ioctl are not checked at all. Observed in one run.

Demo's profile allows reading one file and nothing else. So you'd expect everything else demo tries to end in a denial and a log line. Most of it does: opening the secret, listing the directory, changing its mode. But in the same run, demo stats the secret, reads where a symlink points, changes the secret's extended attributes and its timestamps, and nothing is denied or logged. Those operations never reach a rule. That happens for three reasons, and this deck goes through them. AppArmor has no function for the question. Or the kernel asks nobody. Or the answer is always yes. Then we'll see what a profile really promises.

Details and sources

Details

  • "Not mediated" in this deck always means one of three things: AppArmor registers no function for the hook the kernel calls; the kernel calls no security hook for the operation; or AppArmor's function runs and its check cannot fail.
  • Ordinary permission checks (owner, mode bits, ACLs), capabilities, seccomp filters and other security modules apply in every case. The examples run as root on root-owned files so that none of those gets in the way.
  • Denied and logged in the run (file /etc/demo/secret, no rule): open O_RDONLY, opening the directory /etc/demo/private, chmod, truncate. For example apparmor="DENIED" operation="chmod" class="file" profile="demo-t" name="/etc/demo/secret" comm="t" requested_mask="w" denied_mask="w".
  • Allowed with no audit record in the same run: stat, access(R_OK), readlink, chdir, open(O_PATH) and fstat, getxattr, listxattr, setxattr, utimensat, and ioctl(FS_IOC_SETFLAGS) on a descriptor opened read-only.
  • None of this depends on the profile's mode. An operation that is not mediated produces no record in enforce or in complain mode.
  • Observed on 2026-11-16 in a disposable Debian forky/sid guest (kernel 7.3.4+deb14-cloud-amd64, apparmor_parser 5.0.2), as root. The run used the profiles demo-t and demo-mnt and the test program t from findings/security/observed/; the slide writes demo. The kernel code cited is mainline at the commit the map describes; the guest kernel is one release older and behaved as that code reads.

02 One table lists every question AppArmor answers for security researchers for AppArmor developers

THE HOOK TABLE the kernel can ask: about 280 hooks include/linux/lsm_hook_defs.h apparmor_hooks[] answers: 81 security/apparmor/lsm.c answered, for files path_link path_unlink path_symlink path_mkdir path_rmdir path_mknod path_rename path_chmod path_chown path_truncate inode_getattr file_open file_permission file_receive mmap_file file_mprotect file_lock they come with a full path not registered inode_permission inode_readlink inode_setattr inode_setxattr inode_getxattr inode_set_acl file_ioctl file_fcntl path_chroot sb_remount fs_context_* ipc_permission shm_* msg_queue_* key_* most see only the file, not a path method: for each missing hook, find where the kernel calls it
The kernel defines about 280 security hooks. AppArmor registers 81 of them in one array. For files it answers the path hooks, open and the checks on an open file, and one inode hook, getattr. The other inode hooks, ioctl, fcntl, remount, IPC and key hooks are not registered.

apparmor_hooks[] registers 81 of the kernel's security hooks. File mediation uses the path_* and file_* hooks plus inode_getattr; the other inode_* hooks, file_ioctl, sb_remount and the IPC and key hooks are not registered. Read from the kernel source.

How do you find such a list? Read a table. The kernel defines about 280 questions it can put to a security module: hooks. One array in AppArmor's source says which it answers: 81. For files it answers the path hooks: create, delete, link, rename, change mode and owner, truncate. Then open, and the checks on an open file. Those come with a full path, so a name can be built. The inode hooks, which see only the file, are left out, all but one. That explains most of this deck. For each missing hook, find where the kernel calls it. That's an operation with no rule.

Details and sources

Details

  • The hook list is apparmor_hooks[] with 81 LSM_HOOK_INIT entries: lsm.c:1785-1891. Every hook the kernel has is declared in lsm_hook_defs.h (about 280).
  • Registered, by group: ptrace (2), capable and capget, mounts (sb_mount, sb_umount, sb_pivotroot, move_mount), ten path_* hooks, inode_getattr, the file hooks, the process attribute interfaces, about twenty socket hooks, credential and exec hooks, task_setrlimit, task_kill, userns_create, two io_uring hooks, and audit and label conversion helpers.
  • Not registered and relevant to a profile: inode_permission, inode_readlink, inode_follow_link, inode_setattr, the xattr and ACL hooks, file_ioctl, file_ioctl_compat, file_fcntl, path_chroot, path_notify, sb_remount, sb_kern_mount, the fs_context_* hooks, all System V IPC hooks, key_*, bpf*, perf_event_*, netlink_send, task_setnice, task_setscheduler, task_prlimit, uring_cmd.
  • A missing hook is not always a gap: many guard operations that also need a capability (settime, syslog, module loading, raising priority), and the capability rule is the mediation.
  • Why path hooks: AppArmor's file rules need a name, and a name can only be built from a mount and a directory entry together. Hooks that receive only an inode cannot provide one.
  • This scene is read from the kernel source; the runs are in the following scenes.

03 Everything about a file except its contents

METADATA YOU CAN READ demo /etc/demo/secret no rule in the profile stat("/etc/demo/secret") size=12 uid=0 mode=600 the getattr hook is answered, and the answer is always yes also under a deny rule access(R_OK) ok readlink("link") -> secret chdir("private") ok no AppArmor function at all open("inside") Permission denied name="/etc/demo/private/inside" contents are still checked, by full name a profile cannot hide that a file exists, or its size, owner, mode and link target
On the secret file, with no rule: stat returns size, owner and mode; access succeeds; readlink shows the target of a link; chdir into a directory with no rule works. Opening a file inside is denied under its full name. stat also works on a file with a deny rule.

stat is always allowed: the get-attribute permission is set for every state of the file table. access, readlink and chdir have no AppArmor check. Opening the file is checked. Observed, also on a file with an explicit deny rule.

First, what demo can learn. Stat goes through the one inode hook AppArmor does answer. But the permission it asks for, get attributes, is switched on in every row of the permission table, even the row for no match. So the answer is always yes, even under a deny rule. The access call, readlink and change directory have no AppArmor function at all. Here's the run: the secret's size, owner and mode, the link's target, a change into a directory with no rule. Opening a file inside is still denied, under its full name. So a profile can't hide that a file exists, or how it looks from outside.

Details and sources

Details

  • stat, lstat, statx, fstat: the kernel calls the get-attribute hook, AppArmor matches the name and asks for the get-attribute permission. That bit is set in every entry of a profile's file permission table, including the entry for "no rule matched", so the request cannot fail.
  • access and faccessat use the inode permission hook, which AppArmor does not register. The result is the owner-and-mode answer: in the run access R_OK: ok on the secret, although opening it for reading is denied.
  • readlink uses the inode readlink hook (not registered). Run: readlink: ok (6), -> secret.
  • chdir and fchdir have no path hook. Run: chdir: ok, cwd=/etc/demo/private; then open relative "inside": FAILED errno=13 with name="/etc/demo/private/inside" in the log.
  • Walking through a directory on the way to a file is not checked either, so a profile needs no rules for parent directories. Listing a directory is an open and is checked: name="/etc/demo/private/" requested_mask="r".
  • With deny /etc/demo/denied rwkl, in the profile: open denied, stat: ok, size=12 uid=0 mode=644.
  • Observed on 2026-11-16 in a disposable Debian forky/sid guest (kernel 7.3.4+deb14-cloud-amd64, apparmor_parser 5.0.2), as root. The run used the profiles demo-t and demo-mnt and the test program t from findings/security/observed/; the slide writes demo. The kernel code cited is mainline at the commit the map describes; the guest kernel is one release older and behaved as that code reads.

for AppArmor developers for security researchers

Code

04 Attributes a rule cannot protect

METADATA YOU CAN CHANGE through path hooks: checked chmod Permission denied truncate Permission denied (chown: the same hook family) operation="chmod" ... requested_mask="w" through inode hooks: not registered setxattr(secret, "user.note", "changed") ok utimensat(secret, 1970-01-01) ok no log line also with deny ... rwkl, $ getfattr -n user.note /etc/demo/secret user.note="changed" $ stat -c %y /etc/demo/secret 1970-01-01 00:00:01.000000000 +0000 still required: own the file, or hold a capability (fowner, sys_admin for trusted.*) no w rule does not mean nothing about the file can change what trusts xattrs, ACLs or timestamps trusts the file's owner
chmod and truncate on the secret file are denied. setxattr and utimensat on the same file succeed and are not logged, also on a file with a deny rule for write. Ownership and capabilities still apply.

chmod, chown and truncate need w and are checked. Extended attributes, ACLs and timestamps are not: setxattr and utimensat succeed on a file with no rule and on a file with a deny rule. Observed. Ownership and capabilities still apply.

Now what demo can change. Mode, owner and length are covered: they go through path hooks, and you see them denied. Extended attributes and timestamps go through inode hooks that AppArmor doesn't answer. In the run, demo sets an extended attribute on the secret, and on a file with a deny rule for write, and moves the secret's modification time to 1970. Both succeed, with nothing logged. Unix rules still apply: you must own the file, or hold a capability. But demo often does own its files. So no write rule doesn't mean nothing about the file can change. Anything that trusts those attributes is trusting the file's owner.

Details and sources

Details

  • Checked, with w: chmod (operation="chmod"), chown, truncate (operation="truncate"). Run on the secret: both FAILED errno=13, logged with requested_mask="w" denied_mask="w".
  • Not checked: setxattr, getxattr, listxattr, removexattr, POSIX ACLs (set through the same family of hooks), and timestamp changes with utimensat or futimens.
  • Run on the secret (no rule): getxattr user.note: ok (8), value=original; setxattr user.note=changed: ok (0); utimensat (set atime and mtime to 1970): ok (0). Afterwards, unconfined: user.note="changed" and 1970-01-01 00:00:01.000000000 +0000.
  • The same on /etc/demo/denied under deny /etc/demo/denied rwkl,: setxattr ok, utimensat ok, no audit record.
  • What still applies: timestamps and ACLs need the file's owner or CAP_FOWNER; user.* attributes need write permission by the file's mode; trusted.* needs CAP_SYS_ADMIN; security.* attributes have their own checks. A confined task has a capability only when its profile has the capability rule.
  • Why it matters: build systems and backup tools trust timestamps; some access decisions read ACLs and attributes; AppArmor's own xattrs= attachment condition reads attributes that the owner of an executable can set.
  • Observed on 2026-11-16 in a disposable Debian forky/sid guest (kernel 7.3.4+deb14-cloud-amd64, apparmor_parser 5.0.2), as root. The run used the profiles demo-t and demo-mnt and the test program t from findings/security/observed/; the slide writes demo. The kernel code cited is mainline at the commit the map describes; the guest kernel is one release older and behaved as that code reads.

for AppArmor developers for security researchers

Code

05 ioctl: once the file is open

ONCE A FILE IS OPEN file rules gate getting a descriptor: open exec inherit receive using it: read write mmap lock truncate they say nothing about ioctl fcntl open(O_PATH) the hooks exist; AppArmor registers none demo fd = open("/etc/demo/public", O_RDONLY) ioctl(fd, FS_IOC_SETFLAGS, flags | NOATIME) ok $ lsattr /etc/demo/public -------A------e------- /etc/demo/public the flag is set a device node if a profile lets a program open it, every command the device accepts comes with it
File rules decide whether demo gets a descriptor and whether it may read, write, map or lock through it. ioctl is not checked: demo opens the public file read-only and changes one of its inode flags with an ioctl. On a device node, ioctl is the whole interface.

File rules decide who gets a descriptor and whether it may be read, written, mapped or locked. ioctl and fcntl are not checked. Observed: FS_IOC_SETFLAGS succeeds on a file opened with only r allowed.

Third, what demo can do with a descriptor it holds. File rules gate getting one: open, exec, inherit, receive. They gate reading, writing, mapping and locking. They say nothing about ioctl calls. There's a hook for those, and AppArmor doesn't answer it. In the run, demo opens the public file with read permission only, then uses an ioctl to change one of the file's flags. It works. On a regular file that's a curiosity. On a device node it's the whole interface. If a profile lets a program open a device, every command that device accepts comes with it. fcntl settings and O_PATH opens are in the same group.

Details and sources

Details

  • Checked on an open file: read and write (file_permission), mmap and mprotect (the m permission for executable mappings), flock and POSIX locks (k), ftruncate, and receiving a descriptor from another process.
  • Not checked: ioctl (the file_ioctl hook is not registered), fcntl (file_fcntl: F_SETFL, F_SETOWN, leases, seals), and O_PATH opens (see The limits of name-based mediation).
  • Run: open O_RDONLY: ok (3) on /etc/demo/public (rule: r), ioctl FS_IOC_GETFLAGS: ok (0), flags=0x80000, ioctl FS_IOC_SETFLAGS (add noatime) on the read-only fd: ok (0), flags=0x80080; afterwards lsattr prints -------A------e-------. No audit record. Setting that flag needs ownership of the file, which the task had.
  • For a regular file the ioctls are few (flags, extents, cloning ranges from another descriptor the task also holds). For a device the ioctl interface is the device: terminals, block devices, /dev/kvm, graphics and input devices. A rule such as /dev/dri/card0 rw, hands over all of it.
  • What can narrow it: a seccomp filter on ioctl numbers, Landlock's ioctl-on-device right, the device's own permission checks, capabilities for privileged commands.
  • Observed on 2026-11-16 in a disposable Debian forky/sid guest (kernel 7.3.4+deb14-cloud-amd64, apparmor_parser 5.0.2), as root. The run used the profiles demo-t and demo-mnt and the test program t from findings/security/observed/; the slide writes demo. The kernel code cited is mainline at the commit the map describes; the guest kernel is one release older and behaved as that code reads.

for AppArmor developers for security researchers

Code

06 Mounts through the new API

MOUNTS THROUGH THE NEW API capability sys_admin, mount, deny remount, deny mount fstype=tmpfs, mount rules were written for mount(2) make /mnt/x read-only mount(MS_REMOUNT|MS_BIND|MS_RDONLY) Permission denied mount_setattr(MOUNT_ATTR_RDONLY) ok fspick + fsconfig(CMD_RECONFIGURE, ro) ok mount a tmpfs on /mnt/y mount("none", "/mnt/y", "tmpfs") Permission denied fsopen("tmpfs") + fsconfig(CMD_CREATE) + fsmount + move_mount ok nothing is logged for the calls on the right all of them need capability sys_admin: a profile without it is not affected known discrepancy: exceptions carved out with mount rules do not hold for these calls
A profile with capability sys_admin and mount, that denies remount and denies fstype tmpfs. The classic mount call is refused for both. mount_setattr, an fsconfig reconfigure, and fsopen plus fsmount plus move_mount succeed, with no log record.

AppArmor checks mount(2), umount, pivot_root and move_mount. mount_setattr, an fsconfig reconfigure and a mount built with fsopen and fsmount passed a profile that denies the same thing through mount(2). Observed; all need CAP_SYS_ADMIN.

Mount rules were written for the mount system call. Newer kernels have a second set of calls that work on file descriptors, and current mount tools use them. In this run the profile allows mounting, but denies remounts and the tmpfs type. The classic remount to read-only is refused. mount_setattr does the same job, and succeeds. A reconfigure through fsconfig succeeds. The classic tmpfs mount is refused. Built with fsopen and fsmount, it appears. Nothing is logged. All of these need the sys_admin capability, so a profile without it isn't affected. But a profile that grants it, and then carves out exceptions with mount rules, isn't holding those exceptions.

Details and sources

Details

  • Registered mount hooks: sb_mount (the mount system call: new mounts, remounts, binds, moves, propagation changes), sb_umount, sb_pivotroot, move_mount.
  • mount_setattr(2) changes per-mount attributes (read-only, nosuid, nodev, noexec, propagation) and calls no security hook.
  • fspick plus fsconfig(FSCONFIG_CMD_RECONFIGURE) changes superblock options and reaches only the sb_remount hook, which AppArmor does not register.
  • fsopen, fsconfig(FSCONFIG_CMD_CREATE) and fsmount create a mount that is attached with move_mount. AppArmor checks that last step as a move with no source, so a rule about a file system type or about flags is not consulted.
  • open_tree(OPEN_TREE_CLONE) plus move_mount makes a bind mount the same way.
  • The run, profile capability sys_admin, mount, umount, deny remount, deny mount fstype=tmpfs,: mount(MS_REMOUNT|MS_BIND|MS_RDONLY): FAILED errno=13; mount_setattr(MOUNT_ATTR_RDONLY): ok, and /proc/self/mountinfo shows /mnt/x ro,relatime; fspick: ok, fsconfig(FSCONFIG_SET_FLAG, ro): ok, fsconfig(FSCONFIG_CMD_RECONFIGURE): ok, and mountinfo shows the superblock ro; mount("none", DIR, "tmpfs"): FAILED errno=13; fsopen(tmpfs): ok, fsconfig(FSCONFIG_CMD_CREATE): ok, fsmount: ok, move_mount onto DIR: ok, and mountinfo shows a tmpfs on /mnt/y. No audit record for the successful calls.
  • Second profile, mount, with deny mount options in (rbind,bind) /mnt/src/ -> **,: mount(SRC, DST, MS_BIND): FAILED errno=13; open_tree(SRC, OPEN_TREE_CLONE): ok, move_mount onto DST: ok.
  • Known discrepancy: these are two entries of the project's bug list, "Kernel: mount_setattr(2), fsconfig reconfigure and fsopen/fsmount are not checked as remounts or new mounts" and "Kernel: a bind mount made with open_tree and move_mount is checked as a move without a source, so deny mount options in (bind) does not stop mount --bind". Whether they are defects or limits of the hook set is for the maintainers; the behaviour is observed.
  • What holds: every one of these calls needs CAP_SYS_ADMIN over the mount namespace. A profile with no capability sys_admin, rule is not affected. A profile with no mount rule at all still refuses move_mount, so nothing new can be attached, but mount_setattr and a reconfigure go through.
  • Observed on 2026-11-16 in a disposable Debian forky/sid guest (kernel 7.3.4+deb14-cloud-amd64, apparmor_parser 5.0.2), as root. The run used the profiles demo-t and demo-mnt and the test program t from findings/security/observed/; the slide writes demo. The kernel code cited is mainline at the commit the map describes; the guest kernel is one release older and behaved as that code reads.

for AppArmor developers for security researchers

Code

07 Objects with no rule class

OBJECTS WITH NO RULE CLASS no hook registered: works with no rule shmget + shmat ok msgget ok add_key("user", ...) ok limited by the object's own owner and mode, and by the IPC namespace POSIX message queue: refused, but not by an mqueue rule mq_open("/demo-queue") Permission denied operation="open" class="file" name="demo-queue" info="Failed name lookup - disconnected path" a file on an internal mount for contrast: sockets have rules socket(AF_INET, SOCK_STREAM) Permission denied class="net" info="failed af match" mediated: capabilities · network · unix sockets · signals · ptrace · mounts · exec not in this kernel: System V IPC · keys · mqueue rules
Under the same profile: System V shared memory and message queues and a kernel key are created with no rule. A POSIX message queue is refused as a file with a disconnected path. An inet socket is refused by the network rules.

System V IPC and kernel keys have no AppArmor hook: they work under any profile, subject to their own owner and mode. A POSIX message queue is refused as a disconnected file, not by an mqueue rule. Sockets, signals, ptrace and capabilities are mediated. Observed.

For some kinds of object, AppArmor answers no hook at all. System V shared memory and message queues: demo creates them with no rule. Kernel keyrings: the same. What limits them is the object's own owner and mode, and the IPC namespace. POSIX message queues are a surprise in the other direction. The mqueue rule class isn't enforced here. But a queue is a file on an internal mount, so opening one is refused as a disconnected path. And in the same run a plain network socket is denied, because sockets do have rules. So check each class. Capabilities, network, signals, ptrace and mounts are mediated. These are not.

Details and sources

Details

  • System V IPC (shmget, shmat, msgget, semget and the calls on them): the kernel's hooks ipc_permission, shm_*, msg_queue_* and sem_* have no AppArmor function. A shared memory segment is also a file, but on a kernel-internal mount that AppArmor skips. Run: shmget: ok, shmat: ok, msgget: ok.
  • Kernel keyrings: key_permission is not registered. Run: add_key(user, demo): ok.
  • POSIX message queues: the profile language has an mqueue rule class, and this kernel has no hook for it (see mqueue rules and Upstream and Ubuntu). The queue is a file on the internal mqueue mount, so mq_open reaches the file-open check with a path that does not connect to the root. Run: mq_open /demo-queue: FAILED errno=13 and apparmor="DENIED" operation="open" class="file" info="Failed name lookup - disconnected path" error=-13 profile="demo-t" name="demo-queue" comm="t" requested_mask="wrc" denied_mask="wrc".
  • With flags=(attach_disconnected) and the file rule /demo-queue rw, the same mq_open succeeds (second run): the queue is then governed by a file rule for a path at the root.
  • Control in the same run: socket(AF_INET, SOCK_STREAM): FAILED errno=13, apparmor="DENIED" operation="create" class="net" info="failed af match" ... family="inet" sock_type="stream".
  • Also without a hook, not run: BPF and perf events (limited by CAP_BPF, CAP_PERFMON, CAP_SYS_ADMIN and two sysctls), changing another process's priority or scheduler (same user or CAP_SYS_NICE), netlink messages after the socket exists.
  • Observed on 2026-11-16 in a disposable Debian forky/sid guest (kernel 7.3.4+deb14-cloud-amd64, apparmor_parser 5.0.2), as root. The run used the profiles demo-t and demo-mnt and the test program t from findings/security/observed/; the slide writes demo. The kernel code cited is mainline at the commit the map describes; the guest kernel is one release older and behaved as that code reads.
  • Known discrepancy: a POSIX message queue on a kernel without mqueue mediation is refused as a file with a disconnected path. The same record was made on Debian 13 and Debian sid for a profile with an mqueue rule and for one without; see Kernel features and the policy ABI.

for AppArmor developers for security researchers

Code

08 What a profile promises, then

WHAT A PROFILE PROMISES file rules promise no open for read, write, append or exec no create, delete, link or rename of a name no chmod, chown or truncate ... unless a rule allows that name they do not promise hidden metadata protected xattrs, ACLs, timestamps limited ioctl on what it may open System V IPC, keys what stands behind the gaps owner and mode bits always apply capability rules most dangerous calls need one seccomp · Landlock stack on top none of these operations is logged, in any mode a system-call trace shows calls that the log and the profiling tools never see
With file rules a profile promises that the program cannot open, create, delete, link, rename, chmod, chown or truncate a name without a rule. It does not promise hidden metadata, protected attributes, limited ioctl. Ownership, capabilities and other mechanisms stand behind the gaps.

File rules cover opening, creating, deleting, linking, renaming, and changing mode, owner and length. They do not cover metadata, extended attributes, timestamps or ioctl. Ownership, capability rules and other kernel mechanisms cover those. Unmediated operations are never logged.

So what does a profile promise? With file rules, demo can't open a file to read, write or run it, can't create, delete, link or rename a name, and can't change mode, owner or length, unless a rule allows that name. It doesn't promise demo can't see a file's metadata, change attributes of files it owns, or drive a device it may open. Three things stand behind the gaps. Ownership and mode bits always apply. Most dangerous operations need a capability, and capability rules are enforced. Other mechanisms stack on top, like seccomp and Landlock. One note: none of this is logged, so a trace shows calls the log doesn't.

Details and sources

Details

  • Promised by file rules: no open for reading, writing, appending or execution; no executable mapping; no lock; no create, delete, hard link or rename of a name; no change of mode, owner or length; all unless a rule allows the name. And no use of a descriptor inherited from a differently confined parent unless the new profile allows the file.
  • Not promised: that metadata and link targets stay hidden; that extended attributes, ACLs and timestamps of files the task owns stay unchanged; that ioctls on descriptors it holds are limited; that descriptors handed over by unconfined tasks are covered; that System V IPC objects and keys are covered; that mount-rule exceptions hold for the file-descriptor mount calls.
  • Capabilities are mediated (capable is in the hook table), and a confined task has a capability only when its profile says so. Changing another user's file, mounting, chroot, raw sockets, loading modules, setting the clock, tracing another user's processes: all need one.
  • Other layers: ownership and mode bits follow the file, not the name; seccomp can filter system calls and ioctl numbers; Landlock adds object-based file rules; mount, IPC and user namespaces limit what is reachable.
  • For profiling: an unmediated operation produces no record in enforce or complain mode. aa-logprof cannot propose a rule for it and none is needed. The shipped who profile documents such a pair of calls in a comment.
  • Distribution kernels can differ. See Upstream and Ubuntu.

for AppArmor developers for security researchers

Code

09 Where to go from here

ROADS operations no rule covers metadata · xattrs · ioctl · new mount calls · IPC sec-path-limits when the name moves syn-access-modes what the letters cover syn-capability behind most gaps syn-mount the call mount rules mean prac-privileged log plus trace also: upstream-and-ubuntu (distribution kernels) · syn-mqueue · k-overview adm-denials · sec-bugs · sec-threat-model
What is not mediated in the centre, with roads to sec-path-limits, syn-access-modes, syn-capability, syn-mount and prac-privileged, and a row naming upstream-and-ubuntu, syn-mqueue, k-overview, adm-denials, sec-bugs and sec-threat-model.

Next: sec-path-limits, syn-access-modes, syn-capability, syn-mount, prac-privileged, upstream-and-ubuntu, k-overview.

That's the list for this kernel: file metadata, extended attributes and timestamps, ioctl, the newer mount calls, System V IPC and keys. Each one is a missing hook, a call that asks nobody, or a check that always passes. From here, the name limits deck covers the other half: what happens when the name itself moves. The access modes deck shows what the permission letters do cover, and the capability deck covers the rule class that stands behind most of these gaps. If you're profiling a privileged program, the deck on security-sensitive programs explains why the log alone isn't enough.

Details and sources

Details

  • Not mediated in this kernel: reading file metadata, access, readlink, chdir; extended attributes, ACLs and timestamps; ioctl and fcntl; O_PATH opens; mount_setattr, fsconfig reconfigure and mounts built with fsopen and fsmount; System V IPC and kernel keys.
  • Each is one of: no AppArmor function for the hook, no hook in the kernel, or a check that always passes.

What each deck answers:

Read more

Basis of the statements on this page: "observed" means run on 2026-11-16 in a disposable Debian forky/sid guest (kernel 7.3.4+deb14-cloud-amd64, apparmor_parser 5.0.2), as root, with the profiles and the test program kept in findings/security/observed/. "Code" means read from the kernel source at the commit the map describes and not run. The guest kernel is a distribution kernel one release older than that source; every observation agrees with the code cited in the scenes. Distribution kernels with extra AppArmor patches can differ: see Upstream and Ubuntu.

Operations and what checks them

OperationAppArmorWhyBasisWhat still applies
open for read, write, appendcheckedfile_openobserved
listing a directorychecked (an open)file_openobserved
chmod, chown, truncatechecked, need wpath_chmod, path_chown, path_truncateobserved
create, delete, mkdir, rmdir, mknod, symlinkcheckedpath_* hookscode
hard link, renamecheckedpath_link, path_renameobserved (rename)
mmap with PROT_EXEC, mprotectchecked, need mmmap_file, file_mprotectcode
flock, POSIX lockschecked, need kfile_lockcode
stat, fstat, statxalways allowedget-attribute bit set in every table entryobservedsearch permission on the directories
access, faccessatnot checkedinode_permission not registeredobservedowner and mode
readlinknot checkedinode_readlink not registeredobserved
chdir, fchdirnot checkedno path hookobservedsearch permission
walking through directoriesnot checkedinode_permission not registeredcodesearch permission
open(O_PATH)not checkedthe kernel returns before the hookobserved
getxattr, listxattrnot checkedxattr hooks not registeredobservedmode; attribute namespace rules
setxattr, removexattr, ACLsnot checkedxattr and ACL hooks not registeredobserved (setxattr)owner, mode, CAP_FOWNER, CAP_SYS_ADMIN for trusted.*
utimensat, futimensnot checkedinode_setattr not registeredobservedowner or CAP_FOWNER
ioctlnot checkedfile_ioctl not registeredobservedthe driver's own checks; capabilities
fcntlnot checkedfile_fcntl not registeredcode
mount(2), umount, pivot_root, move_mountcheckedsb_mount, sb_umount, sb_pivotroot, move_mountobserved (mount)CAP_SYS_ADMIN
mount_setattrnot checkedno hook in the kernelobservedCAP_SYS_ADMIN
fsconfig reconfigurenot checkedsb_remount not registeredobservedCAP_SYS_ADMIN
fsopen + fsmountchecked only as a move at move_mountsb_kern_mount, fs_context_* not registeredobservedCAP_SYS_ADMIN
open_tree(OPEN_TREE_CLONE)checked only as a move at move_mountno hookobservedCAP_SYS_ADMIN
System V shm, msg, semnot checkedIPC hooks not registeredobserved (shm, msg)object owner and mode; IPC namespace
kernel keysnot checkedkey_permission not registeredobservedkey permissions
POSIX message queuerefused as a disconnected fileno mqueue hook; the queue is a file on an internal mountobserved
sockets, signals, ptrace, capabilities, rlimits, exec, user namespace creationcheckedtheir own hooks and rule classesobserved (inet socket), code
  • Known discrepancy: a POSIX message queue on a kernel without mqueue mediation is refused as a file with a disconnected path. The row above is that case; the same record on Debian 13 and Debian sid, with and without an mqueue rule, is in Kernel features and the policy ABI.

What a file rule covers, by letter

LetterCoversDoes not cover
ropen for reading, reading a directorystat, readlink, getxattr (never checked)
wopen for writing, create, delete, rename, chmod, chown, truncatesetxattr, ACLs, timestamps, ioctl
aopen for appending
lcreating a hard link at this name
kfile locks
mexecutable mappings
x with a modeexecution

Reading a trace next to a log

An operation in the "not checked" rows never appears in the audit log, in enforce or in complain mode. When strace shows such a call and aa-logprof proposes nothing for it, the profile is complete as far as AppArmor is concerned.

for AppArmor developers for security researchers

Code map

WhatWhere
the hook tableapparmor_hooks[], linux:security/apparmor/lsm.c:1785-1891
every hook the kernel defineslinux:include/linux/lsm_hook_defs.h
get-attribute always allowedcompute_fperms_allow, linux:security/apparmor/policy_compat.c:100-103
file systems skippedpath_mediated_fs, linux:security/apparmor/include/lib.h:146-149
O_PATHlinux:fs/open.c:951-956
xattr hookslinux:fs/xattr.c:309, 461, 511, 571
setattr hooklinux:fs/attr.c:540
ioctl and fcntl hookslinux:fs/ioctl.c:592, linux:fs/fcntl.c:603
mount_setattrlinux:fs/namespace.c:5102
remount hooklinux:fs/super.c:1049
move_mount as checked by AppArmorlinux:security/apparmor/mount.c:424-456

Roads from here

START HERE

FILE ACCESS

RULE CLASSES

IN PRACTICE · security-sensitive programs

SECURITY · threat model and limits

RUNNING THE PARSER

IN THE KERNEL