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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 12 Jun 2023 16:54:23 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Mark Rutland <mark.rutland@....com>
Cc:     Marc Zyngier <maz@...nel.org>, linux-kernel@...r.kernel.org,
        Reiji Watanabe <reijiw@...gle.com>,
        Will Deacon <will@...nel.org>
Subject: Re: [PATCH] perf/core: Drop __weak attribute from
 arch_perf_update_userpage() prototype

On Mon, Jun 12, 2023 at 02:16:28PM +0100, Mark Rutland wrote:
> On Sat, Jun 03, 2023 at 09:25:19AM +0100, Marc Zyngier wrote:
> > Reiji reports that the arm64 implementation of arch_perf_update_userpage()
> > is now ignored and replaced by the dummy stub in core code.
> > This seems to happen since the PMUv3 driver was moved to driver/perf.
> 
> I guess we should have a Cc stable then?
> 
> The below implies this has always been on dodgy ground, and so it's probably
> inaccurate to give this a Fixes tag pointing to the move.
> 
> > As it turns out, dropping the __weak attribute from the *prototype*
> > of the function solves the problem. You're right, this doesn't seem
> > to make much sense. And yet... It appears that both symbols get
> > flagged as weak, and that the first one to appear in the link order
> > wins:
> > 
> > $ nm drivers/perf/arm_pmuv3.o|grep arch_perf_update_userpage
> > 0000000000001db0 W arch_perf_update_userpage
> 
> Ah, so having it on th *declaration* will apply to any *definition*. :/

Yikes..

> That suggests this is a bad pattern generally, and we should probably remove
> the other __weak instances in headers. Lukcily it seems there aren't that many:
> 
> [mark@...rids:~/src/linux]% git grep __weak -- **/*.h | wc -l
> 50
> 
> IMO we'd should aim to remove __weak entirely; it causes a number of weird
> things like this and it'd be much easier to manage with a small amount of
> ifdeffery.
> 
> Peter, thoughts?

Not a fan of __weak myself, after having had to deal with how the
compilers actually make it work.

Where do I queue this? perf/urgent?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ