From owner-svn-src-all@freebsd.org Mon Nov 14 18:30:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E74BC41914; Mon, 14 Nov 2016 18:30:04 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70B11189D; Mon, 14 Nov 2016 18:30:04 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAEIU3RV020977; Mon, 14 Nov 2016 18:30:03 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAEIU35P020976; Mon, 14 Nov 2016 18:30:03 GMT (envelope-from br@FreeBSD.org) Message-Id: <201611141830.uAEIU35P020976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 14 Nov 2016 18:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308644 - head/sys/riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2016 18:30:04 -0000 Author: br Date: Mon Nov 14 18:30:03 2016 New Revision: 308644 URL: https://svnweb.freebsd.org/changeset/base/308644 Log: Check if L2 entry exists for the given VA before loading L3 entry. This is a fix for a panic that was easy to reproduce executing "(/bin/ls &)" in the shell. Sponsored by: DARPA, AFRL Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Mon Nov 14 17:19:03 2016 (r308643) +++ head/sys/riscv/riscv/pmap.c Mon Nov 14 18:30:03 2016 (r308644) @@ -1992,6 +1992,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv l2 = pmap_l1_to_l2(l1, sva); if (l2 == NULL) continue; + if (pmap_load(l2) == 0) + continue; if ((pmap_load(l2) & PTE_RX) != 0) continue;