Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00269b54 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

ipv4: Add a missing rcu_assign_pointer() in routing cache.



rt_intern_hash() is doing an update of a RCU guarded hash chain
without using rcu_assign_pointer() or equivalent barrier.

Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dc976c09
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1109,7 +1109,12 @@ static int rt_intern_hash(unsigned hash, struct rtable *rt, struct rtable **rp)
		printk("\n");
	}
#endif
	rt_hash_table[hash].chain = rt;
	/*
	 * Since lookup is lockfree, we must make sure
	 * previous writes to rt are comitted to memory
	 * before making rt visible to other CPUS.
	 */
	rcu_assign_pointer(rt_hash_table[hash].chain, rt);
	spin_unlock_bh(rt_hash_lock_addr(hash));
	*rp = rt;
	return 0;