From: Daniel Borkmann <dborkman@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, Changli Gao <xiaosuo@gmail.com>
Subject: Re: [PATCH net 2/2] net: dev_queue_xmit_nit: fix potential NULL ptr dereference
Date: Tue, 08 Jan 2013 20:38:43 +0100 [thread overview]
Message-ID: <50EC75C3.9000103@redhat.com> (raw)
In-Reply-To: <1357672943.18156.328.camel@edumazet-glaptop>
On 01/08/2013 08:22 PM, Eric Dumazet wrote:
> On Tue, 2013-01-08 at 19:51 +0100, Daniel Borkmann wrote:
>> Commit 71d9dec24dce548bf699815c976cf063ad9257e2 (``net: increase
>> skb->users instead of skb_clone()'') introduced a skb_clone in
>> dev_queue_xmit_nit that, when NULL, leaves the loop, but can still
>> be injected into pt_prev->func().
>>
>> Cc: Changli Gao <xiaosuo@gmail.com>
>> Cc: Eric Dumazet <eric.dumazet@gmail.com>
>> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
>> ---
>> net/core/dev.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index 723dcd0..6c35c33 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -1827,7 +1827,7 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
>> pt_prev = ptype;
>> }
>> }
>> - if (pt_prev)
>> + if (skb2 && pt_prev)
>> pt_prev->func(skb2, skb->dev, pt_prev, skb->dev);
>> rcu_read_unlock();
>> }
>
> My opinion is this patch is not needed.
>
> pt_prev can be set only if skb2 is not NULL
Agreed, I missed that, thanks.
prev parent reply other threads:[~2013-01-08 19:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-08 18:51 [PATCH net 0/2] net: dev_queue_xmit_nit fixes Daniel Borkmann
2013-01-08 18:51 ` [PATCH net 1/2] net: dev_queue_xmit_nit: fix skb->vlan_tci field value Daniel Borkmann
2013-01-08 19:54 ` Ani Sinha
2013-01-08 20:04 ` Eric Dumazet
2013-01-08 20:22 ` Jiri Pirko
2013-01-08 20:42 ` Eric Dumazet
2013-01-08 20:14 ` Jiri Pirko
2013-01-08 18:51 ` [PATCH net 2/2] net: dev_queue_xmit_nit: fix potential NULL ptr dereference Daniel Borkmann
2013-01-08 19:22 ` Eric Dumazet
2013-01-08 19:38 ` Daniel Borkmann [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=50EC75C3.9000103@redhat.com \
--to=dborkman@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=xiaosuo@gmail.com \
/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.