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: <20200206201827.GP2514@yoga>
Date:   Thu, 6 Feb 2020 12:18:27 -0800
From:   Bjorn Andersson <bjorn.andersson@...aro.org>
To:     Nikita Shubin <NShubin@...con.com>
Cc:     Ohad Ben-Cohen <ohad@...ery.com>, linux-remoteproc@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] remoteproc: warn on kick missing

On Wed 05 Feb 21:54 PST 2020, Nikita Shubin wrote:

> .kick method not set in rproc_ops will result in:
> 
> 8<--- cut here ---
> Unable to handle kernel NULL pointer dereference
> 
> in rproc_virtio_notify, after firmware loading.
> 
> At least a warning needed on attempt to call missing method.

Is this not a fatal error only happening during development? In which
case the NULL pointer dereference will come with an oops with sufficient
information to pinpoint what's going on?

Regards,
Bjorn

> 
> Signed-off-by: Nikita Shubin <NShubin@...con.com>
> ---
>  drivers/remoteproc/remoteproc_virtio.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c
> index 8c07cb2ca8ba..77a81f331e3f 100644
> --- a/drivers/remoteproc/remoteproc_virtio.c
> +++ b/drivers/remoteproc/remoteproc_virtio.c
> @@ -32,6 +32,12 @@ static bool rproc_virtio_notify(struct virtqueue *vq)
> 
>         dev_dbg(&rproc->dev, "kicking vq index: %d\n", notifyid);
> 
> +       if (unlikely(rproc->ops->kick == NULL)) {
> +               WARN_ONCE(rproc->ops->kick == NULL, ".kick method not defined for %s",
> +                       rproc->name);
> +               return false;
> +       }
> +
>         rproc->ops->kick(rproc, notifyid);
>         return true;
>  }
> --
> 2.24.1
> 
> Confidentiality Notice: This message (including attachments) is a private communication solely for use of the intended recipient(s). If you are not the intended recipient(s) or believe you received this message in error, notify the sender immediately and then delete this message. Any other use, retention, dissemination or copying is prohibited and may be a violation of law, including the Electronic Communication Privacy Act of 1986.   ??

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ