]> Git Repo - linux.git/commit
net: disable netpoll on fresh napis
authorJakub Kicinski <[email protected]>
Wed, 26 Aug 2020 19:40:06 +0000 (12:40 -0700)
committerDavid S. Miller <[email protected]>
Wed, 26 Aug 2020 23:16:39 +0000 (16:16 -0700)
commit96e97bc07e90f175a8980a22827faf702ca4cb30
tree12b95b421bf2f7c68f77c5615c3857e9ceef0d63
parent7f6f32bb7d3355cd78ebf1dece9a6ea7a0ca8158
net: disable netpoll on fresh napis

napi_disable() makes sure to set the NAPI_STATE_NPSVC bit to prevent
netpoll from accessing rings before init is complete. However, the
same is not done for fresh napi instances in netif_napi_add(),
even though we expect NAPI instances to be added as disabled.

This causes crashes during driver reconfiguration (enabling XDP,
changing the channel count) - if there is any printk() after
netif_napi_add() but before napi_enable().

To ensure memory ordering is correct we need to use RCU accessors.

Reported-by: Rob Sherwood <[email protected]>
Fixes: 2d8bff12699a ("netpoll: Close race condition between poll_one_napi and napi_disable")
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/core/dev.c
net/core/netpoll.c
This page took 0.054984 seconds and 4 git commands to generate.