All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Wunderlich <sw@simonwunderlich.de>
To: Colin King <colin.king@canonical.com>,
	"David S . Miller" <davem@davemloft.net>
Cc: Marek Lindner <mareklindner@neomailbox.ch>,
	Antonio Quartulli <a@unstable.cc>,
	b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [B.A.T.M.A.N.] [PATCH][next] batman-adv: don't pass a NULL hard_iface to batadv_hardif_put
Date: Mon, 26 Mar 2018 14:57:02 +0200	[thread overview]
Message-ID: <6736928.QjjYfqFu7x@prime> (raw)
In-Reply-To: <20180323225350.7350-1-colin.king@canonical.com>

[-- Attachment #1: Type: text/plain, Size: 1381 bytes --]

Hi,

this looks good. David, would you pick this patch directly? Otherwise, I can 
send a pull request, but right now we would only have this single patch for 
net-next.

Acked-by: Simon Wunderlich <sw@simonwunderlich.de>
Acked-by: Sven Eckelmann <sven@narfation.org>

(just discussed with Sven offline)

Thank you,
     Simon

On Friday, March 23, 2018 10:53:50 PM CEST Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> In the case where hard_iface is NULL, the error path may pass a null
> pointer to batadv_hardif_put causing a null pointer dereference error.
> Avoid this by only calling the function if  hard_iface not null.
> 
> Detected by CoverityScan, CID#1466456 ("Explicit null dereferenced")
> 
> Fixes: 53dd9a68ba68 ("batman-adv: add multicast flags netlink support")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  net/batman-adv/multicast.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
> index de3a055f7dd8..bd0ea374d043 100644
> --- a/net/batman-adv/multicast.c
> +++ b/net/batman-adv/multicast.c
> @@ -1536,7 +1536,7 @@ batadv_mcast_netlink_get_primary(struct
> netlink_callback *cb,
> 
>  	if (!ret && primary_if)
>  		*primary_if = hard_iface;
> -	else
> +	else if (hard_iface)
>  		batadv_hardif_put(hard_iface);
> 
>  	return ret;


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Simon Wunderlich <sw@simonwunderlich.de>
To: Colin King <colin.king@canonical.com>,
	"David S . Miller" <davem@davemloft.net>
Cc: Marek Lindner <mareklindner@neomailbox.ch>,
	Antonio Quartulli <a@unstable.cc>,
	b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] batman-adv: don't pass a NULL hard_iface to batadv_hardif_put
Date: Mon, 26 Mar 2018 12:57:02 +0000	[thread overview]
Message-ID: <6736928.QjjYfqFu7x@prime> (raw)
In-Reply-To: <20180323225350.7350-1-colin.king@canonical.com>

[-- Attachment #1: Type: text/plain, Size: 1381 bytes --]

Hi,

this looks good. David, would you pick this patch directly? Otherwise, I can 
send a pull request, but right now we would only have this single patch for 
net-next.

Acked-by: Simon Wunderlich <sw@simonwunderlich.de>
Acked-by: Sven Eckelmann <sven@narfation.org>

(just discussed with Sven offline)

Thank you,
     Simon

On Friday, March 23, 2018 10:53:50 PM CEST Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> In the case where hard_iface is NULL, the error path may pass a null
> pointer to batadv_hardif_put causing a null pointer dereference error.
> Avoid this by only calling the function if  hard_iface not null.
> 
> Detected by CoverityScan, CID#1466456 ("Explicit null dereferenced")
> 
> Fixes: 53dd9a68ba68 ("batman-adv: add multicast flags netlink support")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  net/batman-adv/multicast.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
> index de3a055f7dd8..bd0ea374d043 100644
> --- a/net/batman-adv/multicast.c
> +++ b/net/batman-adv/multicast.c
> @@ -1536,7 +1536,7 @@ batadv_mcast_netlink_get_primary(struct
> netlink_callback *cb,
> 
>  	if (!ret && primary_if)
>  		*primary_if = hard_iface;
> -	else
> +	else if (hard_iface)
>  		batadv_hardif_put(hard_iface);
> 
>  	return ret;


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Simon Wunderlich <sw@simonwunderlich.de>
To: Colin King <colin.king@canonical.com>,
	"David S . Miller" <davem@davemloft.net>
Cc: Marek Lindner <mareklindner@neomailbox.ch>,
	Antonio Quartulli <a@unstable.cc>,
	b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] batman-adv: don't pass a NULL hard_iface to batadv_hardif_put
Date: Mon, 26 Mar 2018 14:57:02 +0200	[thread overview]
Message-ID: <6736928.QjjYfqFu7x@prime> (raw)
In-Reply-To: <20180323225350.7350-1-colin.king@canonical.com>

[-- Attachment #1: Type: text/plain, Size: 1381 bytes --]

Hi,

this looks good. David, would you pick this patch directly? Otherwise, I can 
send a pull request, but right now we would only have this single patch for 
net-next.

Acked-by: Simon Wunderlich <sw@simonwunderlich.de>
Acked-by: Sven Eckelmann <sven@narfation.org>

(just discussed with Sven offline)

Thank you,
     Simon

On Friday, March 23, 2018 10:53:50 PM CEST Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> In the case where hard_iface is NULL, the error path may pass a null
> pointer to batadv_hardif_put causing a null pointer dereference error.
> Avoid this by only calling the function if  hard_iface not null.
> 
> Detected by CoverityScan, CID#1466456 ("Explicit null dereferenced")
> 
> Fixes: 53dd9a68ba68 ("batman-adv: add multicast flags netlink support")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  net/batman-adv/multicast.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
> index de3a055f7dd8..bd0ea374d043 100644
> --- a/net/batman-adv/multicast.c
> +++ b/net/batman-adv/multicast.c
> @@ -1536,7 +1536,7 @@ batadv_mcast_netlink_get_primary(struct
> netlink_callback *cb,
> 
>  	if (!ret && primary_if)
>  		*primary_if = hard_iface;
> -	else
> +	else if (hard_iface)
>  		batadv_hardif_put(hard_iface);
> 
>  	return ret;


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Simon Wunderlich <sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX@public.gmane.org>
To: Colin King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>,
	"David S . Miller"
	<davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: Marek Lindner
	<mareklindner-rVWd3aGhH2z5bpWLKbzFeg@public.gmane.org>,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Antonio Quartulli <a@unstable.cc>,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r@public.gmane.org,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH][next] batman-adv: don't pass a NULL hard_iface to batadv_hardif_put
Date: Mon, 26 Mar 2018 14:57:02 +0200	[thread overview]
Message-ID: <6736928.QjjYfqFu7x@prime> (raw)
In-Reply-To: <20180323225350.7350-1-colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1490 bytes --]

Hi,

this looks good. David, would you pick this patch directly? Otherwise, I can 
send a pull request, but right now we would only have this single patch for 
net-next.

Acked-by: Simon Wunderlich <sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX@public.gmane.org>
Acked-by: Sven Eckelmann <sven-KaDOiPu9UxWEi8DpZVb4nw@public.gmane.org>

(just discussed with Sven offline)

Thank you,
     Simon

On Friday, March 23, 2018 10:53:50 PM CEST Colin King wrote:
> From: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
> 
> In the case where hard_iface is NULL, the error path may pass a null
> pointer to batadv_hardif_put causing a null pointer dereference error.
> Avoid this by only calling the function if  hard_iface not null.
> 
> Detected by CoverityScan, CID#1466456 ("Explicit null dereferenced")
> 
> Fixes: 53dd9a68ba68 ("batman-adv: add multicast flags netlink support")
> Signed-off-by: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
> ---
>  net/batman-adv/multicast.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
> index de3a055f7dd8..bd0ea374d043 100644
> --- a/net/batman-adv/multicast.c
> +++ b/net/batman-adv/multicast.c
> @@ -1536,7 +1536,7 @@ batadv_mcast_netlink_get_primary(struct
> netlink_callback *cb,
> 
>  	if (!ret && primary_if)
>  		*primary_if = hard_iface;
> -	else
> +	else if (hard_iface)
>  		batadv_hardif_put(hard_iface);
> 
>  	return ret;


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2018-03-26 12:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 22:53 [B.A.T.M.A.N.] [PATCH][next] batman-adv: don't pass a NULL hard_iface to batadv_hardif_put Colin King
2018-03-23 22:53 ` Colin King
2018-03-23 22:53 ` Colin King
2018-03-24  9:36 ` [B.A.T.M.A.N.] " Sven Eckelmann
2018-03-24  9:36   ` Sven Eckelmann
2018-03-24  9:36   ` [B.A.T.M.A.N.] " Sven Eckelmann
2018-03-26 12:57 ` Simon Wunderlich [this message]
2018-03-26 12:57   ` Simon Wunderlich
2018-03-26 12:57   ` Simon Wunderlich
2018-03-26 12:57   ` Simon Wunderlich

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=6736928.QjjYfqFu7x@prime \
    --to=sw@simonwunderlich.de \
    --cc=a@unstable.cc \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=colin.king@canonical.com \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mareklindner@neomailbox.ch \
    --cc=netdev@vger.kernel.org \
    /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.