[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200117.020410.706060911554362881.davem@davemloft.net>
Date: Fri, 17 Jan 2020 02:04:10 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: xiyou.wangcong@...il.com
Cc: netdev@...r.kernel.org,
syzbot+4ec99438ed7450da6272@...kaller.appspotmail.com,
ap420073@...il.com
Subject: Re: [Patch net] net: avoid updating qdisc_xmit_lock_key in
netdev_update_lockdep_key()
From: Cong Wang <xiyou.wangcong@...il.com>
Date: Wed, 15 Jan 2020 13:02:38 -0800
> syzbot reported some bogus lockdep warnings, for example bad unlock
> balance in sch_direct_xmit(). They are due to a race condition between
> slow path and fast path, that is qdisc_xmit_lock_key gets re-registered
> in netdev_update_lockdep_key() on slow path, while we could still
> acquire the queue->_xmit_lock on fast path in this small window:
>
> CPU A CPU B
> __netif_tx_lock();
> lockdep_unregister_key(qdisc_xmit_lock_key);
> __netif_tx_unlock();
> lockdep_register_key(qdisc_xmit_lock_key);
>
> In fact, unlike the addr_list_lock which has to be reordered when
> the master/slave device relationship changes, queue->_xmit_lock is
> only acquired on fast path and only when NETIF_F_LLTX is not set,
> so there is likely no nested locking for it.
>
> Therefore, we can just get rid of re-registration of
> qdisc_xmit_lock_key.
>
> Reported-by: syzbot+4ec99438ed7450da6272@...kaller.appspotmail.com
> Fixes: ab92d68fc22f ("net: core: add generic lockdep keys")
> Cc: Taehee Yoo <ap420073@...il.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
Applied and queued up for -stable, thanks.
Powered by blists - more mailing lists