From owner-p4-projects@FreeBSD.ORG Tue Nov 27 22:53:07 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 574C810A; Tue, 27 Nov 2012 22:53:07 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 13043108 for ; Tue, 27 Nov 2012 22:53:07 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id EEB608FC16 for ; Tue, 27 Nov 2012 22:53:06 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id qARMr6lJ037702 for ; Tue, 27 Nov 2012 22:53:06 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id qARMr6G2037699 for perforce@freebsd.org; Tue, 27 Nov 2012 22:53:06 GMT (envelope-from brooks@freebsd.org) Date: Tue, 27 Nov 2012 22:53:06 GMT Message-Id: <201211272253.qARMr6G2037699@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 219857 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 22:53:07 -0000 http://p4web.freebsd.org/@@219857?ac=10 Change 219857 by brooks@brooks_zenith on 2012/11/27 22:52:29 Add the ability to break into the debugger on a capability exception. This behavior is controlled by the sysctl security.cheri.debugger_on_exception which defaults to off. Affected files ... .. //depot/projects/ctsrd/cheribsd/src/sys/mips/cheri/cheri.c#11 edit Differences ... ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/cheri/cheri.c#11 (text+ko) ==== @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -64,6 +65,11 @@ SYSCTL_UINT(_security_cheri, OID_AUTO, syscall_violations, CTLFLAG_RD, &security_cheri_syscall_violations, 0, "Number of system calls blocked"); +static u_int security_cheri_debugger_on_exception; +SYSCTL_UINT(_security_cheri, OID_AUTO, debugger_on_exception, CTLFLAG_RW, + &security_cheri_debugger_on_exception, 0, + "Run debugger on CHERI exception"); + /* * Given an existing more privileged capability (fromcrn), build a new * capability in tocrn with the contents of the passed flattened @@ -331,6 +337,11 @@ CHERI_CGETTAG(ctag, 31); intr_enable(); CHERI_REG_PRINT(c, ctag, 31); + +#if DDB + if (security_cheri_debugger_on_exception) + kdb_enter(KDB_WHY_CHERI, "CHERI exception"); +#endif } /*