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] [day] [month] [year] [list]
Date:   Thu, 23 Feb 2023 21:20:02 +0000
From:   Sean Christopherson <seanjc@...gle.com>
To:     Zhi Wang <zhi.wang.linux@...il.com>
Cc:     Paolo Bonzini <pbonzini@...hat.com>,
        Randy Dunlap <rdunlap@...radead.org>,
        linux-kernel@...r.kernel.org,
        Vineeth Pillai <viremana@...ux.microsoft.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>, kvm@...r.kernel.org
Subject: Re: [PATCH v2] KVM: SVM: hyper-v: placate modpost section mismatch error

On Thu, Feb 23, 2023, Zhi Wang wrote:
> On Wed, 22 Feb 2023 19:32:53 +0100
> Paolo Bonzini <pbonzini@...hat.com> wrote:
> 
> Maybe we can use __always_inline? I just noticed this thread today by chance.

Using __always_inline will "fix" the problem, but it's not necessary in this case,
and in some ways it's less correct.  The noinstr case you linked is different
because the helpers in question can (and are) be used in noinstr and regular
sections, i.e. shouldn't be tagged noinstr.  In this case, svm_hv_hardware_setup()
must be called from __init functions, i.e. doesn't need to be unopinionated.

And FWIW, svm_hv_hardware_setup() really doesn't need to be inlined.

> https://lore.kernel.org/all/20210624095147.880513802@infradead.org/
> 
> > On 2/22/23 17:46, Sean Christopherson wrote:
> > >    Tag svm_hv_hardware_setup() with __init to fix a modpost warning as the
> > >    non-stub implementation accesses __initdata (svm_x86_ops), i.e. would
> > >    generate a use-after-free if svm_hv_hardware_setup() were actually invoked
> > >    post-init.  The helper is only called from svm_hardware_setup(), which is
> > >    also __init, i.e. other than the modpost warning, lack of __init is benign.
> > 
> > Done.  It's caused by the compiler deciding not to inline the function, 
> > probably.
> > 
> > Also Cc'ed stable.
> > 
> > Paolo
> > 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ