android_kernel_motorola_sm6225/include
Roberto Sassu 0b1a3d4137 ima: Align ima_file_mmap() parameters with mmap_file LSM hook
commit 4971c268b85e1c7a734a61622fc0813c86e2362e upstream.

Commit 98de59bfe4 ("take calculation of final prot in
security_mmap_file() into a helper") moved the code to update prot, to be
the actual protections applied to the kernel, to a new helper called
mmap_prot().

However, while without the helper ima_file_mmap() was getting the updated
prot, with the helper ima_file_mmap() gets the original prot, which
contains the protections requested by the application.

A possible consequence of this change is that, if an application calls
mmap() with only PROT_READ, and the kernel applies PROT_EXEC in addition,
that application would have access to executable memory without having this
event recorded in the IMA measurement list. This situation would occur for
example if the application, before mmap(), calls the personality() system
call with READ_IMPLIES_EXEC as the first argument.

Align ima_file_mmap() parameters with those of the mmap_file LSM hook, so
that IMA can receive both the requested prot and the final prot. Since the
requested protections are stored in a new variable, and the final
protections are stored in the existing variable, this effectively restores
the original behavior of the MMAP_CHECK hook.

Cc: stable@vger.kernel.org
Fixes: 98de59bfe4 ("take calculation of final prot in security_mmap_file() into a helper")
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-11 16:31:51 +01:00
..
acpi ACPI: CPPC: Do not prevent CPPC from working in the future 2022-08-25 11:15:30 +02:00
asm-generic mm/khugepaged: fix GUP-fast interaction by sending IPI 2023-01-18 11:29:59 +01:00
clocksource
crypto crypto: drbg - make reseeding from get_random_bytes() synchronous 2022-06-25 11:49:13 +02:00
drm drm/mipi-dsi: Fix byte order of 16-bit DCS set/get brightness 2023-03-11 16:31:40 +01:00
dt-bindings dt-bindings: reset: meson8b: fix duplicate reset IDs 2020-01-23 08:21:26 +01:00
keys KEYS: Don't write out to userspace while holding key semaphore 2020-04-23 10:30:24 +02:00
kvm KVM: arm/arm64: Sync ICH_VMCR_EL2 back when about to block 2019-08-25 10:47:59 +02:00
linux ima: Align ima_file_mmap() parameters with mmap_file LSM hook 2023-03-11 16:31:51 +01:00
math-emu math-emu/soft-fp.h: (_FP_ROUND_ZERO) cast 0 to void to fix warning 2019-12-13 08:51:34 +01:00
media media: dvbdev: fix build warning due to comments 2023-01-18 11:30:39 +01:00
memory
misc
net dccp/tcp: Avoid negative sk_forward_alloc by ipv6_pinfo.pktoptions. 2023-02-22 12:47:21 +01:00
pcmcia
ras
rdma RDMA/netlink: Add __maybe_unused to static inline in C file 2021-11-26 11:36:24 +01:00
scsi scsi: stex: Properly zero out the passthrough command structure 2022-10-26 13:19:18 +02:00
soc irqchip/eznps: Fix build error for !ARC700 builds 2020-09-17 13:45:25 +02:00
sound ALSA: core: Add async signal helpers 2022-08-25 11:15:46 +02:00
target scsi: target: Fix ordered tag handling 2021-11-26 11:36:20 +01:00
trace Revert "ext4: generalize extents status tree search functions" 2023-01-24 07:11:51 +01:00
uapi include/uapi/linux/swab: Fix potentially missing __always_inline 2023-01-18 11:30:30 +01:00
video video: of_display_timing.h: include errno.h 2022-07-12 16:29:01 +02:00
xen xen/gnttab: fix gnttab_end_foreign_access() without page specified 2022-03-11 10:15:13 +01:00