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]
Date:   Tue, 27 Sep 2016 18:17:00 +0200
From:   Oleg Nesterov <oleg@...hat.com>
To:     Waiman Long <Waiman.Long@....com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Ingo Molnar <mingo@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Stas Sergeev <stsp@...t.ru>, linux-kernel@...r.kernel.org,
        Scott J Norton <scott.norton@....com>,
        Douglas Hatch <doug.hatch@....com>
Subject: Re: [PATCH v3] signals: Avoid unnecessary taking of
        sighand->siglock

On 09/27, Waiman Long wrote:
>
> +static inline int sigequalsets(const sigset_t *set1, const sigset_t *set2)
> +{
> +	switch (_NSIG_WORDS) {
> +	case 4:
> +		return	(set1->sig[3] == set2->sig[3]) &&
> +			(set1->sig[2] == set2->sig[2]) &&
> +			(set1->sig[1] == set2->sig[1]) &&
> +			(set1->sig[0] == set2->sig[0]);
> +	case 2:
> +		return	(set1->sig[1] == set2->sig[1]) &&
> +			(set1->sig[0] == set2->sig[0]);
> +	case 1:
> +		return	set1->sig[0] == set2->sig[0];
> +	}
> +	return 0;
> +}
> +

OK, this memcmp-by-hand matches other sig* helpers. Well, perhaps

	default:
		BUILD_BUG();

makes sense too, but I won't insist.

> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -2485,6 +2485,13 @@ void __set_current_blocked(const sigset_t *newset)
>  {
>  	struct task_struct *tsk = current;
>  
> +	/*
> +	 * In case the signal mask hasn't changed, there is nothing we need
> +	 * to do. The current->blocked shouldn't be modified by other task.
> +	 */
> +	if (sigequalsets(&tsk->blocked, newset))
> +		return;
> +

Acked-by: Oleg Nesterov <oleg@...hat.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ