From: Jason Wang <jasowang@redhat.com>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, eric dumazet <eric.dumazet@gmail.com>,
xiyou wangcong <xiyou.wangcong@gmail.com>,
weiyongjun1@huawei.com
Subject: Re: [PATCH v3] tun: fix use-after-free when register netdev failed
Date: Tue, 10 Sep 2019 10:36:30 +0800 [thread overview]
Message-ID: <f42d04fb-ac3e-8429-461c-f9b238d438b5@redhat.com> (raw)
In-Reply-To: <5D770AF6.1060902@huawei.com>
On 2019/9/10 上午10:31, Yang Yingliang wrote:
>>>
>>> if (!(tun->flags & IFF_PERSIST) &&
>>> - tun->dev->reg_state == NETREG_REGISTERED)
>>> + tun->dev->reg_state == NETREG_REGISTERED) {
>>> + tun->flags &= ~TUN_DEV_REGISTERED;
>>
>> As I said for previous versions. It's not good that try to invent new
>> internal state like this, and you need carefully to deal with the
>> synchronization, it could be lock or barriers. Consider the
>> synchronization of tun is already complex, let's better try to avoid
>> adding more but using exist mechanism, e.g pointer publishing through
>> RCU.
> OK, need I post a V4 by using the diff file you sent ?
Yes, please.
Thanks
prev parent reply other threads:[~2019-09-10 2:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-19 13:31 [PATCH v3] tun: fix use-after-free when register netdev failed Yang Yingliang
2019-08-20 1:25 ` David Miller
2019-08-20 2:28 ` Jason Wang
2019-08-22 2:13 ` Jason Wang
2019-08-22 6:07 ` Yang Yingliang
2019-08-22 12:55 ` Yang Yingliang
2019-08-23 3:05 ` Jason Wang
2019-08-23 9:36 ` Yang Yingliang
2019-09-02 5:32 ` Jason Wang
2019-09-03 1:45 ` Yang Yingliang
2019-09-03 3:03 ` Jason Wang
2019-09-03 5:42 ` Yang Yingliang
2019-09-03 6:06 ` Jason Wang
2019-09-03 7:35 ` Yang Yingliang
2019-09-03 10:50 ` Jason Wang
2019-09-05 2:03 ` Yang Yingliang
2019-09-05 3:10 ` Jason Wang
2019-09-10 2:31 ` Yang Yingliang
2019-09-10 2:36 ` 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=f42d04fb-ac3e-8429-461c-f9b238d438b5@redhat.com \
--to=jasowang@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=weiyongjun1@huawei.com \
--cc=xiyou.wangcong@gmail.com \
--cc=yangyingliang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).