All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@suse.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: Shuah Khan <shuahkh@osg.samsung.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ming Lei <ming.lei@canonical.com>,
	Kees Cook <keescook@chromium.org>,
	linux-kernel@vger.kernel.org, linux-api@vger.kernel.org
Subject: Re: [PATCH v2 4/5] firmware: actually return NULL on failed request_firmware_nowait()
Date: Mon, 21 Dec 2015 20:06:10 +0100	[thread overview]
Message-ID: <20151221190609.GP20409@wotan.suse.de> (raw)
In-Reply-To: <1449701429-121423-4-git-send-email-computersforpeace@gmail.com>

On Wed, Dec 09, 2015 at 02:50:28PM -0800, Brian Norris wrote:
> The kerneldoc for request_firmware_nowait() says that it may call the
> provided cont() callback with @fw == NULL, if the firmware request
> fails. However, this is not the case when called with an empty string
> (""). This case is short-circuited by the 'name[0] == '\0'' check
> introduced in commit 471b095dfe0d ("firmware_class: make sure fw requests
> contain a name"), so _request_firmware() never gets to set the fw to
> NULL.
> 
> Noticed while using the new 'trigger_async_request' testing hook:

<-- snip -->

> 
>     # printf '\x00' > /sys/devices/virtual/misc/test_firmware/trigger_async_request
>     [   32.126322] test_firmware: loading ''
>     [   32.129995] test_firmware: failed to async load firmware
>     -bash: printf: write error: No such device
> 
> Fixes: 471b095dfe0d ("firmware_class: make sure fw requests contain a name")
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> Acked-by: Ming Lei <ming.lei@canonical.com>
> Acked-by: Kees Cook <keescook@chromium.org>

Acked-by: Luis R. Rodriguez <mcgrof@suse.com>

  Luis

  reply	other threads:[~2015-12-21 19:06 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-09 22:50 [PATCH v2 1/5] test: firmware_class: report errors properly on failure Brian Norris
2015-12-09 22:50 ` Brian Norris
2015-12-09 22:50 ` [PATCH v2 2/5] test: firmware_class: use kstrndup() where appropriate Brian Norris
2015-12-09 22:50   ` Brian Norris
2016-01-07 20:55   ` Shuah Khan
2016-01-07 20:55     ` Shuah Khan
2015-12-09 22:50 ` [PATCH v2 3/5] test: firmware_class: add asynchronous request trigger Brian Norris
2015-12-09 22:50   ` Brian Norris
2015-12-09 23:22   ` Kees Cook
2015-12-09 23:22     ` Kees Cook
2016-01-07 20:56   ` Shuah Khan
2015-12-09 22:50 ` [PATCH v2 4/5] firmware: actually return NULL on failed request_firmware_nowait() Brian Norris
2015-12-09 22:50   ` Brian Norris
2015-12-21 19:06   ` Luis R. Rodriguez [this message]
2016-01-07 20:56   ` Shuah Khan
2016-01-07 20:56     ` Shuah Khan
2015-12-09 22:50 ` [PATCH v2 5/5] selftests: firmware: add empty string and async tests Brian Norris
2015-12-09 22:50   ` Brian Norris
2016-01-07 20:57   ` Shuah Khan
2016-01-07 20:57     ` Shuah Khan
2016-01-07 21:39     ` Brian Norris
2016-01-07 21:39       ` Brian Norris
2016-01-07 21:42       ` Shuah Khan
2016-01-07 21:42         ` Shuah Khan
2016-01-07 20:54 ` [PATCH v2 1/5] test: firmware_class: report errors properly on failure Shuah Khan
2016-01-07 20:54   ` Shuah Khan

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=20151221190609.GP20409@wotan.suse.de \
    --to=mcgrof@suse.com \
    --cc=computersforpeace@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@canonical.com \
    --cc=shuahkh@osg.samsung.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.