Re: [PATCH RFC v2 3/4] firmware: Add support for signature checks

From: joeyli
Date: Fri Nov 23 2012 - 01:56:58 EST


æ åï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.

> +
> + ret = fw_read_file_contents(file, &sig_data, &sig_size);
> + fput(file);

Tested-by: Chun-Yi Lee <jlee@xxxxxxxx>

Thanks a lot!
Joey Lee

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/