From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:60724 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751074AbdKMXzu (ORCPT ); Mon, 13 Nov 2017 18:55:50 -0500 Date: Tue, 14 Nov 2017 00:55:46 +0100 From: "Luis R. Rodriguez" To: "Luis R. Rodriguez" Cc: Mimi Zohar , David Howells , linux-integrity , linux-fsdevel , linux-kernel , Andy Lutomirski , James Bottomley , David Woodhouse , Kyle McMartin , Ben Hutchings , Alan Cox , Greg Kroah-Hartman , Linus Torvalds , Kees Cook , "AKASHI, Takahiro" Subject: Re: [RFC PATCH v2] fw_lockdown: new micro LSM module to prevent loading unsigned firmware Message-ID: <20171113235546.GG22894@wotan.suse.de> References: <1510573414.3404.109.camel@linux.vnet.ibm.com> <20171113190505.GC22894@wotan.suse.de> <1510601807.3711.16.camel@linux.vnet.ibm.com> <20171113195154.GE22894@wotan.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171113195154.GE22894@wotan.suse.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Nov 13, 2017 at 08:51:54PM +0100, Luis R. Rodriguez wrote: > On Mon, Nov 13, 2017 at 02:36:47PM -0500, Mimi Zohar wrote: > > On Mon, 2017-11-13 at 20:05 +0100, Luis R. Rodriguez wrote: > > > > + * fw_lockdown_read_file - prevent loading of unsigned firmware > > > > + * @file: pointer to firmware > > > > + * @read_id: caller identifier > > > > + * > > > > + * Prevent loading of unsigned firmware in lockdown mode. > > > > + */ > > > > +static int fw_lockdown_read_file(struct file *file, enum kernel_read_file_id id) > > > > +{ > > > > + if (id == READING_FIRMWARE) { > > > > + if (!is_ima_appraise_enabled() && > > > > + kernel_is_locked_down("Loading of unsigned firmware")) > > > > + return -EACCES; > > > > + } We also have READING_FIRMWARE_PREALLOC_BUFFER now. So the above is missing a check for that as well. Luis