Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751378AbbGYEO3 (ORCPT ); Sat, 25 Jul 2015 00:14:29 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:49671 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750784AbbGYEO2 (ORCPT ); Sat, 25 Jul 2015 00:14:28 -0400 Message-ID: <55B30CE3.2010902@oracle.com> Date: Sat, 25 Jul 2015 00:13:23 -0400 From: Boris Ostrovsky User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Andy Lutomirski , Peter Zijlstra , Steven Rostedt CC: "security@kernel.org" , X86 ML , Borislav Petkov , Sasha Levin , linux-kernel@vger.kernel.org, Konrad Rzeszutek Wilk , Andrew Cooper , Jan Beulich , xen-devel , stable@vger.kernel.org Subject: Re: [PATCH v3 1/3] x86/ldt: Make modify_ldt synchronous References: <049fdbab8ae2ecac1c8b40ecd558e9df45ccd5d3.1437592883.git.luto@kernel.org> <55B01745.4010702@oracle.com> In-Reply-To: <55B01745.4010702@oracle.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1458 Lines: 44 On 07/22/2015 06:20 PM, Boris Ostrovsky wrote: > On 07/22/2015 03:23 PM, Andy Lutomirski wrote: >> >> + error = -ENOMEM; >> + new_ldt = alloc_ldt_struct(newsize); >> + if (!new_ldt) >> goto out_unlock; >> - } >> - fill_ldt(&ldt, &ldt_info); >> - if (oldmode) >> - ldt.avl = 0; >> + if (old_ldt) { >> + memcpy(new_ldt->entries, old_ldt->entries, >> + oldsize * LDT_ENTRY_SIZE); >> + } >> + memset(new_ldt->entries + oldsize * LDT_ENTRY_SIZE, 0, >> + (newsize - oldsize) * LDT_ENTRY_SIZE); > > We need to zero out full page (probably better in alloc_ldt_struct() > with vmzalloc/__GFP_ZERO) --- Xen checks whole page that is assigned > to G/LDT and gets unhappy if an invalid descriptor is found there. > > This fixes one problem. There is something else that Xen gets upset > about, I haven't figured what it is yet (and I am out tomorrow so it > may need to wait until Friday). > What I thought was another problem turned out not to be one so both 64- and 32-bit tests passed on 64-bit PV (when allocated LDT is zeroed out) However, on 32-bit kernel the test is failing multicpu test, I don't know yet what it is. -boris -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/