mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 07:22:34 +00:00
commit 6c04bb18dd (netlink: use call_rcu for netlink_change_ngroups)
used a somewhat convoluted and racy way to perform call_rcu().
The old block of memory is freed after a grace period, but the rcu_head
used to track it is located in new block.
This can clash if we call two times or more netlink_change_ngroups(),
and a block is freed before another. call_rcu() called on different cpus
makes no guarantee in order of callbacks.
Fix this using a more standard way of handling this : Each block of
memory contains its own rcu_head, so that no 'use after free' can
happens.
Signed-off-by: Eric Dumazet <[email protected]>
CC: Johannes Berg <[email protected]>
CC: Paul E. McKenney <[email protected]>
Signed-off-by: David S. Miller <[email protected]>