Return-path: Received: from lan.nucleusys.com ([92.247.61.126]:44034 "EHLO zztop.nucleusys.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751569AbbEURpR (ORCPT ); Thu, 21 May 2015 13:45:17 -0400 Date: Thu, 21 May 2015 20:44:55 +0300 From: Petko Manolov To: Andy Lutomirski Cc: David Howells , Mimi Zohar , Joey Lee , Rusty Russell , Kyle McMartin , Sedat Dilek , LSM List , Jiri Kosina , Konstantin Ryabitsev , Michal Marek , Seth Forshee , "Luis R. Rodriguez" , "linux-kernel@vger.kernel.org" , Borislav Petkov , David Woodhouse , Linux Wireless List , Linus Torvalds , Greg Kroah-Hartman , James Morris , keyrings@linux-nfs.org, Abelardo Ricart III , "Serge E. Hallyn" Subject: Re: [RFD] linux-firmware key arrangement for firmware signing Message-ID: <20150521174455.GL18164@localhost> (sfid-20150521_194539_664062_64466C8F) References: <20150519200232.GM23057@wotan.suse.de> <555BA438.2070802@kernel.org> <20150519221128.GP23057@wotan.suse.de> <9567.1432223509@warthog.procyon.org.uk> <20150521165101.GI18164@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: Sender: linux-wireless-owner@vger.kernel.org List-ID: On 15-05-21 09:55:42, Andy Lutomirski wrote: > > I read plenty of the code. I said "data" not "file" for a reason. > I'll quote some code: > > int ima_appraise_measurement(int func, struct integrity_iint_cache *iint, > struct file *file, const unsigned char *filename, > struct evm_ima_xattr_data *xattr_value, > int xattr_len, int opened) > > There is no struct file in init_module. > > { > static const char op[] = "appraise_data"; > char *cause = "unknown"; > struct dentry *dentry = file->f_path.dentry; > struct inode *inode = dentry->d_inode; > enum integrity_status status = INTEGRITY_UNKNOWN; > int rc = xattr_len, hash_start = 0; > > if (!inode->i_op->getxattr) > return INTEGRITY_UNKNOWN; Yes, not all filesystems support extended attributes, but this is not necessarily end of the game. IMA code may be modified to use detached signatures. In fact i was considering this option not so long ago, but dropped the idea as more elegant solution was presented. > I maintain my claim that IMA is not appropriate for module signing in general. > It might make sense for the kind of thing that Chromium does (approving of > modules using finit_module based on their source instead of their payload and > verifying the payload indirectly using IMA or dm-verity), but that's not the > problem that David and Luis are trying to solve. I guess this is all backwards. Module signing/verification must be autonomous process/infrastructure. The fact that IMA may do the same for you given a few conditions are met does not make it a replacement. I do not use module signing for one particular project, because we're building custom kernel and initramfs. IMA is enabled early on so an attempt to read .ko file results in verifying it's signature. Yes, the filesystem does support xattr. :) > Also, especially for firmware on regular distros, IMA is ridiculous. IIRC > there is no general support for xattrs in initramfs, and there is no reason to > start requiring such support just to allow firmware to live in initramfs. For regular distro, maybe. If one needs better overall security - not so - i actually quite like IMA. ;) Adding xattrs to initramfs is not bad idea at all, IMA arguments aside. > I think that using IMA for this has a similar problem to using PKCS#7: it's a > big hammer that is much more complex than necessary to solve the problem at > hand. Absolutely. Using IMA just for module signing is a bit of an overkill. Petko