From nobody Thu Nov 11 13:57:00 2021 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 406C8185C212 for ; Thu, 11 Nov 2021 13:57:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqjvJ1Cqbz4kWp for ; Thu, 11 Nov 2021 13:57:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0032551BC for ; Thu, 11 Nov 2021 13:57:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 1ABDuxFD042045 for ; Thu, 11 Nov 2021 13:56:59 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 1ABDuxCZ042044 for bugs@FreeBSD.org; Thu, 11 Nov 2021 13:56:59 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 259778] Capsicum failures can raise only SIGTRAP Date: Thu, 11 Nov 2021 13:57:00 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: theraven@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259778 Bug ID: 259778 Summary: Capsicum failures can raise only SIGTRAP Product: Base System Version: 13.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: theraven@FreeBSD.org @emaste added a debugging mechanism using `procctl` that allows Capsicum failures to raise SIGTRAP. I am currently using this mechanism to provide a fallback mechanism that does an RPC to a privileged process, allowing me to= run unmodified libraries in a sandbox. Unfortunately, SIGTRAP is caught by debuggers and not delivered to my proce= ss when it is being debugged. The analogous Linux mechanism in seccomp-bpf delivers SIGSYS, which is a lot more useful in this context. I would like to extend this mechanism to be able to deliver SIGSYS but befo= re I do I wanted to open this bug to provide a space for some discussion. I see= two possible implementation choices: - Allow the user to specify the signal that's raised. - Provide an option to raise SIGSYS instead of SIGTRAP. The former requires adding an extra field to `struct prot`, the latter could just consume an extra one of `p2_flags`, which would be easier to MFC. My leaning is towards the second (it requires less kernel state, is a smaller diff, and Linux doesn't give you any choice of signal), but if there's valu= e in the more general mechanism then I can do that instead. If I go with the first mechanism, there's a question of what to do if both states are set. The simplest choice is to make them mutually exclusive (so setting `PROC_SIGCAP_CTL` [or whatever a more sensible name for it is] would clear `PROC_TRAPCAP_CTL` and vice versa). I can see it possibly being usef= ul to enable both, so the debugger gets a signal and then the process gets a usefully catchable signal, in which case they'd need to be delivered in that order. --=20 You are receiving this mail because: You are the assignee for the bug.=