linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Cox <alan@linux.intel.com>
To: AKASHI Takahiro <takahiro.akashi@linaro.org>, mcgrof@kernel.org
Cc: rusty@rustcorp.com.au, dhowells@redhat.com,
	ming.lei@canonical.com, seth.forshee@canonical.com,
	kyle@kernel.org, David.Woodhouse@intel.com,
	linux-kernel@vger.kernel.org,
	"Luis R . Rodriguez" <mcgrof@suse.com>
Subject: Re: [PATCH 1/4] firmware: add firmware signing
Date: Tue, 30 May 2017 17:07:17 +0100	[thread overview]
Message-ID: <1496160437.5682.6.camel@linux.intel.com> (raw)
In-Reply-To: <20170526030609.1414-2-takahiro.akashi@linaro.org>

On Fri, 2017-05-26 at 12:06 +0900, AKASHI Takahiro wrote:
> There is one driver data option, DRIVER_DATA_REQ_NO_SIG_CHECK,
> which will skip signature verification check at load time
> even in enforcing mode.
> This option is solely for non security-sensitive data.

It's also for firmware that is already signed and checked by the
hardware. In the x86 world almost all modern era firmware is already
signed and the signature checked by the device.

> +static ssize_t firmware_sig_data_write(struct file *filp, struct
> kobject *kobj,
> +				       struct bin_attribute
> *bin_attr,
> +				       char *buffer, loff_t offset,
> +				       size_t count)
> +{
> +	struct device *dev = kobj_to_dev(kobj);
> +	struct firmware_priv *fw_priv = to_firmware_priv(dev);
> +	struct firmware_buf *buf;
> +	void *buf_tmp;
> +	size_t new_size;
> +	ssize_t ret_count;
> +
> +	if (!capable(CAP_SYS_RAWIO))
> +		return -EPERM;
> +
> +	mutex_lock(&fw_lock);
> +	buf = fw_priv->buf;
> +	if (!buf || fw_state_is_done(&buf->fw_st)) {
> +		ret_count = -ENODEV;
> +		goto out;
> +	}
> +
> +	if (buf->sig_data && (offset + count > buf->sig_size)) {

If I do a ridiculously long amount of I/O what stops offset + count
overflowing ? It's no big deal as its CAP_SYS_RAWIO anyway but I'm just
wondering if there is a test missing ?

Alan

  reply	other threads:[~2017-05-30 16:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26  3:06 [PATCH 0/4] firmware: signature verification AKASHI Takahiro
2017-05-26  3:06 ` [PATCH 1/4] firmware: add firmware signing AKASHI Takahiro
2017-05-30 16:07   ` Alan Cox [this message]
2017-05-26  3:06 ` [PATCH 2/4] scripts: sign-file: add firmware-signing option AKASHI Takahiro
2017-05-26  3:06 ` [PATCH 3/4] test: firmwware: add signature test to driver_data loader test AKASHI Takahiro
2017-05-26  3:06 ` [PATCH 4/4] firmware: document signature verification for driver data AKASHI Takahiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1496160437.5682.6.camel@linux.intel.com \
    --to=alan@linux.intel.com \
    --cc=David.Woodhouse@intel.com \
    --cc=dhowells@redhat.com \
    --cc=kyle@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mcgrof@suse.com \
    --cc=ming.lei@canonical.com \
    --cc=rusty@rustcorp.com.au \
    --cc=seth.forshee@canonical.com \
    --cc=takahiro.akashi@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).