On Thu, Dec 14, 2017 at 3:27 AM, Peter Zijlstra <pet...@infradead.org> wrote: > From: Thomas Gleixner <t...@linutronix.de> > > The LDT is inheritet independent of fork or exec, but that makes no sense > at all because exec is supposed to start the process clean. > > The reason why this happens is that init_new_context_ldt() is called from > init_new_context() which obviously needs to be called for both fork() and > exec(). > > It would be surprising if anything relies on that behaviour, so it seems to > be safe to remove that misfeature. > > Split the context initialization into two parts. Clear the ldt pointer and > initialize the mutex from the general context init and move the LDT > duplication to arch_dup_mmap() which is only called on fork().
I like this one.