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-next>] [day] [month] [year] [list]
Date:	Mon, 22 Apr 2013 17:07:10 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Andrey Vagin <avagin@...nvz.org>
Cc:	linux-kernel@...r.kernel.org, Roland McGrath <roland@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Michael Kerrisk <mtk.manpages@...il.com>,
	Pavel Emelyanov <xemul@...allels.com>,
	Cyrill Gorcunov <gorcunov@...nvz.org>
Subject: Re: [PATCH] ptrace: add ability to get/set signal-blocked mask

On 04/22, Oleg Nesterov wrote:
>
> On 04/22, Andrey Vagin wrote:
> >
> > +	case PTRACE_SETSIGMASK:
> > +	{
> > +		sigset_t new_set;
> > +
> > +		if (addr != sizeof(sigset_t)) {
> > +			ret = -EINVAL;
> > +			break;
> > +		}
> > +
> > +		if (copy_from_user(&new_set, datavp, sizeof(sigset_t))) {
> > +			ret = -EFAULT;
> > +			break;
> > +		}
> > +
> > +		sigdelsetmask(&new_set, sigmask(SIGKILL)|sigmask(SIGSTOP));
> > +
> > +		spin_lock_irq(&child->sighand->siglock);
> > +		__set_task_blocked(child, &new_set);
> > +		spin_unlock_irq(&child->sighand->siglock);
>
> No, please don't...
>
> set_current_blocked/__set_task_blocked assume that tsk == current.
> If nothing else, note recalc_sigpending() in __set_task_blocked().
>
> I don't understand "This method is not suitable for stopped tasks"
> from the changelog, but if you really need PTRACE_SETSIGMASK just
> change ->blocked under siglock and do recalc_sigpending_tsk(child).
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

actually this is not necessary, the tracee will do recalc_sigpending()
after resume. But perhaps a comment make sense.

Oleg.

--
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