Skip to content
Snippets Groups Projects
Select Git revision
  • c76b7b6803e1badfca4db0e697bd505ac93ae069
  • openEuler-1.0-LTS default protected
  • openEuler-22.09
  • OLK-5.10
  • openEuler-22.03-LTS
  • openEuler-22.03-LTS-Ascend
  • master
  • openEuler-22.03-LTS-LoongArch-NW
  • openEuler-22.09-HCK
  • openEuler-20.03-LTS-SP3
  • openEuler-21.09
  • openEuler-21.03
  • openEuler-20.09
  • 4.19.90-2210.5.0
  • 5.10.0-123.0.0
  • 5.10.0-60.63.0
  • 5.10.0-60.62.0
  • 4.19.90-2210.4.0
  • 5.10.0-121.0.0
  • 5.10.0-60.61.0
  • 4.19.90-2210.3.0
  • 5.10.0-60.60.0
  • 5.10.0-120.0.0
  • 5.10.0-60.59.0
  • 5.10.0-119.0.0
  • 4.19.90-2210.2.0
  • 4.19.90-2210.1.0
  • 5.10.0-118.0.0
  • 5.10.0-106.19.0
  • 5.10.0-60.58.0
  • 4.19.90-2209.6.0
  • 5.10.0-106.18.0
  • 5.10.0-106.17.0
33 results

arch

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Mark Rutland authored and Yang Yingliang committed
    stable inclusion
    from linux-4.19.123
    commit 66434c6037f028e99e7292bea92cae9f22d29b1c
    
    --------------------------------
    
    commit 027d0c71 upstream.
    
    The static analyzer in GCC 10 spotted that in huge_pte_alloc() we may
    pass a NULL pmdp into pte_alloc_map() when pmd_alloc() returns NULL:
    
    |   CC      arch/arm64/mm/pageattr.o
    |   CC      arch/arm64/mm/hugetlbpage.o
    |                  from arch/arm64/mm/hugetlbpage.c:10:
    | arch/arm64/mm/hugetlbpage.c: In function ‘huge_pte_alloc’:
    | ./arch/arm64/include/asm/pgtable-types.h:28:24: warning: dereference of NULL ‘pmdp’ [CWE-690] [-Wanalyzer-null-dereference]
    | ./arch/arm64/include/asm/pgtable.h:436:26: note: in expansion of macro ‘pmd_val’
    | arch/arm64/mm/hugetlbpage.c:242:10: note: in expansion of macro ‘pte_alloc_map’
    |     |arch/arm64/mm/hugetlbpage.c:232:10:
    |     |./arch/arm64/include/asm/pgtable-types.h:28:24:
    | ./arch/arm64/include/asm/pgtable.h:436:26: note: in expansion of macro ‘pmd_val’
    | arch/arm64/mm/hugetlbpage.c:242:10: note: in expansion of macro ‘pte_alloc_map’
    
    This can only occur when the kernel cannot allocate a page, and so is
    unlikely to happen in practice before other systems start failing.
    
    We can avoid this by bailing out if pmd_alloc() fails, as we do earlier
    in the function if pud_alloc() fails.
    
    Fixes: 66b3923a ("arm64: hugetlb: add support for PTE contiguous bit")
    Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
    Reported-by: default avatarKyrill Tkachov <kyrylo.tkachov@arm.com>
    Cc: <stable@vger.kernel.org> # 4.5.x-
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
    c76b7b68
    History
    Name Last commit Last update
    ..