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:   Thu, 13 Jul 2023 09:55:29 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Palmer Dabbelt <palmer@...osinc.com>
Cc:     Mark Rutland <mark.rutland@....com>, arnd@...nel.org,
        davem@...emloft.net, peterz@...radead.org,
        Arnd Bergmann <arnd@...db.de>, linux@...ck-us.net,
        geert@...ux-m68k.org, mingo@...nel.org, andi.shyti@...ux.intel.com,
        andrzej.hajda@...el.com, sparclinux@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sparc: mark __arch_xchg() as __always_inline

On Thu, Jul 13, 2023 at 07:00:37AM -0700, Palmer Dabbelt wrote:
> On Wed, 28 Jun 2023 04:45:43 PDT (-0700), Mark Rutland wrote:
> > On Wed, Jun 28, 2023 at 11:49:18AM +0200, Arnd Bergmann wrote:
> > > From: Arnd Bergmann <arnd@...db.de>
> > > 
> > > An otherwise correct change to the atomic operations uncovered an
> > > existing bug in the sparc __arch_xchg() function, which is calls
> > > __xchg_called_with_bad_pointer() when its arguments are unknown at
> > > compile time:
> > > 
> > > ERROR: modpost: "__xchg_called_with_bad_pointer" [lib/atomic64_test.ko] undefined!
> > > 
> > > This now happens because gcc determines that it's better to not inline the
> > > function. Avoid this by just marking the function as __always_inline
> > > to force the compiler to do the right thing here.
> > > 
> > > Reported-by: Guenter Roeck <linux@...ck-us.net>
> > > Link: https://lore.kernel.org/all/c525adc9-6623-4660-8718-e0c9311563b8@roeck-us.net/
> > > Fixes: d12157efc8e08 ("locking/atomic: make atomic*_{cmp,}xchg optional")
> > > Signed-off-by: Arnd Bergmann <arnd@...db.de>
> > 
> > Aha; you saved me writing a patch! :)
> > 
> > We should probably do likewise for all the other bits like __cmpxchg(), but
> > either way:
> > 
> > Acked-by: Mark Rutland <mark.rutland@....com>
> 
> Acked-by: Palmer Dabbelt <palmer@...osinc.com>
> 
> Though I'm not sure that means a whole lot over here ;)

I've carried some other sparc stuff before. I can send this to Linus
with other fixes.

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ