summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-09-19 13:09:19 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2024-09-19 13:09:19 +0200
commit509d2cd12a10d057fdf72f565b930f9a81140d59 (patch)
tree67236041fd6b6d6d1a557a22a5af8d78f26d0522 /security
parentMerge tag 'i2c-for-6.11-final-but-missed-it' of git://git.kernel.org/pub/scm/... (diff)
parentsmackfs: Use rcu_assign_pointer() to ensure safe assignment in smk_set_cipso (diff)
downloadlinux-509d2cd12a10d057fdf72f565b930f9a81140d59.tar.xz
linux-509d2cd12a10d057fdf72f565b930f9a81140d59.zip
Merge tag 'Smack-for-6.12' of https://github.com/cschaufler/smack-next
Pull smack updates from Casey Schaufler: "Two patches: one is a simple indentation correction, the other corrects a potentially rcu unsafe pointer assignment" * tag 'Smack-for-6.12' of https://github.com/cschaufler/smack-next: smackfs: Use rcu_assign_pointer() to ensure safe assignment in smk_set_cipso security: smack: Fix indentation in smack_netfilter.c
Diffstat (limited to 'security')
-rw-r--r--security/smack/smack_netfilter.c4
-rw-r--r--security/smack/smackfs.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/security/smack/smack_netfilter.c b/security/smack/smack_netfilter.c
index bad71b7e648d..8fd747b3653a 100644
--- a/security/smack/smack_netfilter.c
+++ b/security/smack/smack_netfilter.c
@@ -19,8 +19,8 @@
#include "smack.h"
static unsigned int smack_ip_output(void *priv,
- struct sk_buff *skb,
- const struct nf_hook_state *state)
+ struct sk_buff *skb,
+ const struct nf_hook_state *state)
{
struct sock *sk = skb_to_full_sk(skb);
struct socket_smack *ssp;
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
index e22aad7604e8..5dd1e164f9b1 100644
--- a/security/smack/smackfs.c
+++ b/security/smack/smackfs.c
@@ -932,7 +932,7 @@ static ssize_t smk_set_cipso(struct file *file, const char __user *buf,
}
if (rc >= 0) {
old_cat = skp->smk_netlabel.attr.mls.cat;
- skp->smk_netlabel.attr.mls.cat = ncats.attr.mls.cat;
+ rcu_assign_pointer(skp->smk_netlabel.attr.mls.cat, ncats.attr.mls.cat);
skp->smk_netlabel.attr.mls.lvl = ncats.attr.mls.lvl;
synchronize_rcu();
netlbl_catmap_free(old_cat);