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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACVXFVO_bbYsRRgZ+MfVKf5=VRNy=O3VUg0mh2fumEi7cObuiw@mail.gmail.com>
Date:	Mon, 21 Oct 2013 20:24:15 +0800
From:	Ming Lei <ming.lei@...onical.com>
To:	Prarit Bhargava <prarit@...hat.com>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	x86@...nel.org, herrmann.der.user@...glemail.com,
	tigran@...azian.fsnet.co.uk
Subject: Re: [PATCH 1/2] firmware, fix request_firmware_nowait() freeze with
 no uevent

On Mon, Oct 21, 2013 at 5:35 AM, Prarit Bhargava <prarit@...hat.com> wrote:
> If request_firmware_nowait() is called with uevent == NULL, the firmware
> completion is never marked complete resulting in a hang in the process.
>
> If uevent is undefined, that means we're not waiting on anything and the
> process should just clean up and complete.  While we're at it, add a
> debug dev_dbg() to indicate that the FW has not been found.
>
> Signed-off-by: Prarit Bhargava <prarit@...hat.com>
> Cc: x86@...nel.org
> Cc: herrmann.der.user@...glemail.com
> Cc: ming.lei@...onical.com
> Cc: tigran@...azian.fsnet.co.uk
> ---
>  drivers/base/firmware_class.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
> index 10a4467..95778dc 100644
> --- a/drivers/base/firmware_class.c
> +++ b/drivers/base/firmware_class.c
> @@ -335,7 +335,8 @@ static bool fw_get_filesystem_firmware(struct device *device,
>                 set_bit(FW_STATUS_DONE, &buf->status);
>                 complete_all(&buf->completion);
>                 mutex_unlock(&fw_lock);
> -       }
> +       } else
> +               dev_dbg(device, "firmware: %s not found\n", buf->fw_id);
>
>         return success;
>  }
> @@ -886,6 +887,9 @@ static int _request_firmware_load(struct firmware_priv *fw_priv, bool uevent,
>                         schedule_delayed_work(&fw_priv->timeout_work, timeout);
>
>                 kobject_uevent(&fw_priv->dev.kobj, KOBJ_ADD);
> +       } else {
> +               /* if there is no uevent then just cleanup */
> +               schedule_delayed_work(&fw_priv->timeout_work, 0);
>         }

This may not a good idea and might break current NOHOTPLUG
users, and how can you make sure the user space application can
complete the request during the timeout time?

Thanks,
--
Ming Lei
--
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