Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753536Ab2KFHbA (ORCPT ); Tue, 6 Nov 2012 02:31:00 -0500 Received: from mail-ea0-f174.google.com ([209.85.215.174]:41381 "EHLO mail-ea0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752306Ab2KFHa6 (ORCPT ); Tue, 6 Nov 2012 02:30:58 -0500 MIME-Version: 1.0 In-Reply-To: References: <1348152065-31353-1-git-send-email-mjg@redhat.com> <20121029174131.GC7580@srcf.ucam.org> <20121031173728.GA18615@srcf.ucam.org> <1351743715.21227.95.camel@linux-s257.site> <20121101131849.752df6fd@pyramind.ukuu.org.uk> Date: Tue, 6 Nov 2012 15:30:57 +0800 Message-ID: Subject: Re: [PATCH RFC 0/4] Add firmware signature file check From: Ming Lei To: Li Joey Cc: Takashi Iwai , Matthew Garrett , Alan Cox , joeyli , Jiri Kosina , David Howells , Rusty Russell , linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-efi@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1098 Lines: 33 On Tue, Nov 6, 2012 at 1:36 PM, Li Joey wrote: > The udev direct write firmware through data attribute, maybe we can do the > same signature verification in firmware_data_write? The following patch > didn't test yet. > @@ -655,6 +656,23 @@ static ssize_t firmware_data_write(struct file *filp, > struct kobject *kobj, > } > > buf->size = max_t(size_t, offset, buf->size); > + > +#ifdef CONFIG_FIRMWARE_SIG > + for (i = 0; i < ARRAY_SIZE(fw_path); i++) { > + snprintf(path, PATH_MAX, "%s/%s.sig", fw_path[i], > buf->fw_id); > + if (verify_signature(buf, path)) > + success = true; > + } When direct loading failed, it means that the firmware isn't under the default search path, so the above verification might return false always. Thanks, -- Ming Lei -- 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/