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: <CANq1E4RA33bqBUi=27mOX4Wh03k5suNQpgQAFjX68rW-EuVXHg@mail.gmail.com>
Date:	Wed, 22 Apr 2015 19:35:11 +0200
From:	David Herrmann <dh.herrmann@...il.com>
To:	Dan Carpenter <dan.carpenter@...cle.com>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Daniel Mack <daniel@...que.org>,
	David Herrmann <dh.herrmann@...glemail.com>,
	Djalal Harouni <tixxdz@...ndz.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: Re: [patch] kdbus: checking for IS_ERR() instead of NULL

Hi

On Wed, Apr 22, 2015 at 3:39 PM, Dan Carpenter <dan.carpenter@...cle.com> wrote:
> "e->user" is never assigned an ERR_PTR().  It can be set to NULL so I
> assume that is what is intended here.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
>
> diff --git a/ipc/kdbus/queue.c b/ipc/kdbus/queue.c
> index a449464..21fce62 100644
> --- a/ipc/kdbus/queue.c
> +++ b/ipc/kdbus/queue.c
> @@ -637,7 +637,7 @@ int kdbus_queue_entry_move(struct kdbus_queue_entry *e,
>         lockdep_assert_held(&src->lock);
>         lockdep_assert_held(&dst->lock);
>
> -       if (WARN_ON(IS_ERR(e->user)) || WARN_ON(list_empty(&e->entry)))
> +       if (WARN_ON(!e->user) || WARN_ON(list_empty(&e->entry)))

e->user is allowed to be NULL (eg., for kernel notifications). We used
to set it to ERR_PTR(foobar), but that's long gone. This WARN_ON() can
simply be dropped.

I wrote a patch [1] and will send it to Greg later.

Thanks
David

[1] http://cgit.freedesktop.org/~dvdhrm/linux/commit/?h=kdbus&id=eb132dd85d4e882a9b3ad07497b26d1b55cab893

>                 return -EINVAL;
>         if (src == dst)
>                 return 0;
--
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