mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
net: Fix devinet_sysctl_forward
sysctls are unregistered with the rntl_lock held making it unsafe to unconditionally grab the the rtnl_lock. Instead we need to call rtnl_trylock and restart the system call if we can not grab it. Otherwise we could deadlock at unregistration time. Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5007392d85
commit
9b8adb5ea0
1 changed files with 2 additions and 1 deletions
|
@ -1347,7 +1347,8 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write,
|
|||
struct net *net = ctl->extra2;
|
||||
|
||||
if (valp != &IPV4_DEVCONF_DFLT(net, FORWARDING)) {
|
||||
rtnl_lock();
|
||||
if (!rtnl_trylock())
|
||||
return restart_syscall();
|
||||
if (valp == &IPV4_DEVCONF_ALL(net, FORWARDING)) {
|
||||
inet_forward_change(net);
|
||||
} else if (*valp) {
|
||||
|
|
Loading…
Reference in a new issue