linux-stable/arch/mips
Yaliang Wang 1bf0d78c8c MIPS: pgalloc: fix memory leak caused by pgd_free()
[ Upstream commit 2bc5bab9a7 ]

pgd page is freed by generic implementation pgd_free() since commit
f9cb654cb5 ("asm-generic: pgalloc: provide generic pgd_free()"),
however, there are scenarios that the system uses more than one page as
the pgd table, in such cases the generic implementation pgd_free() won't
be applicable anymore. For example, when PAGE_SIZE_4KB is enabled and
MIPS_VA_BITS_48 is not enabled in a 64bit system, the macro "PGD_ORDER"
will be set as "1", which will cause allocating two pages as the pgd
table. Well, at the same time, the generic implementation pgd_free()
just free one pgd page, which will result in the memory leak.

The memory leak can be easily detected by executing shell command:
"while true; do ls > /dev/null; grep MemFree /proc/meminfo; done"

Fixes: f9cb654cb5 ("asm-generic: pgalloc: provide generic pgd_free()")
Signed-off-by: Yaliang Wang <Yaliang.Wang@windriver.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-08 13:58:17 +02:00
..
alchemy mips: alchemy: remove historic comment on gpio build constraints 2021-12-16 15:48:32 +01:00
ar7
ath25
ath79 MIPS: ath79: drop _machine_restart again 2022-01-11 16:16:52 +01:00
bcm47xx MIPS: BCM47XX: Add support for Netgear WN2500RP v1 & v2 2022-01-09 15:41:50 +01:00
bcm63xx linux-watchdog 5.17-rc1 tag 2022-01-17 08:07:57 +02:00
bmips MIPS: bmips: Remove obsolete DMA mapping support 2022-01-11 11:55:41 +01:00
boot mips: Enable KCSAN 2022-04-08 13:58:10 +02:00
cavium-octeon MIPS: octeon: Fix missed PTR->PTR_WD conversion 2022-02-01 08:35:12 +01:00
cobalt
configs - added support for more BCM47XX based devices 2022-01-14 15:08:36 +01:00
crypto
dec mips: DEC: honor CONFIG_MIPS_FP_SUPPORT=n 2022-04-08 13:58:16 +02:00
fw
generic MIPS: new Kconfig option ZBOOT_LOAD_ADDRESS 2022-01-02 14:17:30 +01:00
include MIPS: pgalloc: fix memory leak caused by pgd_free() 2022-04-08 13:58:17 +02:00
ingenic
jazz
kernel mips: setup: fix setnocoherentio() boolean setting 2022-02-22 09:35:02 +01:00
kvm ARM: 2022-02-05 09:55:59 -08:00
lantiq mips: lantiq: add support for clk_set_parent() 2022-01-02 14:14:41 +01:00
lib MIPS: Fix build error due to PTR used in more places 2022-01-27 09:04:19 +01:00
loongson2ef MIPS: Loongson2ef: Remove unnecessary {as,cc}-option calls 2021-12-09 10:27:14 +01:00
loongson32
loongson64 PCI/sysfs: Find shadow ROM before static attribute initialization 2022-01-26 10:41:21 -06:00
math-emu
mm MIPS: Sanitise Cavium switch cases in TLB handler synthesizers 2022-04-08 13:58:16 +02:00
mti-malta
n64
net Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-10 15:56:13 -08:00
pci - added support for more BCM47XX based devices 2022-01-14 15:08:36 +01:00
pic32
power
ralink MIPS: ralink: mt7621: use bitwise NOT instead of logical 2022-03-01 10:08:45 +01:00
rb532 MIPS: RB532: fix return value of __setup handler 2022-04-08 13:58:17 +02:00
sgi-ip22 MIPS: SGI-IP22: Remove unnecessary check of GCC option 2021-12-14 10:02:40 +01:00
sgi-ip27 - Config updates for BMIPS platform 2021-11-13 09:11:33 -08:00
sgi-ip30 memblock: rename memblock_free to memblock_phys_free 2021-11-06 13:30:41 -07:00
sgi-ip32 MIPS: Allow modules to set board_be_handler 2021-11-09 16:07:26 +01:00
sibyte - Config updates for BMIPS platform 2021-11-13 09:11:33 -08:00
sni MIPS: sni: Fix the build 2021-10-18 18:09:54 +02:00
tools
txx9 MIPS: TXX9: Remove TX4939 SoC support 2022-01-02 14:12:03 +01:00
vdso mips: Enable KCSAN 2022-04-08 13:58:10 +02:00
vr41xx
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kbuild.platforms MIPS: fix duplicated slashes for Platform file path 2021-11-09 16:11:52 +01:00
Kconfig mips: Enable KCSAN 2022-04-08 13:58:10 +02:00
Kconfig.debug
Makefile mips: Always permit to build u-boot images 2022-04-08 13:57:29 +02:00
Makefile.postlink