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: <012ccfea2a564274bd9d2e1cfc130873@AcuMS.aculab.com>
Date:   Tue, 13 Jul 2021 11:07:00 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Russell King' <linux@...linux.org.uk>,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>
CC:     Salah Triki <salah.triki@...il.com>,
        "fabrice.gasnier@...s.st.com" <fabrice.gasnier@...s.st.com>,
        "thierry.reding@...il.com" <thierry.reding@...il.com>,
        "lee.jones@...aro.org" <lee.jones@...aro.org>,
        "mcoquelin.stm32@...il.com" <mcoquelin.stm32@...il.com>,
        "alexandre.torgue@...s.st.com" <alexandre.torgue@...s.st.com>,
        "linux-pwm@...r.kernel.org" <linux-pwm@...r.kernel.org>,
        "linux-stm32@...md-mailman.stormreply.com" 
        <linux-stm32@...md-mailman.stormreply.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] divide by 3*sizeof(u32) when computing array_size

From: Russell King
> Sent: 13 July 2021 10:20
....
> I would also note that the code relies on there being no padding in
> struct stm32_breakinput - it should be noted that a strict
> interpretation of the C standard allows padding to be added anywhere
> to a structure - at the start, end or between members.

I'm pretty certain I remember that padding before the first member
isn't allowed.

In any case the kernel generally assumes there is no extra padding.
(eg for structures that map hardware registers.)

For big structures it is worth adding a compile-time check of
the structure size - but not really for three u32.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ