aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2022-01-27 10:56:13 -0500
committerPaul Moore <paul@paul-moore.com>2022-02-01 19:08:28 -0500
commit0e326df069802dc48e4f095f889cb780e4beaba6 (patch)
treece81cfb714f72eb8081c13dfc5ebd60342cb5106 /security/selinux/hooks.c
parentselinux: try to use preparsed sid before calling parse_sid() (diff)
downloadlinux-dev-0e326df069802dc48e4f095f889cb780e4beaba6.tar.xz
linux-dev-0e326df069802dc48e4f095f889cb780e4beaba6.zip
selinux: various sparse fixes
When running the SELinux code through sparse, there are a handful of warnings. This patch resolves some of these warnings caused by "__rcu" mismatches. % make W=1 C=1 security/selinux/ Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index b60481192b38..b24a1aeeedd4 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2553,7 +2553,7 @@ static void selinux_bprm_committed_creds(struct linux_binprm *bprm)
if (rc) {
clear_itimer();
- spin_lock_irq(&current->sighand->siglock);
+ spin_lock_irq(&unrcu_pointer(current->sighand)->siglock);
if (!fatal_signal_pending(current)) {
flush_sigqueue(&current->pending);
flush_sigqueue(&current->signal->shared_pending);
@@ -2561,13 +2561,13 @@ static void selinux_bprm_committed_creds(struct linux_binprm *bprm)
sigemptyset(&current->blocked);
recalc_sigpending();
}
- spin_unlock_irq(&current->sighand->siglock);
+ spin_unlock_irq(&unrcu_pointer(current->sighand)->siglock);
}
/* Wake up the parent if it is waiting so that it can recheck
* wait permission to the new task SID. */
read_lock(&tasklist_lock);
- __wake_up_parent(current, current->real_parent);
+ __wake_up_parent(current, unrcu_pointer(current->real_parent));
read_unlock(&tasklist_lock);
}