Commit Graph

12 Commits

Author SHA1 Message Date
Jann Horn
d0ad8e6fff apparmor: enforce nullbyte at end of tag string
commit 8404d7a674c49278607d19726e0acc0cae299357 upstream.

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@vger.kernel.org
Fixes: 736ec752d95e ("AppArmor: policy routines for loading and unpacking policy")
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-10 21:33:09 +02:00
Erfan Abdi
832ceadb82 apparmor: Fix equality comparison
security/apparmor/domain.c:110:17: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
        } else if ((ns == profile->ns)) {

Change-Id: I8d58d4745f7ec41d08ae98cb5b72bbeaf9ad961b
2023-04-10 21:33:09 +02:00
Nicolas Iooss
9873ed49cd apparmor: use SHASH_DESC_ON_STACK
When building the kernel with clang, the compiler fails to build
security/apparmor/crypto.c with the following error:

    security/apparmor/crypto.c:36:8: error: fields must have a constant
    size: 'variable length array in structure' extension will never be
    supported
                    char ctx[crypto_shash_descsize(apparmor_tfm)];
                         ^

Since commit a0a77af14117 ("crypto: LLVMLinux: Add macro to remove use
of VLAIS in crypto code"), include/crypto/hash.h defines
SHASH_DESC_ON_STACK to work around this issue. Use it in aa_calc_hash()
and aa_calc_profile_hash().

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
2023-04-10 21:33:09 +02:00
45ad7f5633 Disable SRPMB & add systempart argument 2023-04-10 20:38:45 +02:00
f55b5c545a Adapt most config parameters 2023-04-09 00:40:52 +02:00
3b90173830 LXC starts now 2023-04-08 22:46:05 +02:00
04733c3b82 Unrestrict rooting 2023-04-08 13:16:10 +02:00
2f0a7bf2ad Use apparmor 2023-04-08 12:27:49 +02:00
124e7e8098 Enable autofs4 2023-04-08 10:58:07 +02:00
716303ea8d Now trying to normal boot 2023-04-08 06:42:17 +02:00
a00085a63b Disable FIVE 2023-04-08 03:02:07 +02:00
b9959b7054 A750FNXXU4CTG1 2023-04-07 21:05:06 +02:00