android_kernel_motorola_sm6375/include
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Roberto Sassu f9d9320189 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:44:02 +01:00
..
acpi ACPI: CPPC: Do not prevent CPPC from working in the future 2022-08-25 11:18:15 +02:00
asm-generic mm/khugepaged: fix GUP-fast interaction by sending IPI 2022-12-14 11:30:42 +01:00
clocksource
crypto
drm drm: Initialize struct drm_crtc_state.no_vblank from device settings 2023-03-11 16:43:46 +01:00
dt-bindings
keys
kvm
linux ima: Align ima_file_mmap() parameters with mmap_file LSM hook 2023-03-11 16:44:02 +01:00
math-emu
media media: dvbdev: fix build warning due to comments 2023-01-18 11:41:42 +01:00
misc
net net: add sock_init_data_uid() 2023-03-11 16:43:40 +01:00
pcmcia
ras
rdma
scsi scsi: stex: Properly zero out the passthrough command structure 2022-10-15 07:54:39 +02:00
soc
sound ASoC: soc-dapm.h: fixup warning struct snd_pcm_substream not declared 2023-03-11 16:43:48 +01:00
target
trace jbd2: use the correct print format 2023-01-18 11:42:02 +01:00
uapi netfilter: conntrack: unify established states for SCTP paths 2023-02-06 07:52:47 +01:00
vdso
video video: of_display_timing.h: include errno.h 2022-07-12 16:30:47 +02:00
xen