Skip to content
Commit f10e0010 authored by Su Yanjun's avatar Su Yanjun Committed by Steffen Klassert
Browse files

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: be33690d("[XFRM]: Fix aevent related crash")
Signed-off-by: default avatarSu Yanjun <suyj.fnst@cn.fujitsu.com>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent 6ed69184
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment