Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 23 Jun 2016 20:52:21 +0200
From: Oleg Nesterov <>
To: Linus Torvalds <>
Cc: Andy Lutomirski <>, Andy Lutomirski <>,
        the arch/x86 maintainers <>,
        Linux Kernel Mailing List <>,
        "" <>,
        Borislav Petkov <>, Nadav Amit <>,
        Kees Cook <>, Brian Gerst <>,
        "" <>,
        Josh Poimboeuf <>, Jann Horn <>,
        Heiko Carstens <>
Subject: Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86,

On 06/23, Linus Torvalds wrote:
> On Thu, Jun 23, 2016 at 10:03 AM, Oleg Nesterov <> wrote:
> >
> > Let me quote my previous email ;)
> >
> >         And we can't free/nullify it when the parent/debuger reaps a zombie,
> >         say, mark_oom_victim() expects that get_task_struct() protects
> >         thread_info as well.
> >
> > probably we can fix all such users though...
> TIF_MEMDIE is indeed a potential problem, but I don't think
> mark_oom_victim() is actually problematic.
> mark_oom_victim() is called with either "current",

This is no longer true in -mm tree.

But I agree, this is fixable (and in fact I still hope TIF_MEMDIE will die,
at least in its current form).

But I am afraid we can have more users which assume that thread_info can't
go away if you have a reference to task_struct.

And yes, we have a users which rely on RCU, say show_state_filter() which
walks the task under rcu_read_lock() and calls sched_show_task() which prints

Yes this is fixable too, but

> so these days, thread_info has almost nothing really critical in it
> any more. There's the thread-local flags, yes, but they could stay or
> easily be moved to the task_struct or get similar per-cpu fixup as
> preempt_count did a couple of years ago. The only annoyance is the few
> remaining entry code assembly sequences, but I suspect they would
> actually become simpler with a per-cpu thing, and with Andy's cleanups
> they are pretty insignificant these days. There seems to be exactly
> two uses of ASM_THREAD_INFO(TI_flags,.. left.

So perhaps on x86_64 we should move thread_info from thread_union to
task_struct->thread as Andy suggests.

And just in case, even if we move thread_info, of course we will need
to change dump_trace/etc which reads ->stack. Again, show_state_filter()
relies on RCU, proc_pid_stack() on get_task_struct(). They need to pin
task->stack somehow,  but this is clear.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.