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]
Message-ID: <CA+55aFzfSWVXtswiS7iucQ8m+s8pbMqW_7H+RfEmdYxLtEAYcQ@mail.gmail.com>
Date:   Sat, 30 Dec 2017 12:45:39 -0800
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     Dominik Brodowski <linux@...inikbrodowski.net>,
        Andy Lutomirski <luto@...nel.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        LKML <linux-kernel@...r.kernel.org>,
        "the arch/x86 maintainers" <x86@...nel.org>
Subject: Re: x86/pti: smp_processor_id() called while preemptible in resume-from-sleep

On Sat, Dec 30, 2017 at 12:28 PM, Thomas Gleixner <tglx@...utronix.de> wrote:
>
> That preempt_disable()/enable() was added with:
>
> commit 5cf0791da5c162ebc14b01eb01631cfa7ed4fa6e
> Author: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> Date:   Fri Aug 5 15:37:39 2016 +0200
>
>     x86/mm: Disable preemption during CR3 read+write
>
> So we need to look at that scenario before removing it.

Good point, but I think that was actually a mis-feature of the old
"__flush_tlb_up()" implementation that Andy got rid of in commit
ce4a4e565f52 ("x86/mm: Remove the UP asm/tlbflush.h code, always use
the (formerly) SMP code").

So the code sequence that that commit talks about no longer exists.

Instead, we now have the call to __flush_tlb() inside a
get_cpu/put_cpu, which is preempt-safe even on UP (despite the CPU
number obviously being fixed).

So I think Dave is right: we should just remove the
preempt_disable/endable. But adding a

        WARN_ON_ONCE(preemptible());

might still be a good idea.

               Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ