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, 24 Jun 2022 14:05:30 +0100
From:   Aidan MacDonald <aidanmacdonald.0x0@...il.com>
To:     Joe Perches <joe@...ches.com>
Cc:     Mark Brown <broonie@...nel.org>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Matti Vaittinen <mazziesaccount@...il.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 01/12] regmap-irq: Convert bool bitfields to unsigned
 int


Joe Perches <joe@...ches.com> writes:

> On Fri, 2022-06-24 at 13:11 +0100, Mark Brown wrote:
>> On Thu, Jun 23, 2022 at 11:26:10PM +0200, Andy Shevchenko wrote:
>> > On Thu, Jun 23, 2022 at 11:13 PM Aidan MacDonald
>> 
>> > > Use 'unsigned int' for bitfields for consistency with most other
>> > > kernel code.
>> 
>> > There is no point to convert the fields you are about to remove.
>> 
>> > So, either don't touch them or make this patch closer to the end of the series.
>> 
>> It costs us nothing to convert them, this isn't a difficult or hard to
>> understand refactoring - the patch is fine the way it is.
>
> Modulo the defects that might be introduced if an overflow occurs.
>
> struct foo {
> 	unsigned int a:1;
> 	bool b:1;
> }
>
> Assign a non-zero int without bit 0 set to each and see if
> a and b differ.

Bool permits implicit pointer-to-bool conversions, so it isn't free
of pitfalls either. Overflow is probably more dangerous in general,
but here there's little chance of pointers or overflow getting involved.
These are const flags that describe properties of the hardware, nothing
should change them once the irq chip is created, and the vast majority
of chips are static const.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ