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:   Sun, 19 Mar 2023 17:34:09 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     Usama Arif <usama.arif@...edance.com>
Cc:     dwmw2@...radead.org, tglx@...utronix.de, kim.phillips@....com,
        brgerst@...il.com, piotrgorski@...hyos.org,
        oleksandr@...alenko.name, arjan@...ux.intel.com, mingo@...hat.com,
        dave.hansen@...ux.intel.com, hpa@...or.com, x86@...nel.org,
        pbonzini@...hat.com, paulmck@...nel.org,
        linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        rcu@...r.kernel.org, mimoja@...oja.de, hewenliang4@...wei.com,
        thomas.lendacky@....com, seanjc@...gle.com, pmenzel@...gen.mpg.de,
        fam.zheng@...edance.com, punit.agrawal@...edance.com,
        simon.evans@...edance.com, liangma@...ngbit.com,
        gpiccoli@...lia.com, David Woodhouse <dwmw@...zon.co.uk>
Subject: Re: [PATCH v15 02/12] cpu/hotplug: Move idle_thread_get() to
 <linux/smpboot.h>

On Thu, Mar 16, 2023 at 10:20:59PM +0000, Usama Arif wrote:
> From: David Woodhouse <dwmw@...zon.co.uk>
> 
> Instead of relying purely on the special-case wrapper in bringup_cpu()
> to pass the idle thread to __cpu_up(), expose idle_thread_get() so that
> the architecture code can obtain it directly when necessary.
> 
> This will be useful when the existing __cpu_up() is split into multiple
> phases, only *one* of which will actually need the idle thread.
> 
> If the architecture code is to register its new pre-bringup states with
> the cpuhp core, having a special-case wrapper to pass extra arguments is
> non-trivial and it's easier just to let the arch register its function
> pointer to be invoked with the standard API.
> 
> To reduce duplication, move the shadow stack reset and kasan unpoisoning

I was wondering what "shadow stack" as that set is not upstream yet. You mean
"shadow call stack" which is apparently something else,
compiler-generated, purely software thing.

> into idle_thread_get() too.

Frankly, I don't think resetting shadow call stack and kasan state
belongs in a function which returns the idle thread. Even more so if you
have to add an @unpoison param which is false sometimes and sometimes
true, depending on where you call the function.

I think you should have a helper

	tsk_reset_stacks(struct task_struct *tsk);

or so which is called where @unpoison == true instead of having a getter
function do something unrelated too.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists