[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1712160136460.2099@nanos>
Date: Sat, 16 Dec 2017 01:39:45 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Andy Lutomirski <luto@...nel.org>
cc: x86@...nel.org, linux-kernel@...r.kernel.org,
Borislav Petkov <bp@...en8.de>,
Brian Gerst <brgerst@...il.com>,
David Laight <David.Laight@...lab.com>,
Kees Cook <keescook@...omium.org>,
Peter Zijlstra <peterz@...radead.org>,
"Kirill A. Shutemov" <kirill@...temov.name>,
Dave Hansen <dave.hansen@...el.com>
Subject: Re: [PATCH PTI v3 10/10] x86/pti: Put the LDT in its own PGD if PTI
is on
On Tue, 12 Dec 2017, Andy Lutomirski wrote:
> +
> + return 0;
> +#else
> + return -EINVAL;
Errm. What's the point of that? Breaking non PTI?
> new_ldt = alloc_ldt_struct(old_mm->context.ldt->nr_entries);
> if (!new_ldt) {
> @@ -155,8 +266,17 @@ int init_new_context_ldt(struct task_struct *tsk, struct mm_struct *mm)
> memcpy(new_ldt->entries, old_mm->context.ldt->entries,
> new_ldt->nr_entries * LDT_ENTRY_SIZE);
> finalize_ldt_struct(new_ldt);
> + retval = map_ldt_struct(mm, new_ldt, 0);
> + if (retval)
> + goto out_free;
>
> mm->context.ldt = new_ldt;
> + goto out_unlock;
> +
> +out_free:
> + free_ldt_pgtables(mm);
> + free_ldt_struct(new_ldt);
> + return retval;
Leaks old_mm->context_lock;
Thanks,
tglx
Powered by blists - more mailing lists