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:   Fri, 8 Mar 2019 07:01:10 +0000
From:   Leon Romanovsky <leonro@...lanox.com>
To:     Bart Van Assche <bvanassche@....org>
CC:     Rasmus Villemoes <linux@...musvillemoes.dk>,
        Jason Gunthorpe <jgg@...lanox.com>,
        Kees Cook <keescook@...omium.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>
Subject: Re: [PATCH] Avoid that check_shl_overflow() triggers a compiler
 warning when building with W=1

On Thu, Mar 07, 2019 at 04:08:23PM -0800, Bart Van Assche wrote:
> On Thu, 2019-03-07 at 08:18 +0100, Rasmus Villemoes wrote:
> > On 07/03/2019 03.14, Bart Van Assche wrote:
> > > On 3/6/19 5:24 PM, Jason Gunthorpe wrote:
> > > > >
> > > > > diff --git a/include/linux/overflow.h b/include/linux/overflow.h
> > > > > index 40b48e2133cb..8afe0c0ada6f 100644
> > > > > +++ b/include/linux/overflow.h
> > > > > @@ -202,6 +202,24 @@
> > > > >     #endif /* COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW */
> > > > >   +/*
> > > > > + * Evaluate a >= 0 without triggering a compiler warning if the type
> > > > > of a
> > > > > + * is an unsigned type.
> > > > > + */
> > > > > +#define is_positive(a) ({                    \
> >
> > is_non_negative, please! positive means > 0. And perhaps it's better to
> > move these utility macros closer to the top of the file, together with
> > the other type/range helpers.
>
> Hi Rasmus,
>
> Thank you for the feedback. But according to what I found online opinions
> about whether or not zero is a positive number seem to vary. From
> https://en.wikipedia.org/wiki/Sign_(mathematics):

Mathematical therm for discrete numbers greater or equal to zero is
"normal numbers".

Thanks

Download attachment "signature.asc" of type "application/pgp-signature" (802 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ