diff options
| author | Christian Brauner <christian@brauner.io> | 2018-08-22 00:59:55 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-22 13:52:50 -0400 |
| commit | bb17fcca078fc56ea7c7611cbe92687021cf6a31 (patch) | |
| tree | 95cae1bcb93ad51fff0b309fc90d2ba6131e5e66 /kernel | |
| parent | 52cba1a274818c3ee6299c1a1b476e7bc5037a2f (diff) | |
signal: make kill_as_cred_perm() return bool
kill_as_cred_perm() already behaves like a boolean function. Let's
actually declare it as such too.
Link: http://lkml.kernel.org/r/20180602103653.18181-3-christian@brauner.io
Signed-off-by: Christian Brauner <christian@brauner.io>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: James Morris <james.morris@microsoft.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/signal.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 8a828baa0f93..5b0fb57b23f0 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
| @@ -1339,14 +1339,15 @@ static int kill_proc_info(int sig, struct siginfo *info, pid_t pid) | |||
| 1339 | return error; | 1339 | return error; |
| 1340 | } | 1340 | } |
| 1341 | 1341 | ||
| 1342 | static int kill_as_cred_perm(const struct cred *cred, | 1342 | static inline bool kill_as_cred_perm(const struct cred *cred, |
| 1343 | struct task_struct *target) | 1343 | struct task_struct *target) |
| 1344 | { | 1344 | { |
| 1345 | const struct cred *pcred = __task_cred(target); | 1345 | const struct cred *pcred = __task_cred(target); |
| 1346 | if (!uid_eq(cred->euid, pcred->suid) && !uid_eq(cred->euid, pcred->uid) && | 1346 | |
| 1347 | !uid_eq(cred->uid, pcred->suid) && !uid_eq(cred->uid, pcred->uid)) | 1347 | return uid_eq(cred->euid, pcred->suid) || |
| 1348 | return 0; | 1348 | uid_eq(cred->euid, pcred->uid) || |
| 1349 | return 1; | 1349 | uid_eq(cred->uid, pcred->suid) || |
| 1350 | uid_eq(cred->uid, pcred->uid); | ||
| 1350 | } | 1351 | } |
| 1351 | 1352 | ||
| 1352 | /* like kill_pid_info(), but doesn't use uid/euid of "current" */ | 1353 | /* like kill_pid_info(), but doesn't use uid/euid of "current" */ |
