From MAILER-DAEMON Sat Jul 28 14:46:59 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SvC2V-0004sU-Ao
	for mharc-plash@gnu.org; Sat, 28 Jul 2012 14:46:59 -0400
Received: from eggs.gnu.org ([208.118.235.92]:38885)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <talex5@gmail.com>) id 1SvC2T-0004sO-My
	for plash@nongnu.org; Sat, 28 Jul 2012 14:46:58 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <talex5@gmail.com>) id 1SvC2R-00026r-N3
	for plash@nongnu.org; Sat, 28 Jul 2012 14:46:57 -0400
Received: from mail-ob0-f173.google.com ([209.85.214.173]:44124)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <talex5@gmail.com>) id 1SvC2R-000262-I0
	for plash@nongnu.org; Sat, 28 Jul 2012 14:46:55 -0400
Received: by obbta14 with SMTP id ta14so5902334obb.4
	for <plash@nongnu.org>; Sat, 28 Jul 2012 11:46:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=SKq9U8B121tTXHj+5jQXsBzrYDvv2skhbQhjXA1Ht4s=;
	b=MfGC5C8zb2MQwEw47Ala0CIz0HHb7rL2Wzi3XIMl5cAEwryRdcczBcZXwzDNpN3pNa
	KBSMrVtE8KptWsXJq14Sx3QSURYtIiA/GjGRELGyEXnGGC4eIT4fToty05AYhhL9S7ll
	dMQpUWSHWrdwUfgFOO4r5DidW4aoWDhMKnhhLPEr22uNSA35g1lPue2t17fmv4LZQMEW
	jBGCnx2l7vu1H3DLBZQ+J9oCXE98u+cXctNDUeGcet+O5qHQ3xuicF0lkhI4g8jpWxHm
	OKw9N79VnEsZUC0xXvNHFK4pNrXX49SJ4dVejnttdX2u4IPmWe5u3s4YMBEVFNWSm71K
	0m1A==
MIME-Version: 1.0
Received: by 10.50.195.194 with SMTP id ig2mr7671228igc.0.1343501214173; Sat,
	28 Jul 2012 11:46:54 -0700 (PDT)
Received: by 10.64.41.226 with HTTP; Sat, 28 Jul 2012 11:46:54 -0700 (PDT)
In-Reply-To: <AANLkTi=sT0Pe_FJCN-uE=r2+9UpjeSTEvuAjcgcgAdJu@mail.gmail.com>
References: <cd53a0140611191240y1652e632l34c125466a218951@mail.gmail.com>
	<AANLkTi=sT0Pe_FJCN-uE=r2+9UpjeSTEvuAjcgcgAdJu@mail.gmail.com>
Date: Sat, 28 Jul 2012 19:46:54 +0100
Message-ID: <CAG4opy-CfuD-Uxqswb-sQojoML7LYUWTn_70ZM7vUP2BsUTSEA@mail.gmail.com>
From: Thomas Leonard <talex5@gmail.com>
To: plash@nongnu.org
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.214.173
Subject: Re: [Plash] Sending signals to sandboxed processes
X-BeenThere: plash@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Plash \(the Principle of Least Authority Shell\)" <plash.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/plash>,
	<mailto:plash-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/plash>
List-Post: <mailto:plash@nongnu.org>
List-Help: <mailto:plash-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/plash>,
	<mailto:plash-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 28 Jul 2012 18:46:58 -0000

On 13 February 2011 16:19, Thomas Leonard <talex5@gmail.com> wrote:
> On 19 November 2006 20:40, Thomas Leonard <talex5@gmail.com> wrote:
>> Is there any way to send a signal (e.g. SIGTERM) to a plash process
>> from outside the sandbox?
>>
>> Sending signals via the tty (^C etc) works fine, but sending using
>> kill(2) doesn't seem to be possible (presumably because all the uids
>> are different).
>
> Would it be possible to use clone(2) with CLONE_NEWPID to get this behaviour?
>
> Then the sandboxed processes would run with the same UID as the user,
> but they can only send signals within the sandbox because PIDs are
> unique to the sandbox. e.g. within the sandbox, the top-level process
> is PID 1. Outside of the sandbox, it has a different PID and can be
> killed by the user with no special privileges. This also allows
> processes to see a restricted view of /proc.

I see Linux 3.5 now lets processes restrict which system calls they can make:

"Seccomp-based system call filtering"

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/prctl/seccomp_filter.txt;hb=HEAD

Could this remove the need to run sandboxed processes as a different
user? If so, killing would work, fchmod would work, and we wouldn't
need the SUID helper either...


-- 
Dr Thomas Leonard        http://0install.net/
GPG: 9242 9807 C985 3C07 44A6  8B9A AE07 8280 59A5 3CC1
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA


