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]
Message-ID: <CAFLxGvwEaotgMmeYamBZ6KRcpmDmdh6-vL51wPLyD-vC8-pThA@mail.gmail.com>
Date:	Thu, 21 Jul 2016 17:44:43 +0200
From:	Richard Weinberger <richard.weinberger@...il.com>
To:	pavi1729 <pavitra1729@...il.com>
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: Re: Query : siginitsetinv/siginitset has a memset of size 0

On Thu, Jul 21, 2016 at 5:12 PM, pavi1729 <pavitra1729@...il.com> wrote:
> Hi,
>   signal.h code and a memset of size 0, is that fine or am I missing something ?

When _NSIG_WORDS is 1 you enter case 1: which is a nop, so the memset()
is not being executed.

>
> http://lxr.free-electrons.com/source/include/linux/signal.h
>
> 200 static inline void siginitsetinv(sigset_t *set, unsigned long mask)
> 201 {
> 202         set->sig[0] = ~mask;
> 203         switch (_NSIG_WORDS) {
> 204         default:
> 205                 memset(&set->sig[1], -1,
> sizeof(long)*(_NSIG_WORDS-1));  <-- size 0
> 206                 break;
> 207         case 2: set->sig[1] = -1;
> 208         case 1: ;
> 209         }
> 210 }
>
>
> http://lxr.free-electrons.com/source/arch/ia64/include/asm/signal.h#L16
>  14 #define _NSIG           64
>  15 #define _NSIG_BPW       64
>  16 #define _NSIG_WORDS     (_NSIG / _NSIG_BPW)
>  17
>
>
> Thanks,
> Pavi



-- 
Thanks,
//richard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ