svn commit: r367227 - stable/12/sys/arm/arm

Michal Meloun mmel at FreeBSD.org
Sat Oct 31 17:26:57 UTC 2020


Author: mmel
Date: Sat Oct 31 17:26:56 2020
New Revision: 367227
URL: https://svnweb.freebsd.org/changeset/base/367227

Log:
  MFC r366197:
  
    Don't send a signal with uninitialized 'sig' and 'code' fields.  We have a
    few shortcuts in the arm trap code to speed up obvious "must fail" cases. In
    these situations, make sure that we fill in the "sig" and "code" fields of
    the generated signal.

Modified:
  stable/12/sys/arm/arm/trap-v6.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm/arm/trap-v6.c
==============================================================================
--- stable/12/sys/arm/arm/trap-v6.c	Sat Oct 31 17:18:18 2020	(r367226)
+++ stable/12/sys/arm/arm/trap-v6.c	Sat Oct 31 17:26:56 2020	(r367227)
@@ -462,8 +462,11 @@ abort_handler(struct trapframe *tf, int prefetch)
 		/*
 		 * Don't allow user-mode faults in kernel address space.
 		 */
-		if (usermode)
+		if (usermode) {
+			ksig.sig = SIGSEGV;
+			ksig.code = SEGV_ACCERR;
 			goto nogo;
+		}
 
 		map = kernel_map;
 	} else {
@@ -472,8 +475,11 @@ abort_handler(struct trapframe *tf, int prefetch)
 		 * is NULL or curproc->p_vmspace is NULL the fault is fatal.
 		 */
 		vm = (p != NULL) ? p->p_vmspace : NULL;
-		if (vm == NULL)
+		if (vm == NULL) {
+			ksig.sig = SIGSEGV;
+			ksig.code = 0;
 			goto nogo;
+		}
 
 		map = &vm->vm_map;
 		if (!usermode && (td->td_intr_nesting_level != 0 ||


More information about the svn-src-stable mailing list