]> git.ipfire.org Git - thirdparty/linux.git/commit
apparmor: document the buffer hold, add an overflow guard
authorJohn Johansen <john.johansen@canonical.com>
Wed, 21 Jan 2026 02:18:51 +0000 (18:18 -0800)
committerJohn Johansen <john.johansen@canonical.com>
Thu, 29 Jan 2026 09:27:55 +0000 (01:27 -0800)
commit0b6a6b72b329c34a13a13908d5e8df9fb46eaa1f
treefb6a28ea756a64d33849de444c5e3d57e3c820ee
parent640cf2f09575c9dc344b3f7be2498d31e3923ead
apparmor: document the buffer hold, add an overflow guard

The buffer hold is a measure of contention, but it is tracked per cpu
where the lock is a globabl resource. On some systems (eg. real time)
there is no guarantee that the code will be on the same cpu pre, and
post spinlock acquisition, nor that the buffer will be put back to
the same percpu cache when we are done with it.

Because of this the hold value can move asynchronous to the buffers on
the cache, meaning it is possible to underflow, and potentially in really
pathelogical cases overflow.

Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/lsm.c