Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757254AbdIHWiT (ORCPT ); Fri, 8 Sep 2017 18:38:19 -0400 Received: from imap.thunk.org ([74.207.234.97]:43918 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757089AbdIHWiQ (ORCPT ); Fri, 8 Sep 2017 18:38:16 -0400 Date: Fri, 8 Sep 2017 18:38:06 -0400 From: "Theodore Ts'o" To: James Morris Cc: Linus Torvalds , Linux Kernel Mailing List , LSM List , Mimi Zohar , Christoph Hellwig Subject: Re: [GIT PULL] Security subsystem updates for 4.14 Message-ID: <20170908223806.7yv6eohtsispwgas@thunk.org> Mail-Followup-To: Theodore Ts'o , James Morris , Linus Torvalds , Linux Kernel Mailing List , LSM List , Mimi Zohar , Christoph Hellwig References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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: 1608 Lines: 33 On Fri, Sep 08, 2017 at 02:48:51PM +1000, James Morris wrote: > > Mimi and Christoph worked together on this over several iterations -- I'll > let them respond. Mimi --- we should chat next week in LA. I've been working on a design internally at work which proposes a generic VFS-layer library (ala how fscrypt in fs/crypto works) which provides data integrity using per-file Merkle trees. The goals of this design: * Simplicity; for ease in security review and upstream review and acceptance * Useful for multiple use cases. It is *not* Android/APK specific, and indeed can be used for other things * A better way of providing Linux IMA/EVM support for immutable files by moving the verification from time-of-open to time-of-readpage. (This significantly reduces the performance impact, since we don't need to lock down the file while the kernel needs to run SHA1 on potentially gigabytes worth of file data.) * Most use cases for file-level checksums are for files that don’t change over time (e.g., for Video, Audio, Backup files, etc.) This allows us to provide a cheap and efficient way to provide checksum protect against storage-level corruption fairly easily. So by supporting both SHA and CRC-32, we can make this feature useful for more than just the security heads. :-) * Like the encryption/fscrypt feature, most of the code to this feature can be in a VFS-level library, with minimal hooks needed to those file systems (ext4, f2fs) that wish to provide this functionality. - Ted