- Avoid potential NULL dereference in huge_pte_alloc() on pmd_alloc()

failure
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE5RElWfyWxS+3PLO2a9axLQDIXvEFAl60Nq8ACgkQa9axLQDI
 XvHCvg/8CupwSce53iZE2NcUHjbyiUxrbKRG094PAnXCT87XSm7ubWeskh0hOjHq
 M/e1eKvD3NbXhe99/fMU//biRTwhCLc1e5zSYD/i19mXz0tkYaU+w6bvP2Nq96Ui
 Qd+N/sGMATl5fRvgQ7M70nbUARXmD9v0vwocDijRomq2vr4t4jHAzMeD1XrhS0JH
 2hmzMSQL2vaGQ0otC75qA0iaG4GRUS4tQJT78v03G5KzCdZsSyr9j4X8Ev2/FhPm
 agismE/5EqVM/8XF0iVlAv9hsRp8gmvD3w9mz1Bw6bqjcXcTT3vy8lC0OO9WkPdF
 8kGhzE+Xoge6Yb46hIJJnlVnm1btGAdRXQjjMyJXE26vaFkm1wxia+/oTr9AmSYm
 hxn3WIpAYxwCprF2qLsgOU1qcCs/JO05asYC6iPuNFz/ViJS8plTWPkXP+myvChU
 OOYgSElKURFrLVcMUExCLR38jAO0PecgIh2qmNsk2U6ZXTMPAPggGeB7mToBfSAx
 xxKrNERQZ0G8hlwweINAYJosccSi8YLzAO3zU9wAicf0rd/zB/zd27q75kjEvmY2
 Bt5Jjo1DvFRnick+Cf64ToBkfI+UPRqlr4a741NeVt6PBYmpWgqFm4vSHpAo45Z/
 3sDF20t7FctVOd4Akz0s9b3ZoZpzQxZ3rnxJXxzeptWIE3uU5J0=
 =wehO
 -----END PGP SIGNATURE-----

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fix from Catalin Marinas:
 "Avoid potential NULL dereference in huge_pte_alloc() on pmd_alloc()
  failure"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: hugetlb: avoid potential NULL dereference
This commit is contained in:
Linus Torvalds 2020-05-07 09:55:58 -07:00
commit 6e7f2eacf0

View File

@ -230,6 +230,8 @@ pte_t *huge_pte_alloc(struct mm_struct *mm,
ptep = (pte_t *)pudp;
} else if (sz == (CONT_PTE_SIZE)) {
pmdp = pmd_alloc(mm, pudp, addr);
if (!pmdp)
return NULL;
WARN_ON(addr & (sz - 1));
/*