linux-stable/include
Roberto Sassu 8c64acd24a ima: Align ima_file_mmap() parameters with mmap_file LSM hook
commit 4971c268b8 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:40:00 +01:00
..
acpi ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init() 2022-11-10 18:14:22 +01:00
asm-generic mm/khugepaged: fix GUP-fast interaction by sending IPI 2022-12-14 11:31:55 +01:00
clocksource
crypto crypto: drbg - make reseeding from get_random_bytes() synchronous 2022-06-06 08:42:42 +02:00
drm drm/mipi-dsi: Fix byte order of 16-bit DCS set/get brightness 2023-03-11 16:39:33 +01:00
dt-bindings dt-bindings: clocks: imx8mp: Add ID for usb suspend clock 2023-01-18 11:44:56 +01:00
keys
kunit
kvm
linux ima: Align ima_file_mmap() parameters with mmap_file LSM hook 2023-03-11 16:40:00 +01:00
math-emu
media media: dvbdev: fix build warning due to comments 2023-01-14 10:16:24 +01:00
memory memory: renesas-rpc-if: Fix HF/OSPI data transfer in Manual Mode 2022-05-09 09:05:02 +02:00
misc
net net: add sock_init_data_uid() 2023-03-11 16:39:26 +01:00
pcmcia
ras
rdma
scsi scsi: iscsi: Fix multiple iSCSI session unbind events sent to userspace 2023-02-01 08:23:16 +01:00
soc
sound ASoC: soc-dapm.h: fixup warning struct snd_pcm_substream not declared 2023-03-11 16:39:39 +01:00
target
trace tracing: Use alignof__(struct {type b;}) instead of offsetof() 2023-01-24 07:20:01 +01:00
uapi uapi: add missing ip/ipv6 header dependencies for linux/stddef.h 2023-02-15 17:22:24 +01:00
vdso
video video: of_display_timing.h: include errno.h 2022-07-12 16:32:19 +02:00
xen