Date: Fri, 27 Sep 2019 18:44:05 +0000 From: bugzilla-noreply@freebsd.org To: testing@freebsd.org Subject: [Bug 211924] lib/libc/sys/mmap_test:mmap_truncate_signal fails with SIGSEGV instead of SIGBUS Message-ID: <bug-211924-32464-ZuIusjoziy@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-211924-32464@https.bugs.freebsd.org/bugzilla/> References: <bug-211924-32464@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211924 --- Comment #10 from commit-hook@freebsd.org --- A commit references this bug: Author: kib Date: Fri Sep 27 18:43:39 UTC 2019 New revision: 352807 URL: https://svnweb.freebsd.org/changeset/base/352807 Log: Improve MD page fault handlers. Centralize calculation of signal and ucode delivered on unhandled page fault in new function vm_fault_trap(). MD trap_pfault() now almost always uses the signal numbers and error codes calculated in consistent MI way. This introduces the protection fault compatibility sysctls to all non-x86 architectures which did not have that bug, but apparently they were already much more wrong in selecting delivered signals on protection violations. Change the delivered signal for accesses to mapped area after the backing object was truncated. According to POSIX description for mmap(2): The system shall always zero-fill any partial page at the end of an object. Further, the system shall never write out any modified portions of the last page of an object which are beyond its end. References within the address range starting at pa and continuing for len bytes to whole pages following the end of an object shall result in delivery of a SIGBUS signal. An implementation may generate SIGBUS signals when a reference would cause an error in the mapped object, such as out-of-space condition. Adjust according to the description, keeping the existing compatibility code for SIGSEGV/SIGBUS on protection failures. For situations where kernel cannot handle page fault due to resource limit enforcement, SIGBUS with a new error code BUS_OBJERR is delivered. Also, provide a new error code SEGV_PKUERR for SIGSEGV on amd64 due to protection key access violation. vm_fault_hold() is renamed to vm_fault(). Fixed some nits in trap_pfault()s like mis-interpreting Mach errors as errnos. Removed unneeded truncations of the fault addresses reported by hardware. PR: 211924 Reviewed by: alc Discussed with: jilles, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21566 Changes: head/sys/amd64/amd64/trap.c head/sys/amd64/vmm/vmm.c head/sys/arm/arm/trap-v4.c head/sys/arm/arm/trap-v6.c head/sys/arm64/arm64/trap.c head/sys/i386/i386/trap.c head/sys/kern/sys_process.c head/sys/mips/mips/trap.c head/sys/powerpc/powerpc/trap.c head/sys/riscv/riscv/trap.c head/sys/sparc64/sparc64/trap.c head/sys/sys/signal.h head/sys/vm/vm_extern.h head/sys/vm/vm_fault.c head/sys/vm/vm_map.c head/sys/vm/vm_param.h --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-211924-32464-ZuIusjoziy>