mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-19 10:44:14 +08:00
573a259336
The error handling in hugetlb_allocate_area() was incorrect for the hugetlb_shared test case. Previously the behavior was: - mmap a hugetlb area - If this fails, set the pointer to NULL, and carry on - mmap an alias of the same hugetlb fd - If this fails, munmap the original area If the original mmap failed, it's likely the second one did too. If both failed, we'd blindly try to munmap a NULL pointer, causing a SIGSEGV. Instead, "goto fail" so we return before trying to mmap the alias. This issue can be hit "in real life" by forgetting to set /proc/sys/vm/nr_hugepages (leaving it at 0), and then trying to run the hugetlb_shared test. Another small improvement is, when the original mmap fails, don't just print "it failed": perror(), so we can see *why*. :) Signed-off-by: Axel Rasmussen <axelrasmussen@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Shuah Khan <shuah@kernel.org> Cc: Peter Xu <peterx@redhat.com> Cc: Joe Perches <joe@perches.com> Cc: Mike Rapoport <rppt@linux.vnet.ibm.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: David Alan Gilbert <dgilbert@redhat.com> Link: https://lkml.kernel.org/r/20201204203443.2714693-1-axelrasmussen@google.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> |
||
---|---|---|
.. | ||
android | ||
arm64 | ||
bpf | ||
breakpoints | ||
capabilities | ||
cgroup | ||
clone3 | ||
core | ||
cpu-hotplug | ||
cpufreq | ||
dmabuf-heaps | ||
drivers | ||
efivarfs | ||
exec | ||
filesystems | ||
firmware | ||
fpu | ||
ftrace | ||
futex | ||
gpio | ||
ia64 | ||
intel_pstate | ||
ipc | ||
ir | ||
kcmp | ||
kexec | ||
kmod | ||
kselftest | ||
kvm | ||
lib | ||
livepatch | ||
lkdtm | ||
locking | ||
media_tests | ||
membarrier | ||
memfd | ||
memory-hotplug | ||
mincore | ||
mount | ||
mqueue | ||
net | ||
netfilter | ||
nsfs | ||
ntb | ||
openat2 | ||
pid_namespace | ||
pidfd | ||
powerpc | ||
prctl | ||
proc | ||
pstore | ||
ptp | ||
ptrace | ||
rcutorture | ||
resctrl | ||
rseq | ||
rtc | ||
safesetid | ||
seccomp | ||
sigaltstack | ||
size | ||
sparc64 | ||
splice | ||
static_keys | ||
sync | ||
sysctl | ||
tc-testing | ||
timens | ||
timers | ||
tmpfs | ||
tpm2 | ||
uevent | ||
user | ||
vDSO | ||
vm | ||
watchdog | ||
wireguard | ||
x86 | ||
zram | ||
.gitignore | ||
gen_kselftest_tar.sh | ||
kselftest_deps.sh | ||
kselftest_harness.h | ||
kselftest_install.sh | ||
kselftest_module.h | ||
kselftest.h | ||
lib.mk | ||
Makefile | ||
run_kselftest.sh |