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] [thread-next>] [day] [month] [year] [list]
Message-ID: <da84a2a7-f94a-d0aa-14e0-3925f758aa0e@kernel.dk>
Date:   Thu, 15 Oct 2020 08:31:23 -0600
From:   Jens Axboe <axboe@...nel.dk>
To:     Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org,
        io-uring@...r.kernel.org
Cc:     peterz@...radead.org, oleg@...hat.com
Subject: Re: [PATCH 4/5] x86: wire up TIF_NOTIFY_SIGNAL

On 10/15/20 8:11 AM, Thomas Gleixner wrote:
> On Thu, Oct 15 2020 at 07:17, Jens Axboe wrote:
>> --- a/arch/x86/kernel/signal.c
>> +++ b/arch/x86/kernel/signal.c
>> @@ -808,7 +808,10 @@ void arch_do_signal(struct pt_regs *regs, unsigned long ti_work)
>>  {
>>  	struct ksignal ksig;
>>  
>> -	if (get_signal(&ksig)) {
>> +	if (ti_work & _TIF_NOTIFY_SIGNAL)
>> +		tracehook_notify_signal();
>> +
>> +	if ((ti_work & _TIF_SIGPENDING) && get_signal(&ksig)) {
>>  		/* Whee! Actually deliver the signal.  */
>>  		handle_signal(&ksig, regs);
>>  		return;
> 
> Instead of adding this to every architectures signal magic, we can
> handle TIF_NOTIFY_SIGNAL in the core code:
> 
> static void handle_singal_work(ti_work, regs)
> {
> 	if (ti_work & _TIF_NOTIFY_SIGNAL)
>         	tracehook_notify_signal();
> 
>         arch_do_signal(ti_work, regs);
> }
> 
>       loop {
>       		if (ti_work & (SIGPENDING | NOTIFY_SIGNAL))
>                 	handle_signal_work(ti_work, regs);
>       }

We could, should probably make it:

static void handle_signal_work(ti_work, regs)
{
	if (ti_work & _TIF_NOTIFY_SIGNAL)
        	tracehook_notify_signal();

	if (ti_work & _TIF_SIGPENDING)
        	arch_do_signal(regs);
}

and then we can skip modifying arch_do_signal() all together, as it'll
only be called if _TIF_SIGPENDING is set.

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ