Commit 4bd366ce authored by David S. Miller's avatar David S. Miller

Merge branch 'net-ipv4-remove-erroneous-advancement-of-list-pointer'

Florian Westphal says:

====================
net: ipv4: remove erroneous advancement of list pointer

Tariq reported a soft lockup on net-next that Mellanox was able to
bisect to 2638eb8b ("net: ipv4: provide __rcu annotation for ifa_list").

While reviewing above patch I found a regression when addresses have a
lifetime specified.

Second patch extends rtnetlink.sh to trigger crash
(without first patch applied).
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 78fe8a28 3cfa1488
...@@ -745,8 +745,7 @@ static void check_lifetime(struct work_struct *work) ...@@ -745,8 +745,7 @@ static void check_lifetime(struct work_struct *work)
ifap = &ifa->ifa_dev->ifa_list; ifap = &ifa->ifa_dev->ifa_list;
tmp = rtnl_dereference(*ifap); tmp = rtnl_dereference(*ifap);
while (tmp) { while (tmp) {
tmp = rtnl_dereference(tmp->ifa_next); if (tmp == ifa) {
if (rtnl_dereference(*ifap) == ifa) {
inet_del_ifa(ifa->ifa_dev, inet_del_ifa(ifa->ifa_dev,
ifap, 1); ifap, 1);
break; break;
......
...@@ -249,6 +249,26 @@ kci_test_route_get() ...@@ -249,6 +249,26 @@ kci_test_route_get()
echo "PASS: route get" echo "PASS: route get"
} }
kci_test_addrlft()
{
for i in $(seq 10 100) ;do
lft=$(((RANDOM%3) + 1))
ip addr add 10.23.11.$i/32 dev "$devdummy" preferred_lft $lft valid_lft $((lft+1))
check_err $?
done
sleep 5
ip addr show dev "$devdummy" | grep "10.23.11."
if [ $? -eq 0 ]; then
echo "FAIL: preferred_lft addresses remaining"
check_err 1
return
fi
echo "PASS: preferred_lft addresses have expired"
}
kci_test_addrlabel() kci_test_addrlabel()
{ {
ret=0 ret=0
...@@ -1140,6 +1160,7 @@ kci_test_rtnl() ...@@ -1140,6 +1160,7 @@ kci_test_rtnl()
kci_test_polrouting kci_test_polrouting
kci_test_route_get kci_test_route_get
kci_test_addrlft
kci_test_tc kci_test_tc
kci_test_gre kci_test_gre
kci_test_gretap kci_test_gretap
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment