[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6736928.QjjYfqFu7x@prime>
Date: Mon, 26 Mar 2018 14:57:02 +0200
From: Simon Wunderlich <sw@...onwunderlich.de>
To: Colin King <colin.king@...onical.com>,
"David S . Miller" <davem@...emloft.net>
Cc: Marek Lindner <mareklindner@...mailbox.ch>,
Antonio Quartulli <a@...table.cc>,
b.a.t.m.a.n@...ts.open-mesh.org, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] batman-adv: don't pass a NULL hard_iface to batadv_hardif_put
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@...onwunderlich.de>
Acked-by: Sven Eckelmann <sven@...fation.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@...onical.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@...onical.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;
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists