linux/arch
Yaliang Wang fa3d444245 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 14:40:21 +02:00
..
alpha alpha: Declare virt_to_phys and virt_to_bus parameter as pointer to volatile 2021-09-30 10:11:07 +02:00
arc ARC: export clear_user_page() for modules 2021-09-22 12:28:04 +02:00
arm ARM: configs: multi_v5_defconfig: re-enable CONFIG_V4L_PLATFORM_DRIVERS 2022-04-08 14:40:11 +02:00
arm64 bpf, arm64: Feed byte-offset into bpf line info 2022-04-08 14:40:18 +02:00
c6x
csky perf: Protect perf_guest_cbs with RCU 2022-01-20 09:17:50 +01:00
h8300
hexagon hexagon: clean up timer-regs.h 2021-11-26 10:39:19 +01:00
ia64 ia64: ensure proper NUMA distance and possible map initialization 2022-03-08 19:09:34 +01:00
m68k m68k: coldfire/device.c: only build for MCF_EDMA when h/w macros are defined 2022-04-08 14:40:09 +02:00
microblaze uaccess: fix nios2 and microblaze get_user_8() 2022-04-08 14:40:08 +02:00
mips MIPS: pgalloc: fix memory leak caused by pgd_free() 2022-04-08 14:40:21 +02:00
nds32 nds32: fix access_ok() checks in get/put_user 2022-03-28 09:57:10 +02:00
nios2 uaccess: fix nios2 and microblaze get_user_8() 2022-04-08 14:40:08 +02:00
openrisc openrisc: Add clone3 ABI wrapper 2022-01-27 10:54:06 +01:00
parisc parisc/unaligned: Fix ldw() and stw() unalignment handlers 2022-03-02 11:42:46 +01:00
powerpc powerpc: 8xx: fix a return value error in mpc8xx_pic_init 2022-04-08 14:40:20 +02:00
riscv riscv: Increase stack size under KASAN 2022-04-08 14:39:53 +02:00
s390 s390/extable: fix exception table sorting 2022-03-08 19:09:36 +01:00
sh sh: define __BIG_ENDIAN for math-emu 2021-11-26 10:39:12 +01:00
sparc sparc64: fix pci_iounmap() when CONFIG_PCI is not set 2021-10-09 14:40:56 +02:00
um um: registers: Rename function names to avoid conflicts and build problems 2022-01-27 10:54:18 +01:00
x86 KVM: x86/emulator: Defer not-present segment check in __load_segment_descriptor() 2022-04-08 14:40:19 +02:00
xtensa xtensa: fix xtensa_wsr always writing 0 2022-04-08 14:39:58 +02:00
.gitignore
Kconfig arch/cc: Introduce a function to check for confidential computing features 2021-11-18 14:04:32 +01:00