Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964879Ab2KWHeK (ORCPT ); Fri, 23 Nov 2012 02:34:10 -0500 Received: from cantor2.suse.de ([195.135.220.15]:58111 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964780Ab2KWHeI (ORCPT ); Fri, 23 Nov 2012 02:34:08 -0500 Date: Fri, 23 Nov 2012 08:34:05 +0100 Message-ID: From: Takashi Iwai To: joeyli Cc: Matthew Garrett , Alan Cox , Jiri Kosina , David Howells , Rusty Russell , Ming Lei , linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-efi@vger.kernel.org Subject: Re: [PATCH RFC v2 3/4] firmware: Add support for signature checks In-Reply-To: <1353653771.21227.741.camel@linux-s257.site> References: <1352396109-3989-1-git-send-email-tiwai@suse.de> <1352396109-3989-4-git-send-email-tiwai@suse.de> <1353653771.21227.741.camel@linux-s257.site> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1219 Lines: 38 At Fri, 23 Nov 2012 14:56:11 +0800, joeyli wrote: > > 於 四,2012-11-08 於 18:35 +0100,Takashi Iwai 提到: > > +#ifdef CONFIG_FIRMWARE_SIG > > +static int verify_sig_file(struct firmware_buf *buf, const char > > *path) > > +{ > > + const unsigned long markerlen = sizeof(FIRMWARE_SIG_STRING) - > > 1; > > + struct file *file; > > + void *sig_data; > > + size_t sig_size; > > + int ret; > > + > > + file = filp_open(path, O_RDONLY, 0); > > + if (IS_ERR(file)) > > + return -ENOKEY; > > I think there should return '-ENOENT', otherwise the firmware will show > 'Invalid firmware signature' even didn't find the sig file. Actually this is the intentional behavior. In the secure boot mode, unsigned firmware should be rejected. In the normal boot mode, the -ENOKEY error is ignored. (Whether we should taint the kernel with such an unsigned firmware is a bit different question, though.) thanks, Takashi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/