]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipv4: fix infinite loop on secondary addr promotion
authorFlorian Westphal <fw@strlen.de>
Thu, 27 Jun 2019 12:03:32 +0000 (14:03 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Jun 2019 16:54:34 +0000 (09:54 -0700)
commitf14c9a9cd3cea23bfc90115f803b69e7d865fdcd
tree57b256e5356e97686e4c57fad2236b0f947c187e
parent5286d4f7bf57b82a2f0e55fb22c5737bd9732221
net: ipv4: fix infinite loop on secondary addr promotion

secondary address promotion causes infinite loop -- it arranges
for ifa->ifa_next to point back to itself.

Problem is that 'prev_prom' and 'last_prim' might point at the same entry,
so 'last_sec' pointer must be obtained after prev_prom->next update.

Fixes: a062ebaf8b1c ("net: ipv4: provide __rcu annotation for ifa_list")
Reported-by: Ran Rozenstein <ranro@mellanox.com>
Reported-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/devinet.c