From d53865ac5f5814e6f344b349f175fcab56dea3dd Mon Sep 17 00:00:00 2001 From: Tomoki Shirasawa Date: Wed, 18 Mar 2015 12:59:05 +0900 Subject: [PATCH] change to check sequence of kill syscall, check sig num zero after uid checking --- arch/x86/kernel/syscall.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/syscall.c b/arch/x86/kernel/syscall.c index f897f69d..c4e0fe8a 100644 --- a/arch/x86/kernel/syscall.c +++ b/arch/x86/kernel/syscall.c @@ -926,11 +926,6 @@ do_kill(int pid, int tid, int sig, siginfo_t *info, int ptracecont) cpu_restore_interrupt(irqstate); return -ESRCH; } - if(sig == 0){ - ihk_mc_spinlock_unlock_noirq(savelock); - cpu_restore_interrupt(irqstate); - return 0; - } if(sig != SIGCONT && proc->ftn->euid != 0 && @@ -943,6 +938,12 @@ do_kill(int pid, int tid, int sig, siginfo_t *info, int ptracecont) return -EPERM; } + if(sig == 0){ + ihk_mc_spinlock_unlock_noirq(savelock); + cpu_restore_interrupt(irqstate); + return 0; + } + doint = 0; if(tid == -1){ ihk_mc_spinlock_lock_noirq(&tproc->sigshared->lock);