diff options
author | John Johansen <john.johansen@canonical.com> | 2017-08-16 12:33:48 -0400 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2017-09-22 16:00:58 -0400 |
commit | bc4d82fb946e7b471eab2a80e384227c4eb15652 (patch) | |
tree | 6a22655d27fa6875d3146b4be3b08b737b6fa5c8 | |
parent | 15372b97aa7593c6f5bc1afe69f42fd403c40685 (diff) |
apparmor: fix incorrect type assignment when freeing proxies
sparse reports
poisoning the proxy->label before freeing the struct is resulting in
a sparse build warning.
../security/apparmor/label.c:52:30: warning: incorrect type in assignment (different address spaces)
../security/apparmor/label.c:52:30: expected struct aa_label [noderef] <asn:4>*label
../security/apparmor/label.c:52:30: got struct aa_label *<noident>
fix with RCU_INIT_POINTER as this is one of those cases where
rcu_assign_pointer() is not needed.
Signed-off-by: John Johansen <john.johansen@canonical.com>
-rw-r--r-- | security/apparmor/label.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/apparmor/label.c b/security/apparmor/label.c index 52b4ef14840d..c5b99b954580 100644 --- a/security/apparmor/label.c +++ b/security/apparmor/label.c | |||
@@ -49,7 +49,7 @@ static void free_proxy(struct aa_proxy *proxy) | |||
49 | /* p->label will not updated any more as p is dead */ | 49 | /* p->label will not updated any more as p is dead */ |
50 | aa_put_label(rcu_dereference_protected(proxy->label, true)); | 50 | aa_put_label(rcu_dereference_protected(proxy->label, true)); |
51 | memset(proxy, 0, sizeof(*proxy)); | 51 | memset(proxy, 0, sizeof(*proxy)); |
52 | proxy->label = (struct aa_label *) PROXY_POISON; | 52 | RCU_INIT_POINTER(proxy->label, (struct aa_label *)PROXY_POISON); |
53 | kfree(proxy); | 53 | kfree(proxy); |
54 | } | 54 | } |
55 | } | 55 | } |