Date: Mon, 5 Nov 2012 13:01:59 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 219602 for review Message-ID: <201211051301.qA5D1x9R002107@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@219602?ac=10 Change 219602 by rwatson@rwatson_svr_ctsrd_mipsbuild on 2012/11/05 13:01:32 Define a very basic CHERI exception handler for userspace, which maps into a new SIGPROT signal that, uncaught, terminates the generating application. Continue to panic the kernel if it generates a CHERI exception. In the futue, it would be nice to trigger a core dump and more detailed debugging information, but this is a marked functional improvement in the mean time! Affected files ... .. //depot/projects/ctsrd/cheribsd/src/lib/libc/gen/signal.3#3 edit .. //depot/projects/ctsrd/cheribsd/src/lib/libc/nls/C.msg#2 edit .. //depot/projects/ctsrd/cheribsd/src/lib/libc/sys/sigaction.2#2 edit .. //depot/projects/ctsrd/cheribsd/src/sys/mips/include/cherireg.h#8 edit .. //depot/projects/ctsrd/cheribsd/src/sys/mips/mips/trap.c#8 edit .. //depot/projects/ctsrd/cheribsd/src/sys/sys/signal.h#3 edit Differences ... ==== //depot/projects/ctsrd/cheribsd/src/lib/libc/gen/signal.3#3 (text+ko) ==== @@ -28,7 +28,7 @@ .\" @(#)signal.3 8.3 (Berkeley) 4/19/94 .\" $FreeBSD: src/lib/libc/gen/signal.3,v 1.44 2012/06/16 06:38:11 joel Exp $ .\" -.Dd June 7, 2004 +.Dd November 5, 2012 .Dt SIGNAL 3 .Os .Sh NAME @@ -132,6 +132,7 @@ .It 30 Ta Dv SIGUSR1 Ta "terminate process" Ta "User defined signal 1" .It 31 Ta Dv SIGUSR2 Ta "terminate process" Ta "User defined signal 2" .It 32 Ta Dv SIGTHR Ta "terminate process" Ta "thread interrupt" +.It 34 Ta Dv SIGPROT Ta "terminate process" Ta "in-process protection exception" .El .Pp The ==== //depot/projects/ctsrd/cheribsd/src/lib/libc/nls/C.msg#2 (text+ko) ==== @@ -257,6 +257,10 @@ 30 User defined signal 1 $ SIGUSR2 31 User defined signal 2 +$ SIGTHR +32 Thread interrupt +$ SIGPROT +33 In-process protection exception $ $ gai_strerror() support catalog $ ==== //depot/projects/ctsrd/cheribsd/src/lib/libc/sys/sigaction.2#2 (text+ko) ==== @@ -28,7 +28,7 @@ .\" From: @(#)sigaction.2 8.2 (Berkeley) 4/3/94 .\" $FreeBSD: src/lib/libc/sys/sigaction.2,v 1.62 2010/05/06 22:49:54 jilles Exp $ .\" -.Dd April 18, 2010 +.Dd November 5, 2012 .Dt SIGACTION 2 .Os .Sh NAME @@ -331,6 +331,8 @@ .It Dv SIGINFO No " discard signal" " status request from keyboard" .It Dv SIGUSR1 No " terminate process" " User defined signal 1" .It Dv SIGUSR2 No " terminate process" " User defined signal 2" +.It Dv SIGTHR No " discard signal" " thread interrupt" +.It Dv SIGPROT No " discard signal" " in-process protection exception" .El .Sh NOTE The ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/include/cherireg.h#8 (text+ko) ==== ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/mips/trap.c#8 (text+ko) ==== @@ -905,10 +905,26 @@ addr = trapframe->pc; } break; +#ifdef CPU_CHERI + case T_C2E: + goto err; + break; + + case T_C2E + T_USER: + /* + * XXXRW: Eventually, do much, much more here. + * log_cheri_exception("C2E", trapframe); + */ + i = SIGPROT; + addr = trapframe->pc; + break; + +#else case T_C2E: case T_C2E + T_USER: goto err; break; +#endif case T_COP_UNUSABLE: cop = (trapframe->cause & MIPS_CR_COP_ERR) >> MIPS_CR_COP_ERR_SHIFT; #if defined(CPU_CHERI) && defined(DDB) ==== //depot/projects/ctsrd/cheribsd/src/sys/sys/signal.h#3 (text+ko) ==== @@ -112,6 +112,7 @@ #define SIGTHR 32 /* reserved by thread library. */ #define SIGLWP SIGTHR #define SIGLIBRT 33 /* reserved by real-time library. */ +#define SIGPROT 34 /* in-address space security exception. */ #endif #define SIGRTMIN 65
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211051301.qA5D1x9R002107>