linux/arch/mips
Henry Willard 1492c6b187 MIPS: Don't clear _PAGE_SPECIAL in _PAGE_CHG_MASK
In the special case where

	p = mmap(NULL, ALLOC_SIZE, PROT_READ,
                MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE, -1, 0);

is followed by

	rc = mprotect(p, ALLOC_SIZE, PROT_NONE);

the _PAGE_SPECIAL bit in the page tables will be cleared by
mistake and the later unmapped operations will incorrectly
modify the struct page for the the zero page. This sequence
occurs in the madvise05 test of the Linux Test Project
suite of tests.

This was discovered while testing an older version of the kernel
(5.4.17) on a MIPS device. Unfortunately, support for this device
is not available in newer kernels, so I can't test this with the
latest Linux kernel code. It looks like the problem exists in
newer kernels, but I can't verify it. Except for the LTP test,
this sequence of calls is probably not common.

Passing it along in the hope it will be useful to someone.

Signed-off-by: Henry Willard <henry.willard@oracle.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-24 09:48:51 +02:00
..
alchemy mips: alchemy: gpio: Include the right header 2022-11-11 15:45:37 +01:00
ar7
ath25
ath79 MIPS: ath79: remove obsolete ATH79_DEV_* configs 2023-03-17 10:28:04 +01:00
bcm47xx MIPS: BCM47XX: Add support for Huawei B593u-12 2023-03-14 17:05:14 +01:00
bcm63xx MIPS: BCM63xx: Add check for NULL for clk in clk_enable 2022-12-09 23:37:06 +01:00
bmips MIPS: BMIPS: Utilize cfe_die() for invalid DTB 2022-07-17 14:53:07 +02:00
boot mips: dts: ralink: mt7621: add phandle to system controller node for watchdog 2023-02-28 23:09:32 +01:00
cavium-octeon MIPS: Octeon: Disable CVMSEG by default on other platforms 2023-04-05 09:45:09 +02:00
cobalt
configs MIPS: Add board config for virt board 2023-04-05 09:45:09 +02:00
crypto crypto: Kconfig - simplify cipher entries 2022-08-26 18:50:43 +08:00
dec MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
fw MIPS: fw: Allow firmware to pass a empty env 2023-04-12 15:07:36 +02:00
generic arch: mips: generic: Add missing of_node_put() in board-ranchu.c 2022-06-21 17:04:30 +02:00
include MIPS: Don't clear _PAGE_SPECIAL in _PAGE_CHG_MASK 2023-04-24 09:48:51 +02:00
ingenic
jazz MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
kernel MIPS: Sink body of check_bugs_early() into its only call site 2023-04-22 23:29:00 +02:00
kvm Kbuild updates for v6.3 2023-02-26 11:53:25 -08:00
lantiq MIPS: vpe-mt: drop physical_memsize 2023-02-20 15:11:01 +01:00
lib MIPS: Simplify __bswapdi2() and __bswapsi2() 2022-09-30 16:50:00 +02:00
loongson2ef MIPS: loongson2ef: Add missing break in cs5536_isa 2023-04-12 15:12:24 +02:00
loongson32 MIPS: loongson32: Drop obsolete cpufreq platform device 2023-02-13 17:11:00 +01:00
loongson64 MIPS: Loongson: Move arch cflags to MIPS top level Makefile 2023-04-05 09:45:09 +02:00
math-emu MIPS: Fix comment typo 2022-09-12 15:33:24 +02:00
mm MIPS: mm: Remove local_cache_flush_page 2023-04-05 10:08:53 +02:00
mti-malta MIPS: Remove deprecated CONFIG_MIPS_CMP 2023-04-12 15:01:09 +02:00
n64
net bpf, mips: No need to use min() to get MAX_TAIL_CALL_CNT 2022-08-29 15:38:14 +02:00
pci mips: Use of_property_read_bool() for boolean properties 2023-03-14 17:16:46 +01:00
pic32 MIPS: pic32: treat port as signed integer 2022-11-11 15:53:58 +01:00
power
ralink MIPS: Remove deprecated CONFIG_MIPS_CMP 2023-04-12 15:01:09 +02:00
rb532 MIPS: rb532: move GPIOD definition into C-files 2022-03-30 20:26:26 +02:00
sgi-ip22 driver core: make struct bus_type.uevent() take a const * 2023-01-27 13:45:52 +01:00
sgi-ip27 MIPS: SGI-IP27: Fix platform-device leak in bridge_platform_create() 2022-09-19 16:33:27 +02:00
sgi-ip30 MIPS: SGI-IP30: Fix platform-device leak in bridge_platform_create() 2022-09-19 16:32:54 +02:00
sgi-ip32
sibyte MIPS: sibyte: Replace BCM1125H with SB1250 option 2023-03-17 10:27:34 +01:00
sni
tools MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
txx9 MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
vdso MIPS: remove CONFIG_MIPS_LD_CAN_LINK_VDSO 2023-01-27 17:14:48 +01:00
Kbuild kbuild: remove --include-dir MAKEFLAG from top Makefile 2023-02-05 18:51:22 +09:00
Kbuild.platforms MIPS: sibyte: Remove unused config option SIBYTE_BCM1x55 2023-03-17 10:27:08 +01:00
Kconfig Revert "MIPS: generic: Enable all CPUs supported by virt board in Kconfig" 2023-04-12 15:25:37 +02:00
Kconfig.debug
Makefile MIPS: Loongson: Move arch cflags to MIPS top level Makefile 2023-04-05 09:45:09 +02:00
Makefile.postlink kbuild: remove --include-dir MAKEFLAG from top Makefile 2023-02-05 18:51:22 +09:00