linux-next/security/apparmor
John Johansen a2f31df06b apparmor: Fix decompression of rawdata for read back to userspace
The rawdata readback has a few of problems. First if compression is
enabled when the data is read then the compressed data is read out
instead decompressing the data. Second if compression of the data
fails, the code does not handle holding onto the raw_data in
uncompressed form. Third if the compression is enabled/disabled after
the rawdata was loaded, the check against the global control of
whether to use compression does not reflect what was already done to
the data.

Fix these by always storing the compressed size, along with the
original data size even if compression fails or is not used. And use
this to detect whether the rawdata is actually compressed.

Fixes: 52ccc20c652b ("apparmor: use zstd compression for profile data")
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Jon Tourville <jon.tourville@canonical.com>
2022-10-03 14:49:04 -07:00
..
include apparmor: Fix undefined references to zstd_ symbols 2022-10-03 14:49:04 -07:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
apparmorfs.c apparmor: Fix decompression of rawdata for read back to userspace 2022-10-03 14:49:04 -07:00
audit.c apparmor: fix aa_class_names[] to match reserved classes 2022-10-03 14:49:04 -07:00
capability.c apparmor: rework profile->rules to be a list 2022-10-03 14:49:04 -07:00
crypto.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
domain.c apparmor: rework profile->rules to be a list 2022-10-03 14:49:04 -07:00
file.c apparmor: make __aa_path_perm() static 2022-10-03 14:49:04 -07:00
ipc.c apparmor: rework profile->rules to be a list 2022-10-03 14:49:04 -07:00
Kconfig apparmor: use zstd compression for profile data 2022-10-03 14:49:02 -07:00
label.c apparmor: Fix regression in stacking due to label flags 2022-10-03 14:49:04 -07:00
lib.c apparmor: rework profile->rules to be a list 2022-10-03 14:49:04 -07:00
lsm.c apparmor: Fix undefined references to zstd_ symbols 2022-10-03 14:49:04 -07:00
Makefile apparmor: isolate policy backwards compatibility to its own file 2022-10-03 14:49:03 -07:00
match.c apparmor: preparse for state being more than just an integer 2022-10-03 14:49:03 -07:00
mount.c apparmor: rework profile->rules to be a list 2022-10-03 14:49:04 -07:00
net.c apparmor: rework profile->rules to be a list 2022-10-03 14:49:04 -07:00
nulldfa.in apparmor: cleanup add proper line wrapping to nulldfa.in 2018-02-09 11:30:01 -08:00
path.c security: apparmor: delete repeated words in comments 2021-02-07 04:15:46 -08:00
policy_compat.c apparmor: Fix doc comment for compute_fperms 2022-10-03 14:49:04 -07:00
policy_ns.c apparmor: rework profile->rules to be a list 2022-10-03 14:49:04 -07:00
policy_unpack_test.c apparmor: make unpack_array return a trianary value 2022-10-03 14:49:03 -07:00
policy_unpack.c apparmor: Fix decompression of rawdata for read back to userspace 2022-10-03 14:49:04 -07:00
policy.c apparmor: rework profile->rules to be a list 2022-10-03 14:49:04 -07:00
procattr.c apparmor: Fix kernel-doc 2022-07-09 15:13:59 -07:00
resource.c apparmor: rework profile->rules to be a list 2022-10-03 14:49:04 -07:00
secid.c apparmor: disable showing the mode as part of a secid to secctx 2022-07-13 17:18:29 -07:00
stacksplitdfa.in apparmor: use the dfa to do label parse string splitting 2018-02-09 11:30:01 -08:00
task.c apparmor: Simplify obtain the newest label on a cred 2022-10-03 14:49:04 -07:00