linux-stable/security/apparmor
Helge Deller 063b381661 apparmor: Fix 8-byte alignment for initial dfa blob streams
commit c567de2c4f upstream.

The dfa blob stream for the aa_dfa_unpack() function is expected to be aligned
on a 8 byte boundary.

The static nulldfa_src[] and stacksplitdfa_src[] arrays store the initial
apparmor dfa blob streams, but since they are declared as an array-of-chars
the compiler and linker will only ensure a "char" (1-byte) alignment.

Add an __aligned(8) annotation to the arrays to tell the linker to always
align them on a 8-byte boundary. This avoids runtime warnings at startup on
alignment-sensitive platforms like parisc such as:

 Kernel: unaligned access to 0x7f2a584a in aa_dfa_unpack+0x124/0x788 (iir 0xca0109f)
 Kernel: unaligned access to 0x7f2a584e in aa_dfa_unpack+0x210/0x788 (iir 0xca8109c)
 Kernel: unaligned access to 0x7f2a586a in aa_dfa_unpack+0x278/0x788 (iir 0xcb01090)

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org
Fixes: 98b824ff89 ("apparmor: refcount the pdb")
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-08-28 16:34:16 +02:00
..
include apparmor: use the condition in AA_BUG_FMT even with debug disabled 2025-08-20 18:41:29 +02:00
.gitignore
apparmorfs.c
audit.c
capability.c
crypto.c
domain.c apparmor: fix x_table_lookup when stacking is not the first entry 2025-08-20 18:41:29 +02:00
file.c apparmor: shift ouid when mediating hard links in userns 2025-08-20 18:41:28 +02:00
ipc.c
Kconfig
label.c
lib.c
lsm.c apparmor: Fix 8-byte alignment for initial dfa blob streams 2025-08-28 16:34:16 +02:00
Makefile
match.c
mount.c
net.c
nulldfa.in
path.c
policy_compat.c
policy_ns.c
policy_unpack_test.c apparmor: Fix unaligned memory accesses in KUnit test 2025-08-15 16:39:16 +02:00
policy_unpack.c
policy.c
procattr.c
resource.c
secid.c
stacksplitdfa.in
task.c