netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: liuhangbin@gmail.com
Cc: netdev@vger.kernel.org, jiri@resnulli.us, lucien.xin@gmail.com
Subject: Re: [PATCHv2 net] team: fix possible recursive locking when add slaves
Date: Fri, 19 Apr 2019 14:58:30 -0700 (PDT)	[thread overview]
Message-ID: <20190419.145830.716462456508554436.davem@davemloft.net> (raw)
In-Reply-To: <20190419063100.5224-1-liuhangbin@gmail.com>

From: Hangbin Liu <liuhangbin@gmail.com>
Date: Fri, 19 Apr 2019 14:31:00 +0800

> If we add a bond device which is already the master of the team interface,
> we will hold the team->lock in team_add_slave() first and then request the
> lock in team_set_mac_address() again. The functions are called like:
> 
> - team_add_slave()
>  - team_port_add()
>    - team_port_enter()
>      - team_modeop_port_enter()
>        - __set_port_dev_addr()
>          - dev_set_mac_address()
>            - bond_set_mac_address()
>              - dev_set_mac_address()
>   	       - team_set_mac_address
> 
> Although team_upper_dev_link() would check the upper devices but it is
> called too late. Fix it by adding a checking before processing the slave.
> 
> v2: Do not split the string in netdev_err()
> 
> Fixes: 3d249d4ca7d0 ("net: introduce ethernet teaming device")
> Acked-by: Jiri Pirko <jiri@mellanox.com>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Applied and queued up for -stable, thanks.

      reply	other threads:[~2019-04-19 21:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-17 12:12 [PATCH net] team: fix possible recursive locking when add slaves Hangbin Liu
2019-04-18 23:39 ` David Miller
2019-04-19  5:55 ` Jiri Pirko
2019-04-19  6:31 ` [PATCHv2 " Hangbin Liu
2019-04-19 21:58   ` 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=20190419.145830.716462456508554436.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jiri@resnulli.us \
    --cc=liuhangbin@gmail.com \
    --cc=lucien.xin@gmail.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;
as well as URLs for NNTP newsgroup(s).