lkml.org 
[lkml]   [2012]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 20/40] mn10300: Use set_current_blocked() and block_sigmask()
    From
    Date
    On Tue, 2012-02-14 at 15:56 +0000, David Howells wrote:
    > Matt Fleming <matt@console-pimps.org> wrote:
    >
    > > asmlinkage long sys_sigsuspend(int history0, int history1, old_sigset_t mask)
    > > {
    > > - mask &= _BLOCKABLE;
    > > - spin_lock_irq(&current->sighand->siglock);
    > > + sigset_t blocked;
    > > +
    > > current->saved_sigmask = current->blocked;
    >
    > Can this line create a race, now that it's not protected by a lock? It is
    > possible for current->blocked to get altered by another thread.

    ->blocked can only ever be altered by current, not another thread. See
    the following comment from sigprocmask() in kernel/signal.c,

    /* Lockless, only current can change ->blocked, never from irq */
    if (oldset)
    *oldset = tsk->blocked;

    --
    Matt Fleming, Intel Open Source Technology Center



    \
     
     \ /
      Last update: 2012-02-14 19:03    [W:0.023 / U:119.696 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site