Linux/linux 8404d7asecurity/apparmor policy_unpack.c

apparmor: enforce nullbyte at end of tag string

A packed AppArmor policy contains null-terminated tag strings that are read
by unpack_nameX(). However, unpack_nameX() uses string functions on them
without ensuring that they are actually null-terminated, potentially
leading to out-of-bounds accesses.

Make sure that the tag string is null-terminated before passing it to
strcmp().

Cc: stable at vger.kernel.org
Fixes: 736ec752d95e ("AppArmor: policy routines for loading and unpacking policy")
Signed-off-by: Jann Horn <jannh at google.com>
Signed-off-by: John Johansen <john.johansen at canonical.com>
DeltaFile
+1-1security/apparmor/policy_unpack.c
+1-11 files

UnifiedSplitRaw