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: <CAHk-=wieFY6__aPLEz_2mv-GG6-Utw9NQOLDzi4TF93xFAnCoQ@mail.gmail.com>
Date: Wed, 24 Sep 2025 12:40:29 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Eric Biggers <ebiggers@...nel.org>
Cc: linux-crypto@...r.kernel.org, Herbert Xu <herbert@...dor.apana.org.au>, 
	linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] crypto: af_alg - Fix incorrect boolean values in af_alg_ctx

On Wed, 24 Sept 2025 at 12:27, Eric Biggers <ebiggers@...nel.org> wrote:
>
> -       u32             more:1,
> -                       merge:1,
> -                       enc:1,
> -                       write:1,
> -                       init:1;
> +       bool more;
> +       bool merge;
> +       bool enc;
> +       bool write;
> +       bool init;

This actually packs horribly, since a 'bool' will take up a byte for
each, so now those five bits take up 8 bytes of storage (because the
five bytes will then cause the next field to have to be aligned too).

You could just keep the bitfield format, but change the 'u32' to
'bool' and get the best of both worlds, ie just do something like

-       u32             more:1,
+       bool             more:1,

and now you get the bit packing _and_ the automatic bool behavior.

           Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ