[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+55aFz7TTf-MaF+a=qF+KX=G0S51v97xsOsJJVsi8ahNUBtMQ@mail.gmail.com>
Date: Mon, 11 Jul 2016 09:42:42 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Mark Rutland <mark.rutland@....com>
Cc: Andy Lutomirski <luto@...capital.net>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
Nadav Amit <nadav.amit@...il.com>,
Kees Cook <keescook@...omium.org>,
Borislav Petkov <bp@...en8.de>,
Josh Poimboeuf <jpoimboe@...hat.com>, X86 ML <x86@...nel.org>,
Jann Horn <jann@...jh.net>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Brian Gerst <brgerst@...il.com>,
"kernel-hardening@...ts.openwall.com"
<kernel-hardening@...ts.openwall.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [kernel-hardening] [PATCH v4 26/29] sched: Allow putting
thread_info into task_struct
On Mon, Jul 11, 2016 at 9:31 AM, Mark Rutland <mark.rutland@....com> wrote:
>>
>> So until you do the wire that actually disables preemption you can
>> schedule away as much as you want, and after that write you no longer
>> will.
>
> I was assuming a percpu pointer to current (or preempt count).
So for the same reason that is ok *iff* you have
- some kind of dedicated percpu register (or other base pointer - x86
has the segment thing) that gets updated when you schedule.
- an instruction that can load 'current' directly off that register atomically.
But yes, percpu data in general is obviously not safe to access
without preemption.
Linus
Powered by blists - more mailing lists