diff options
author | Francesco Ruggeri <fruggeri@aristanetworks.com> | 2012-01-16 10:40:10 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-01-18 16:38:34 -0500 |
commit | 013d97e9da1877f1334aa8ff3a19921ebbfe99b5 (patch) | |
tree | ed05c2420ea75eb036507d556d46d713ebe3bd9a /fs/read_write.c | |
parent | 35d87e3325e91ec6bc446bf71f50eccc9a7b3b8f (diff) |
net: race condition in ipv6 forwarding and disable_ipv6 parameters
There is a race condition in addrconf_sysctl_forward() and
addrconf_sysctl_disable().
These functions change idev->cnf.forwarding (resp. idev->cnf.disable_ipv6)
and then try to grab the rtnl lock before performing any actions.
If that fails they restore the original value and restart the syscall.
This creates race conditions if ipv6 code tries to access
these parameters, or if multiple instances try to do the same operation.
As an example of the former, if __ipv6_ifa_notify() finds a 0 in
idev->cnf.forwarding when invoked by addrconf_ifdown() it may not free
anycast addresses, ultimately resulting in the net_device not being freed.
This patch reads the user parameters into a temporary location and only
writes the actual parameters when the rtnl lock is acquired.
Tested in 2.6.38.8.
Signed-off-by: Francesco Ruggeri <fruggeri@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/read_write.c')
0 files changed, 0 insertions, 0 deletions