From: Eric Dumazet <eric.dumazet@gmail.com>
To: Dan Carpenter <error27@gmail.com>
Cc: "John W. Linville" <linville@tuxdriver.com>,
Johannes Berg <johannes@sipsolutions.net>,
"David S. Miller" <davem@davemloft.net>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] mac80211: potential null dereference in mesh forwarding
Date: Mon, 03 Jan 2011 07:45:38 +0000 [thread overview]
Message-ID: <1294040738.2535.265.camel@edumazet-laptop> (raw)
In-Reply-To: <20110103054355.GP1886@bicker>
Le lundi 03 janvier 2011 à 08:43 +0300, Dan Carpenter a écrit :
> The printk() is supposed to be ratelimited but we should always goto out
> when fwd_skb is NULL. Otherwise it gets dereferenced on the next line.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index 5e9d3bc..dc8b566 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -1831,8 +1831,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
>
> fwd_skb = skb_copy(skb, GFP_ATOMIC);
>
> - if (!fwd_skb && net_ratelimit()) {
> - printk(KERN_DEBUG "%s: failed to clone mesh frame\n",
> + if (!fwd_skb) {
> + if (net_ratelimit())
> + printk(KERN_DEBUG "%s: failed to clone mesh frame\n",
> sdata->name);
> goto out;
> }
Already discovered/coped by Milton Miller.
prev parent reply other threads:[~2011-01-03 7:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-03 5:43 [patch] mac80211: potential null dereference in mesh forwarding Dan Carpenter
2011-01-03 7:45 ` Eric Dumazet [this message]
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=1294040738.2535.265.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=error27@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox