Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751788AbdFINpB (ORCPT ); Fri, 9 Jun 2017 09:45:01 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40790 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751738AbdFINo7 (ORCPT ); Fri, 9 Jun 2017 09:44:59 -0400 Subject: Re: [kernel-hardening] Re: [PATCH v2 1/1] Add Trusted Path Execution as a stackable LSM From: Mimi Zohar To: Matt Brown , Kees Cook Cc: James Morris , "Serge E. Hallyn" , LKML , linux-security-module , "kernel-hardening@lists.openwall.com" Date: Fri, 09 Jun 2017 09:44:38 -0400 In-Reply-To: References: <20170608034349.31876-1-matt@nmatt.com> <20170608034349.31876-2-matt@nmatt.com> <94ba5ebb-952b-2037-799e-07306629a6f9@nmatt.com> <1497003507.21594.177.camel@linux.vnet.ibm.com> <1497014192.21594.185.camel@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-MML: disable x-cbid: 17060913-1617-0000-0000-000001E30908 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17060913-1618-0000-0000-000048292E4B Message-Id: <1497015878.21594.201.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-06-09_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1706090241 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2045 Lines: 48 On Fri, 2017-06-09 at 09:18 -0400, Matt Brown wrote: > On 6/9/17 9:16 AM, Mimi Zohar wrote: > > On Fri, 2017-06-09 at 05:55 -0700, Kees Cook wrote: > >> On Fri, Jun 9, 2017 at 3:18 AM, Mimi Zohar wrote: > >>> On Thu, 2017-06-08 at 23:50 -0400, Matt Brown wrote: > >>>>>> > >>>>>> * Issues: > >>>>>> * Can be bypassed by interpreted languages such as python. You can run > >>>>>> malicious code by doing: python -c 'evil code' > >>>>> > >>>>> What's the recommendation for people interested in using TPE but > >>>>> having interpreters installed? > >>>>> > >>>> > >>>> If you don't need a given interpreter installed, uninstall it. While > >>>> this is common sense system hardening it especially would make a > >>>> difference under the TPE threat model. > >>>> > >>>> I don't have a knock down answer for this. Interpreters are a hard > >>>> problem for TPE. > >>> > >>> You might be interested in the minor LSM named "shebang", that I > >>> posted as a proof of concept back in January, which restricts the > >>> python interactive prompt/interpreter, but allows the scripts > >>> themselves to be executed. > >> > >> https://patchwork.kernel.org/patch/9547405/ > >> > >> Maybe these could be merged and the interpreter string could be made > >> into a configurable list? > > > > I updated shebang, but didn't bother to post it, as nobody seemed to > > be interested at the time. The updated version already has support > > for the configurable list. Re-posting ... > > > > That would be awesome. I think it's the perfect complement to TPE as it > protects a key hole in its current threat model. Hm, I hadn't looked at it in since January.  It still needs to be cleaned up and expanded a bit.  The original version used a pathname for identifying the interpreter.  This version converts the list of pathnames to a set of inodes, which is better, but now requires a method for updating the inode number after a software update. Please feel free to expand on it or re-use whatever you like. Mimi