linux/arch/powerpc/mm
Kunwu Chan f46c8a7526 powerpc/mm: Fix null-pointer dereference in pgtable_cache_add
kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure. Ensure the allocation was successful
by checking the pointer validity.

Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231204023223.2447523-1-chentao@kylinos.cn
2023-12-13 22:13:41 +11:00
..
book3s32 powerpc/32s: Introduce _PAGE_READ and remove _PAGE_USER 2023-10-19 17:12:47 +11:00
book3s64 powerpc/book3s/hash: Drop _PAGE_PRIVILEGED from PAGE_NONE 2023-12-07 23:34:11 +11:00
kasan powerpc/kasan: Disable KCOV in KASAN code 2023-07-17 22:49:44 +10:00
nohash powerpc updates for 6.7 2023-11-03 10:07:39 -10:00
ptdump powerpc/ptdump: Display _PAGE_READ and _PAGE_WRITE 2023-10-19 17:12:47 +11:00
cacheflush.c powerpc: implement the new page table range API 2023-08-24 16:20:23 -07:00
copro_fault.c powerpc/mm: convert coprocessor fault to lock_mm_and_find_vma() 2023-06-24 14:12:58 -07:00
dma-noncoherent.c dma-mapping: merge <linux/dma-noncoherent.h> into <linux/dma-map-ops.h> 2020-10-06 07:07:06 +02:00
drmem.c powerpc: Annotate endianness of various variables and functions 2023-10-19 17:12:47 +11:00
fault.c powerpc: Support execute-only on all powerpc 2023-10-19 17:12:47 +11:00
hugetlbpage.c powerpc/hugetlb: pte_alloc_huge() 2023-06-19 16:19:08 -07:00
init_32.c powerpc: Untangle fixmap.h and pgtable.h and mmu.h 2023-10-19 17:12:44 +11:00
init_64.c powerpc updates for 6.6 2023-08-31 12:43:10 -07:00
init-common.c powerpc/mm: Fix null-pointer dereference in pgtable_cache_add 2023-12-13 22:13:41 +11:00
ioremap_32.c powerpc: mm: convert to GENERIC_IOREMAP 2023-08-18 10:12:35 -07:00
ioremap_64.c powerpc: mm: convert to GENERIC_IOREMAP 2023-08-18 10:12:35 -07:00
ioremap.c powerpc/nohash: Replace pte_user() by pte_read() 2023-10-19 17:12:46 +11:00
maccess.c powerpc/inst: Optimise copy_inst_from_kernel_nofault() 2021-12-09 22:41:21 +11:00
Makefile powerpc/mm: Convert to default topdown mmap layout 2022-05-05 22:11:58 +10:00
mem.c powerpc: Remove file parameter from phys_mem_access_prot() 2023-11-06 15:21:33 +11:00
mmu_context.c powerpc: Add mm_cpumask warning when context switching 2023-08-02 22:22:19 +10:00
mmu_decl.h powerpc/64s: Fix CONFIG_NUMA=n build due to create_section_mapping() 2023-11-30 21:31:09 +11:00
numa.c powerpc/pseries: Move VPHN constants into vphn.h 2023-08-24 22:33:16 +10:00
pageattr.c powerpc: align address to page boundary in change_page_attr() 2022-05-08 22:15:41 +10:00
pgtable_32.c powerpc: move __end_rodata to cover arch read-only sections 2022-09-26 20:58:16 +10:00
pgtable_64.c powerpc: Remove asm/prom.h from all files that don't need it 2022-05-08 22:15:04 +10:00
pgtable-frag.c powerpc: convert various functions to use ptdescs 2023-08-21 13:37:54 -07:00
pgtable.c powerpc updates for 6.7 2023-11-03 10:07:39 -10:00