From: Jason Wang <jasowang@redhat.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Christian Borntraeger <borntraeger@de.ibm.com>
Subject: Re: [REGRESSION] 362899b ("macvtap: switch to use skb array") causes oops during teardown
Date: Thu, 11 Aug 2016 16:58:44 +0800 [thread overview]
Message-ID: <55867d3a-7668-7a77-ea51-3de76b1b6bda@redhat.com> (raw)
In-Reply-To: <20160811101320.20f03b17.cornelia.huck@de.ibm.com>
On 2016年08月11日 16:13, Cornelia Huck wrote:
> On Thu, 11 Aug 2016 15:49:12 +0800
> Jason Wang <jasowang@redhat.com> wrote:
>
>> This looks like a use-after-free. Could you pls try the following patch
>> to see it if fixes your issue?
>>
>> diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
>> index a38c0da..070e329 100644
>> --- a/drivers/net/macvtap.c
>> +++ b/drivers/net/macvtap.c
>> @@ -275,7 +275,6 @@ static void macvtap_put_queue(struct macvtap_queue *q)
>> rtnl_unlock();
>>
>> synchronize_rcu();
>> - skb_array_cleanup(&q->skb_array);
>> sock_put(&q->sk);
>> }
>>
>> @@ -533,10 +532,8 @@ static void macvtap_sock_write_space(struct sock *sk)
>> static void macvtap_sock_destruct(struct sock *sk)
>> {
>> struct macvtap_queue *q = container_of(sk, struct
>> macvtap_queue, sk);
>> - struct sk_buff *skb;
>>
>> - while ((skb = skb_array_consume(&q->skb_array)) != NULL)
>> - kfree_skb(skb);
>> + skb_array_cleanup(&q->skb_array);
>> }
>>
>> static int macvtap_open(struct inode *inode, struct file *file)
> Yes, that change fixes things for me.
>
> Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
>
> Thanks for the quick reply!
>
Thanks for the testing.
Will send a formal patch shortly.
prev parent reply other threads:[~2016-08-11 8:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-10 16:40 Cornelia Huck
2016-08-11 7:49 ` Jason Wang
2016-08-11 8:13 ` Cornelia Huck
2016-08-11 8:58 ` Jason Wang [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=55867d3a-7668-7a77-ea51-3de76b1b6bda@redhat.com \
--to=jasowang@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®