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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sun, 7 Feb 2021 13:50:00 +0200
From:   Andy Shevchenko <>
To:     Menglong Dong <>
Cc:     "" <>,
        "" <>,
        "" <>,
        "" <>,
        "" <>,
        "" <>
Subject: Re: [PATCH net-next] net: socket: use BIT_MASK for MSG_*

On Sun, Feb 7, 2021 at 5:29 AM Menglong Dong <> wrote:
> On Sat, Feb 6, 2021 at 4:20 PM Andy Shevchenko
> <> wrote:
> > On Saturday, February 6, 2021, <> wrote:

> > It makes it more confusing if you understand the difference between BIT_MASK() and BIT(). I think you have to use the latter. And note () when referring to the function or macro.
> I replaced BIT_MASK() with BIT() in the patch of v2, and it looks much
> more tidy.
> I can't figure out the difference between BIT() and BIT_MASK(), seems
> the latter one more safe... isn't it?

BIT_MASK() operates on top of (long) bitmaps when you already know the
address of the certain word you would like to change. When the
parameter is constant it will be helpful only in some (rare) cases,
where you define a (long) bit mask, which has a bit, like 65, set. For
most of the cases it's not needed. It's rare that hardware operates on
bitmaps longer than data bus width.

With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists