lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 8 Aug 2014 15:21:36 +0800
From:	Ley Foon Tan <lftan@...era.com>
To:	Richard Weinberger <richard.weinberger@...il.com>
Cc:	Linux-Arch <linux-arch@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	Chung-Lin Tang <cltang@...esourcery.com>
Subject: Re: [PATCH v2 16/29] nios2: Signal handling support

On Fri, Jul 18, 2014 at 4:04 PM, Richard Weinberger
<richard.weinberger@...il.com> wrote:

>> +
>> +#include <asm/ucontext.h>
>> +#include <asm/cacheflush.h>
>> +
>> +#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
>> +
>> +static int do_signal(struct pt_regs *regs, int in_syscall);
>
> Do you really need this prototype?
Yes, we don't need this. Will remove this.



>> +
>> +asmlinkage int do_rt_sigreturn(struct switch_stack *sw)
>> +{
>> +       struct pt_regs *regs = (struct pt_regs *)(sw + 1);
>> +       /* Verify, can we follow the stack back */
>> +       struct rt_sigframe *frame = (struct rt_sigframe *) regs->sp;
>> +       sigset_t set;
>> +       int rval;
>> +
>> +       if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
>> +               goto badframe;
>> +
>> +       if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
>> +               goto badframe;
>> +
>> +       sigdelsetmask(&set, ~_BLOCKABLE);
>> +       spin_lock_irq(&current->sighand->siglock);
>> +       current->blocked = set;
>> +       recalc_sigpending();
>> +       spin_unlock_irq(&current->sighand->siglock);
>
> Why aren't you using set_current_blocked() here?
Okay, will change to use set_current_blocked().

>> +static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
>> +                         struct pt_regs *regs)
>> +{
>> +       struct rt_sigframe *frame;
>> +       int err = 0;
>> +
>> +       frame = get_sigframe(ksig, regs, sizeof(*frame));
>> +
>> +       if (ksig->ka.sa.sa_flags & SA_SIGINFO)
>> +               err |= copy_siginfo_to_user(&frame->info, &ksig->info);
>> +
>> +       /* Create the ucontext.  */
>> +       err |= __put_user(0, &frame->uc.uc_flags);
>> +       err |= __put_user(0, &frame->uc.uc_link);
>> +       err |= __save_altstack(&frame->uc.uc_stack, regs->sp);
>> +       err |= rt_setup_ucontext(&frame->uc, regs);
>> +       err |= copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
>
> You neither check nor propagate this error code.
Okay, will add error handling here.

Thanks.

Regards
Ley Foon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ