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, 30 Jul 2021 22:24:53 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Boqun Feng <boqun.feng@...il.com>
Cc:     Arnd Bergmann <arnd@...db.de>,
        linux-arch <linux-arch@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
        Wedson Almeida Filho <wedsonaf@...gle.com>,
        Gary Guo <gary@...yguo.net>, Hector Martin <marcan@...can.st>,
        Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [Question] Alignment requirement for readX() and writeX()

On Fri, Jul 30, 2021 at 7:31 PM Boqun Feng <boqun.feng@...il.com> wrote:
> On Fri, Jul 30, 2021 at 06:58:30PM +0200, Arnd Bergmann wrote:
>
> If we want to check, I'd expect we do the checks inside
> readX()/writeX(), for example, readl() could be implemented as:
>
>         #define readl(c)                                        \
>         ({                                                      \
>                 u32 __v;                                        \
>                                                                 \
>                 /* alignment checking */                        \
>                 BUG_ON(c & (sizeof(__v) - 1));                  \
>                 __v = readl_relaxed(c);                         \
>                 __iormb(__v);                                   \
>                 __v;                                            \
>         })
>
> It's a runtime check, so if anyone hates it I can understand ;-)

Right, I really don't think that adds any value, this just replaces one
oops message with a more different oops message, while adding
some overhead.

        Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ