]> git.baikalelectronics.ru Git - kernel.git/commit
Crypto: chelsio - Fixes a deadlock between rtnl_lock and uld_mutex
authorAyush Sawal <ayush.sawal@chelsio.com>
Mon, 30 Mar 2020 15:18:53 +0000 (20:48 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Mar 2020 17:33:23 +0000 (10:33 -0700)
commit366e80449b2b9fdf2e939b089d0fc660dadbb25c
tree6b20e71ed01973d862ba4d8b862b5b993645530f
parentec4816b997e324c5383970dc50b4e80612f9f9f0
Crypto: chelsio - Fixes a deadlock between rtnl_lock and uld_mutex

The locks are taken in this order during driver registration
(uld_mutex), at: cxgb4_register_uld.part.14+0x49/0xd60 [cxgb4]
(rtnl_mutex), at: rtnetlink_rcv_msg+0x2db/0x400
(uld_mutex), at: cxgb_up+0x3a/0x7b0 [cxgb4]
(rtnl_mutex), at: chcr_add_xfrmops+0x83/0xa0 [chcr](stucked here)

To avoid this now the netdev features are updated after the
cxgb4_register_uld function is completed.

Fixes: 4da17e8044ed4 ("chcr: Add support for Inline IPSec").
Signed-off-by: Ayush Sawal <ayush.sawal@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/crypto/chelsio/chcr_core.c
drivers/crypto/chelsio/chcr_ipsec.c