diff options
author | Michal Kubecek <mkubecek@suse.cz> | 2014-06-03 10:26:06 +0200 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-06-27 10:25:18 +0200 |
commit | 3f8fd8ad48b66a4fc44f60cde0ea575155a45eff (patch) | |
tree | ca791d2ea554ede59c52bf01259d6c873299bb21 /crypto/lz4hc.c | |
parent | 306ba5b24eab33ed30f13ff2005e021881b3d2bf (diff) |
xfrm: fix race between netns cleanup and state expire notification
commit 21ee543edc0dea36ab58d24523fcd42b8a270df8 upstream.
The xfrm_user module registers its pernet init/exit after xfrm
itself so that its net exit function xfrm_user_net_exit() is
executed before xfrm_net_exit() which calls xfrm_state_fini() to
cleanup the SA's (xfrm states). This opens a window between
zeroing net->xfrm.nlsk pointer and deleting all xfrm_state
instances which may access it (via the timer). If an xfrm state
expires in this window, xfrm_exp_state_notify() will pass null
pointer as socket to nlmsg_multicast().
As the notifications are called inside rcu_read_lock() block, it
is sufficient to retrieve the nlsk socket with rcu_dereference()
and check the it for null.
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'crypto/lz4hc.c')
0 files changed, 0 insertions, 0 deletions