Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751576AbdIJMRc (ORCPT ); Sun, 10 Sep 2017 08:17:32 -0400 Received: from imap.thunk.org ([74.207.234.97]:48228 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751451AbdIJMRa (ORCPT ); Sun, 10 Sep 2017 08:17:30 -0400 Date: Sun, 10 Sep 2017 08:17:19 -0400 From: "Theodore Ts'o" To: Mimi Zohar Cc: James Morris , Linus Torvalds , Linux Kernel Mailing List , LSM List , Christoph Hellwig Subject: Re: [GIT PULL] Security subsystem updates for 4.14 Message-ID: <20170910121719.lurdadausg5bbqkd@thunk.org> Mail-Followup-To: Theodore Ts'o , Mimi Zohar , James Morris , Linus Torvalds , Linux Kernel Mailing List , LSM List , Christoph Hellwig References: <20170908223806.7yv6eohtsispwgas@thunk.org> <1505027603.3224.56.camel@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1505027603.3224.56.camel@linux.vnet.ibm.com> User-Agent: NeoMutt/20170609 (1.8.3) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1713 Lines: 36 On Sun, Sep 10, 2017 at 03:13:23AM -0400, Mimi Zohar wrote: > > From a file integrity perspective this would be interesting, but that > only addresses IMA-appraisal, not IMA-integrity or IMA-audit. ?We > would still need to calculate the file hash to be included in the > measurement list and used for auditing. > > Have you done any work on protecting the directory information itself > (eg. file names) using Merkle trees? I have not, because the problem that I was trying to address was primarily concerned with immutable files. I did do some brainstorming about adding the filename into the data integrity header to prevent someone who had direct access to the flash exchanging the inode numbers for "rm" and "ls", such that if you had a policy which required that all ELF executables be signed, that a trickster couldn't cause the user to run "rm" when they meant to run, say, "ls", just for the lulz. :-) But that would break various symlink or hardlinks that are legitimately present (e.g., /sbin/mkfs.ext[234] being a link to /sbin/mke2fs), and if the adversary can carry out a chip-off attack against your root file system, (a) it's not clear how much this would help, and (b) this is really what dm-verity is for. The main security problem I was looking at is one where the system image is already protected using dm-verity, but you might have (for example) some APK files which are downloaded once and stored in some shared-user directory hierarchy (so file-based encryption can't even provide pretend integrity protection), integrity checked at download time, and never checked again. Adding some kind of per-file Merkle tree might be useful in that particular use case. Cheers, - Ted