From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752614AbbHEJLd (ORCPT ); Wed, 5 Aug 2015 05:11:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:56909 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751132AbbHEJLa (ORCPT ); Wed, 5 Aug 2015 05:11:30 -0400 Subject: Re: [PATCH] x86: correct fpu emulation access to ldt To: Andy Lutomirski References: <1438700560-1778-1-git-send-email-jgross@suse.com> Cc: billm@melbpc.org.au, "linux-kernel@vger.kernel.org" From: Juergen Gross Message-ID: <55C1D33F.20803@suse.com> Date: Wed, 5 Aug 2015 11:11:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/04/2015 08:01 PM, Andy Lutomirski wrote: > On Tue, Aug 4, 2015 at 8:02 AM, Juergen Gross wrote: >> Commit 14805442532c ("x86/ldt: Make modify_ldt synchronous") introduced >> a new struct ldt_struct anchored at mm->context.ldt. >> >> Adapt the x86 fpu emulation to use that new structure. >> >> Signed-off-by: Juergen Gross > > Whoops! > > Does this need to Cc: stable? Probably. > Also, want to make it slightly fancier so we can drop the dependency > on CONFIG_MODIFY_LDT_SYSCALL? Something like: -#define LDT_DESCRIPTOR(s) (((struct desc_struct *)current->mm->context.ldt)[(s) >> 3]) +#ifdef CONFIG_MODIFY_LDT_SYSCALL +#define LDT_DESCRIPTOR(s) (current->mm->context.ldt->entries[(s) >> 3]) +#else +#define LDT_DESCRIPTOR(s) ((struct desc_struct){{{ .a = 0, .b = 0, }}}) +#endif I'd need to specify the corresponding patch as a prerequisite for stable I guess? How to do this before it is picked by Linus? Juergen