lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <s5hegy4555h.wl%tiwai@suse.de>
Date:	Wed, 02 Jul 2014 14:14:34 +0200
From:	Takashi Iwai <tiwai@...e.de>
To:	Ming Lei <ming.lei@...onical.com>
Cc:	"Luis R. Rodriguez" <mcgrof@...not-panic.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	"Luis R. Rodriguez" <mcgrof@...e.com>, Tom Gundersen <teg@...m.no>,
	Abhay Salunke <Abhay_Salunke@...l.com>,
	Stefan Roese <sr@...x.de>, Arnd Bergmann <arnd@...db.de>,
	Kay Sievers <kay@...y.org>
Subject: Re: [PATCH v2] firmware loader: inform direct failure when udev loader is disabled

At Wed, 2 Jul 2014 19:21:07 +0800,
Ming Lei wrote:
> 
> On Wed, Jul 2, 2014 at 7:01 PM, Takashi Iwai <tiwai@...e.de> wrote:
> > At Tue,  1 Jul 2014 20:07:53 -0700,
> > Luis R. Rodriguez wrote:
> >>
> >> From: "Luis R. Rodriguez" <mcgrof@...e.com>
> >>
> >> Now that the udev firmware loader is optional request_firmware()
> >> will not provide any information on the kernel ring buffer if
> >> direct firmware loading failed and udev firmware loading is disabled.
> >> If no information is needed request_firmware_direct() should be used
> >> for optional firmware, at which point drivers can take on the onus
> >> over informing of any failures, if udev firmware loading is disabled
> >> though we should at the very least provide some sort of information
> >> as when the udev loader was enabled by default back in the days.
> >>
> >> With this change with a simple firmware load test module [0]:
> >>
> >> Example output without FW_LOADER_USER_HELPER_FALLBACK
> >>
> >> platform fake-dev.0: Direct firmware load for fake.bin failed
> >> with error -2
> >>
> >> Example with FW_LOADER_USER_HELPER_FALLBACK
> >>
> >> platform fake-dev.0: Direct firmware load for fake.bin failed with error -2
> >> platform fake-dev.0: Falling back to user helper
> >>
> >> Without this change without FW_LOADER_USER_HELPER_FALLBACK we
> >> get no output logged upon failure.
> >>
> >> Cc: Tom Gundersen <teg@...m.no>
> >> Cc: Ming Lei <ming.lei@...onical.com>
> >> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> >> Cc: Abhay Salunke <Abhay_Salunke@...l.com>
> >> Cc: Stefan Roese <sr@...x.de>
> >> Cc: Arnd Bergmann <arnd@...db.de>
> >> Cc: Kay Sievers <kay@...y.org>
> >> Cc: Takashi Iwai <tiwai@...e.de>
> >> Signed-off-by: Luis R. Rodriguez <mcgrof@...e.com>
> >> ---
> >>
> >> This v2 modifies the error to always be called and only in the
> >> request_firmware_direct case do we not send smoke signals.
> >>
> >>  drivers/base/firmware_class.c | 13 +++++++------
> >>  include/linux/firmware.h      | 15 ++++++++-------
> >>  2 files changed, 15 insertions(+), 13 deletions(-)
> >>
> >> diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
> >> index 46ea5f4..60d0e53 100644
> >> --- a/drivers/base/firmware_class.c
> >> +++ b/drivers/base/firmware_class.c
> >> @@ -109,6 +109,7 @@ static inline long firmware_loading_timeout(void)
> >>  #else
> >>  #define FW_OPT_FALLBACK              0
> >>  #endif
> >> +#define FW_OPT_DIRECT_ONLY (1U << 3)
> >
> > I'd name it like FW_OPT_NO_WARN or such.
> > Other than that, looks good to me.
> 
> IMO, DIRECT_ONLY is better because it can be
> extend to other usages in future.

Well, do we need any more extension to this function?  I thought we're
going rather to remove *_direct().

If we need any more extension, a better way would be to expose the bit
flag directly as __request_firmware() instead of hacking more on
*_direct() or introduce more variants.  Then the existing
request_firmware() and request_firmware_direct() can be static
inline.

In anyway, the flag should indicate each functionality, and if the
current purpose is to suppress warning, it should be named so.


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ