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: <9e92cd34-c58c-ec5e-3ba0-9d8d87fbebef@kernel.dk>
Date:   Thu, 8 Oct 2020 07:36:49 -0600
From:   Jens Axboe <axboe@...nel.dk>
To:     Oleg Nesterov <oleg@...hat.com>
Cc:     linux-kernel@...r.kernel.org, io-uring@...r.kernel.org,
        peterz@...radead.org, tglx@...utronix.de
Subject: Re: [PATCH 2/6] kernel: add task_sigpending() helper

On 10/8/20 6:58 AM, Oleg Nesterov wrote:
> On 10/05, Jens Axboe wrote:
>>
>>  static inline int signal_pending_state(long state, struct task_struct *p)
>>  {
>>  	if (!(state & (TASK_INTERRUPTIBLE | TASK_WAKEKILL)))
>>  		return 0;
>> -	if (!signal_pending(p))
>> +	if (!task_sigpending(p))
>>  		return 0;
> 
> This looks obviously wrong. Say, schedule() in TASK_INTERRUPTIBLE should
> not block if TIF_NOTIFY_SIGNAL is set.
> 
> With this change set_notify_signal() will not force the task to return
> from wait_event_interruptible, mutex_lock_interruptible, etc.

True, not sure why I made the distinction there. I'll fix that one up.

> 
>>  	return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
>> @@ -389,7 +394,7 @@ static inline bool fault_signal_pending(vm_fault_t fault_flags,
>>  {
>>  	return unlikely((fault_flags & VM_FAULT_RETRY) &&
>>  			(fatal_signal_pending(current) ||
>> -			 (user_mode(regs) && signal_pending(current))));
>> +			 (user_mode(regs) && task_sigpending(current))));
> 
> This looks unnecessary,

Dropped

>> @@ -773,7 +773,7 @@ static int ptrace_peek_siginfo(struct task_struct *child,
>>  		data += sizeof(siginfo_t);
>>  		i++;
>>  
>> -		if (signal_pending(current))
>> +		if (task_sigpending(current))
> 
> This too.
> 
> IMO, this patch should do s/signal_pending/task_sigpending/ only if it is
> strictly needed for correctness.

Agree, I'll kill the ones you identified.

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ