lkml.org 
[lkml]   [2011]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 2/5] signal: Add rwlock to protect sighand->action
From
Date
On Fri, 2011-09-30 at 16:12 +0100, Matt Fleming wrote:
> @@ -2935,9 +3025,11 @@ int do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
> if (!valid_signal(sig) || sig < 1 || (act && sig_kernel_only(sig)))
> return -EINVAL;
>
> + spin_lock_irq(&current->sighand->siglock);
> + read_lock(&current->sighand->action_lock);
> +
> k = &t->sighand->action[sig-1];
>
> - spin_lock_irq(&current->sighand->siglock);
> if (oact)
> *oact = *k;
>
> @@ -2967,6 +3059,7 @@ int do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
> }
> }
>
> + read_unlock(&current->sighand->action_lock);
> spin_unlock_irq(&current->sighand->siglock);
> return 0;
> }

Guh! I just noticed this. That should obviously be write-locked.

--
Matt Fleming, Intel Open Source Technology Center



\
 
 \ /
  Last update: 2011-09-30 17:59    [W:0.105 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site