Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Aug 2016 18:19:46 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r304622 - head/sys/arm64/arm64
Message-ID:  <201608221819.u7MIJkeV053115@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Mon Aug 22 18:19:46 2016
New Revision: 304622
URL: https://svnweb.freebsd.org/changeset/base/304622

Log:
  Ensure map is valid, even before userland exists and the fault address
  register points to an address in the userland range.
  
  Obtained from:	ABT Systems Ltd
  MFC after:	1 week
  Sponsored by:	the FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/trap.c

Modified: head/sys/arm64/arm64/trap.c
==============================================================================
--- head/sys/arm64/arm64/trap.c	Mon Aug 22 18:17:29 2016	(r304621)
+++ head/sys/arm64/arm64/trap.c	Mon Aug 22 18:19:46 2016	(r304622)
@@ -184,10 +184,13 @@ data_abort(struct trapframe *frame, uint
 		map = &p->p_vmspace->vm_map;
 	else {
 		/* The top bit tells us which range to use */
-		if ((far >> 63) == 1)
+		if ((far >> 63) == 1) {
 			map = kernel_map;
-		else
+		} else {
 			map = &p->p_vmspace->vm_map;
+			if (map == NULL)
+				map = kernel_map;
+		}
 	}
 
 	if (pmap_fault(map->pmap, esr, far) == KERN_SUCCESS)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608221819.u7MIJkeV053115>