Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: ying.xue@windriver.com
Cc: netdev@vger.kernel.org, jon.maloy@ericsson.com,
	syzkaller-bugs@googlegroups.com,
	tipc-discussion@lists.sourceforge.net
Subject: Re: [PATCH net] tipc: fix missing rtnl lock protection during setting link properties
Date: Thu, 04 Jan 2018 10:22:04 -0500 (EST)	[thread overview]
Message-ID: <20180104.102204.2173725641982775376.davem@davemloft.net> (raw)
In-Reply-To: <b6ec84e9-b791-c953-a61b-edc125a81add@windriver.com>

From: Ying Xue <ying.xue@windriver.com>
Date: Thu, 4 Jan 2018 15:30:52 +0800

> On 01/03/2018 11:48 PM, David Miller wrote:
>> As soon as you drop the RTNL lock, the media or bearer entry can be
>> removed from the tables.
>> 
> 
> Thanks for the review. Yes, you are right. But even if we temporarily
> release RTNL lock, it's still safe for us because when we set
> media/bearer properties in __tipc_nl_compat_doit(), tipc_nl_media_set()
> and tipc_nl_bearer_set() will probe media or bearer again within RTNL
> lock protection.
> 
>> This invalidates what you do next, whether it's
>> tipc_nl_compat_media_set(), tipc_nl_compat_bearer_set(), etc.
> 
> In fact tipc_nl_compat_media_set() and tipc_nl_compat_bearer_set() don't
> really change media or bearer's properties, instead they only format the
> contents pointed by their "msg" parameter.

However, those values are only valid to place into the netlink message if
in fact we successfully found a media or bearer entry.

You have to hold RTNL across this whole construct, from the discovery of
the media or bearer entry all the way to the completion of filling in
the netlink message, one way or another.

      reply	other threads:[~2018-01-04 15:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-01 10:24 [PATCH net] tipc: fix missing rtnl lock protection during setting link properties Ying Xue
2018-01-03 15:48 ` David Miller
2018-01-04  7:30   ` Ying Xue
2018-01-04 15:22     ` David Miller [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=20180104.102204.2173725641982775376.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jon.maloy@ericsson.com \
    --cc=netdev@vger.kernel.org \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=ying.xue@windriver.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