apparmor: lift kernel socket check out of critical section
authorJohn Johansen <john.johansen@canonical.com>
Wed, 10 Apr 2024 21:49:43 +0000 (14:49 -0700)
committerJohn Johansen <john.johansen@canonical.com>
Sat, 18 Jan 2025 14:47:12 +0000 (06:47 -0800)
commit6cc6a0523dde5b1f001d559d0e034494bc8b0db0
tree2ecf0ed90930501ca77937b684062a707705be49
parent9045aa25d17cf1d13a1c31fc45ed1f9ca725e30e
apparmor: lift kernel socket check out of critical section

There is no need for the kern check to be in the critical section,
it only complicates the code and slows down the case where the
socket is being created by the kernel.

Lifting it out will also allow socket_create to share common template
code, with other socket_permission checks.

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