twx-linux/arch/arc/include/asm
Pavel Kozlov 4fd9df10cb ARC: mm: fix leakage of memory allocated for PTE
Since commit d9820ff ("ARC: mm: switch pgtable_t back to struct page *")
a memory leakage problem occurs. Memory allocated for page table entries
not released during process termination. This issue can be reproduced by
a small program that allocates a large amount of memory. After several
runs, you'll see that the amount of free memory has reduced and will
continue to reduce after each run. All ARC CPUs are effected by this
issue. The issue was introduced since the kernel stable release v5.15-rc1.

As described in commit d9820ff after switch pgtable_t back to struct
page *, a pointer to "struct page" and appropriate functions are used to
allocate and free a memory page for PTEs, but the pmd_pgtable macro hasn't
changed and returns the direct virtual address from the PMD (PGD) entry.
Than this address used as a parameter in the __pte_free() and as a result
this function couldn't release memory page allocated for PTEs.

Fix this issue by changing the pmd_pgtable macro and returning pointer to
struct page.

Fixes: d9820ff76f95 ("ARC: mm: switch pgtable_t back to struct page *")
Cc: Mike Rapoport <rppt@kernel.org>
Cc: <stable@vger.kernel.org> # 5.15.x
Signed-off-by: Pavel Kozlov <pavel.kozlov@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@kernel.org>
2022-10-17 16:32:12 -07:00
..
arcregs.h
asm-offsets.h
asserts.h
atomic64-arcv2.h ARC: atomics: implement relaxed variants 2021-08-24 14:25:47 -07:00
atomic-llsc.h ARC: atomic: cleanup atomic-llsc definitions 2022-04-18 14:45:09 -07:00
atomic-spinlock.h ARC: atomic: !LLSC: use int data type consistently 2021-08-24 14:25:46 -07:00
atomic.h ARC: atomic_cmpxchg/atomic_xchg: implement relaxed variants 2021-08-24 14:25:47 -07:00
barrier.h
bitops.h ARC: bitops: Change __fls to return unsigned long 2022-10-17 16:32:12 -07:00
bug.h
cache.h ARC: mm: move mmu/cache externs out to setup.h 2021-08-24 14:25:48 -07:00
cacheflush.h Add linux/cacheflush.h 2021-11-17 10:36:15 -05:00
checksum.h arc: Prefer unsigned int to bare use of unsigned 2021-08-03 18:58:33 -07:00
cmpxchg.h ARC: atomic_cmpxchg/atomic_xchg: implement relaxed variants 2021-08-24 14:25:47 -07:00
current.h
delay.h
disasm.h
dma.h PCI: Move isa_dma_bridge_buggy out of asm/dma.h 2022-07-22 17:24:47 -05:00
dsp-impl.h
dsp.h
dwarf.h
elf.h
entry-arcv2.h
entry-compact.h ARC: Fix comment typo 2022-10-17 16:32:11 -07:00
entry.h
exec.h
fb.h
fpu.h
futex.h
highmem.h
hugepage.h arch: Add pmd_pfn() where it is missing 2022-03-21 12:59:02 -04:00
io.h arc: iounmap() arg is volatile 2022-10-17 16:32:12 -07:00
irq.h
irqflags-arcv2.h
irqflags-compact.h arc: Replace lkml.org links with lore 2021-12-28 19:48:49 -08:00
irqflags.h
jump_label.h
Kbuild
kdebug.h
kgdb.h
kprobes.h kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
linkage.h
mach_desc.h
mmu_context.h ARC: mm: move MMU specific bits out of ASID allocator 2021-08-24 14:25:48 -07:00
mmu-arcv2.h ARC: mm: disintegrate mmu.h (arcv2 bits out) 2021-08-25 15:53:19 -07:00
mmu.h ARC: mm: disintegrate mmu.h (arcv2 bits out) 2021-08-25 15:53:19 -07:00
module.h
page.h ARC: mm: support 4 levels of page tables 2021-08-26 13:43:19 -07:00
pci.h
perf_event.h ARC: bpf: define uapi for BPF_PROG_TYPE_PERF_EVENT program type 2022-04-26 09:35:28 -07:00
pgalloc.h ARC: mm: support 4 levels of page tables 2021-08-26 13:43:19 -07:00
pgtable-bits-arcv2.h arc/mm: enable ARCH_HAS_VM_GET_PAGE_PROT 2022-07-17 17:14:40 -07:00
pgtable-levels.h ARC: mm: fix leakage of memory allocated for PTE 2022-10-17 16:32:12 -07:00
pgtable.h ARC: fix potential build snafu 2021-10-15 18:06:32 -07:00
processor.h kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
ptrace.h ARC: enable HAVE_REGS_AND_STACK_ACCESS_API feature 2022-04-25 13:09:47 -07:00
sections.h
serial.h
setup.h ARC: mm: move mmu/cache externs out to setup.h 2021-08-24 14:25:48 -07:00
shmparam.h
smp.h ARC: switch to generic bitops 2021-08-24 14:25:47 -07:00
spinlock_types.h
spinlock.h
stacktrace.h
string.h
switch_to.h
syscall.h ARC: implement syscall tracepoints 2022-04-25 13:09:47 -07:00
syscalls.h
thread_info.h ARC: implement syscall tracepoints 2022-04-25 13:09:47 -07:00
timex.h
tlb.h
tlbflush.h
uaccess.h uaccess: remove CONFIG_SET_FS 2022-02-25 09:36:06 +01:00
unaligned.h
unwind.h
vermagic.h
vmalloc.h