Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752035AbdFNOKp convert rfc822-to-8bit (ORCPT ); Wed, 14 Jun 2017 10:10:45 -0400 Received: from www.llwyncelyn.cymru ([82.70.14.225]:36838 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751928AbdFNOKn (ORCPT ); Wed, 14 Jun 2017 10:10:43 -0400 Date: Wed, 14 Jun 2017 15:10:08 +0100 From: Alan Cox To: Mimi Zohar Cc: =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= , Tetsuo Handa , keescook@chromium.org, matt@nmatt.com, jason@perfinion.com, linux-security-module@vger.kernel.org, Daniel Micay , kernel-hardening , LKML Subject: Re: [PATCH v1] shebang: restrict python interactive prompt/interpreter Message-ID: <20170614151008.42bc57a2@alans-desktop> In-Reply-To: <1497277644.21594.319.camel@linux.vnet.ibm.com> References: <201706100041.GFH78616.OFtOHFJSLQOMVF@I-love.SAKURA.ne.jp> <754b78d1-f7f9-58bd-bf74-fea9e105649a@nmatt.com> <20170609164315.GA1141@meriadoc.perfinion.com> <201706101427.EEG90168.OtFFHSFMOVOJQL@I-love.SAKURA.ne.jp> <1497234757.21594.280.camel@linux.vnet.ibm.com> <1497277644.21594.319.camel@linux.vnet.ibm.com> Organization: Intel Corporation X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1207 Lines: 26 On Mon, 12 Jun 2017 10:27:24 -0400 Mimi Zohar wrote: > On Sun, 2017-06-11 at 22:32 -0400, Mimi Zohar wrote: > > On Sun, 2017-06-11 at 13:44 +0200, Mickaël Salaün wrote: > > > > Using filesystem xattr seems like a good idea for this kind of > > > exceptions and instead of a hardcoded interpreter path. Something like > > > "security.tpe.interpreter=1|2" (bitmask for interpreter-only and/or CLI) > > > and "security.tpe.environment=HOME,LOGNAME" would be quite flexible to > > > configure a security policy for some binaries. This could also be > > > protected by IMA/EVM, if needed. > > > > Checking for the existence of an xattr without caching is relatively > > slow.  I'm not sure that we would want to go this route. >   > For identifying interpreters, xattrs would be too slow (without > caching results), but once identified, using xattrs as you suggested, > for specifying how interpreters can be invoked and limiting > environment variables, is a good idea.  Perhaps the two xattrs could > be combined? It's not just #! you need to cover. If I can run ld.so for my arch format then ld.so will helpfully let me load any ELF binary I like and run it. Alan