summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSu Yanjun <suyj.fnst@cn.fujitsu.com>2019-03-07 02:54:08 +0100
committerSteffen Klassert <steffen.klassert@secunet.com>2019-03-08 13:17:31 +0100
commitf10e0010fae8174dc20bdc872bcaa85baa925cb7 (patch)
treee8280e2b40b5c8647e7cea9d12f5c1ce260c6572 /include
parentxfrm: Reset secpath in xfrm failure (diff)
downloadlinux-f10e0010fae8174dc20bdc872bcaa85baa925cb7.tar.xz
linux-f10e0010fae8174dc20bdc872bcaa85baa925cb7.zip
net: xfrm: Add '_rcu' tag for rcu protected pointer in netns_xfrm
For rcu protected pointers, we'd better add '__rcu' for them. Once added '__rcu' tag for rcu protected pointer, the sparse tool reports warnings. net/xfrm/xfrm_user.c:1198:39: sparse: expected struct sock *sk net/xfrm/xfrm_user.c:1198:39: sparse: got struct sock [noderef] <asn:4> *nlsk [...] So introduce a new wrapper function of nlmsg_unicast to handle type conversions. This patch also fixes a direct access of a rcu protected socket. Fixes: be33690d8fcf("[XFRM]: Fix aevent related crash") Signed-off-by: Su Yanjun <suyj.fnst@cn.fujitsu.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/netns/xfrm.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h
index 59f45b1e9dac..d2a36fb9f92a 100644
--- a/include/net/netns/xfrm.h
+++ b/include/net/netns/xfrm.h
@@ -57,7 +57,7 @@ struct netns_xfrm {
struct list_head inexact_bins;
- struct sock *nlsk;
+ struct sock __rcu *nlsk;
struct sock *nlsk_stash;
u32 sysctl_aevent_etime;