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: <CAHp75VdfGCnoyOEn9-c0O4cx7t8GRTH+Ux_gYiRvZeOnDyQryg@mail.gmail.com>
Date:   Sat, 3 Oct 2020 16:02:41 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     William Breathitt Gray <vilhelm.gray@...il.com>
Cc:     Syed Nayyar Waris <syednwaris@...il.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Arnd Bergmann <arnd@...db.de>,
        Linux-Arch <linux-arch@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v10 1/4] bitops: Introduce the for_each_set_clump macro

On Sat, Oct 3, 2020 at 3:56 PM William Breathitt Gray
<vilhelm.gray@...il.com> wrote:
> On Sat, Oct 03, 2020 at 03:45:04PM +0300, Andy Shevchenko wrote:
> > On Sat, Oct 3, 2020 at 2:37 PM Syed Nayyar Waris <syednwaris@...il.com> wrote:
> > > On Sat, Oct 3, 2020 at 2:14 PM Andy Shevchenko
> > > <andy.shevchenko@...il.com> wrote:
> > > > On Sat, Oct 3, 2020 at 2:51 AM Syed Nayyar Waris <syednwaris@...il.com> wrote:

...

> > > > > +               map[index] &= ~BITMAP_FIRST_WORD_MASK(start);
> > > > > +               map[index] |= value << offset;
> >
> > Side note: I would prefer + 0 here and there, but it's up to you.
> >
> > > > > +               map[index + 1] &= ~BITMAP_LAST_WORD_MASK(start + nbits);
> > > > > +               map[index + 1] |= (value >> space);
> >
> > By the way, what about this in the case of start=0, nbits > 64?
> > space == 64 -> UB.
> >
> > (And btw parentheses are redundant here)
>
> I think this is the same situation as before: we should document that
> nbits must be between 1 and BITS_PER_LONG.

At least documented, yes.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ