lkml.org 
[lkml]   [2011]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 05/43] avr32: use set_current_blocked() in handle_signal/sys_rt_sigreturn
    Date
    From: Oleg Nesterov <oleg@redhat.com>

    It is wrong to change ->blocked directly, see e6fa16ab.
    Change handle_signal() and sys_rt_sigreturn() to use
    the right helper, set_current_blocked().

    Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
    Acked-by: Havard Skinnemoen <hskinnemoen@gmail.com>
    Reviewed-by: Matt Fleming <matt.fleming@intel.com>
    Signed-off-by: Oleg Nesterov <oleg@redhat.com>
    ---
    arch/avr32/kernel/signal.c | 15 +++++----------
    1 files changed, 5 insertions(+), 10 deletions(-)

    diff --git a/arch/avr32/kernel/signal.c b/arch/avr32/kernel/signal.c
    index 9c075e1..06f4293 100644
    --- a/arch/avr32/kernel/signal.c
    +++ b/arch/avr32/kernel/signal.c
    @@ -87,10 +87,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
    goto badframe;

    sigdelsetmask(&set, ~_BLOCKABLE);
    - spin_lock_irq(&current->sighand->siglock);
    - current->blocked = set;
    - recalc_sigpending();
    - spin_unlock_irq(&current->sighand->siglock);
    + set_current_blocked(&set);

    if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
    goto badframe;
    @@ -226,6 +223,7 @@ static inline void
    handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
    sigset_t *oldset, struct pt_regs *regs, int syscall)
    {
    + sigset_t blocked;
    int ret;

    /*
    @@ -246,13 +244,10 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
    /*
    * Block the signal if we were successful.
    */
    - spin_lock_irq(&current->sighand->siglock);
    - sigorsets(&current->blocked, &current->blocked,
    - &ka->sa.sa_mask);
    + sigorsets(&blocked, &current->blocked, &ka->sa.sa_mask);
    if (!(ka->sa.sa_flags & SA_NODEFER))
    - sigaddset(&current->blocked, sig);
    - recalc_sigpending();
    - spin_unlock_irq(&current->sighand->siglock);
    + sigaddset(&blocked, sig);
    + set_current_blocked(&blocked);
    }

    /*
    --
    1.7.4.4


    \
     
     \ /
      Last update: 2011-08-19 18:59    [W:0.045 / U:0.004 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site