From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:48626 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932352AbcLVA5h (ORCPT ); Wed, 21 Dec 2016 19:57:37 -0500 Date: Thu, 22 Dec 2016 00:57:25 +0000 From: Al Viro To: =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= Cc: Casey Schaufler , linux-kernel@vger.kernel.org, Andreas Gruenbacher , Andy Lutomirski , Dmitry Kasatkin , Eric Paris , James Morris , John Johansen , Kees Cook , Kentaro Takeda , Mimi Zohar , Paul Moore , "Serge E . Hallyn" , Stephen Smalley , Tetsuo Handa , Vivek Goyal , linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH v1] security: Add a new hook: inode_touch_atime Message-ID: <20161222005725.GE1555@ZenIV.linux.org.uk> References: <20161221231506.19800-1-mic@digikod.net> <585B17E3.5040809@digikod.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <585B17E3.5040809@digikod.net> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Dec 22, 2016 at 01:01:39AM +0100, Micka�l Sala�n wrote: > SELinux should be interested. This is useful to create sandboxes so > other LSM may be interested too > > I'm working on a new LSM and I would like this kind of hook to create a > real read-only environment. What the...? Have you noticed if (!sb_start_write_trylock(inode->i_sb)) return; if (__mnt_want_write(mnt) != 0) goto skip_update; in touch_atime()? Just mount them read-only in your sandbox (on either level - both per-mountpoint and per-fs r/o will do) and be done with that; why bother with LSM when regular tools would suffice?