From patchwork Thu Nov 5 10:47:08 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Lalancette X-Patchwork-Id: 57873 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA5AmdBk025278 for ; Thu, 5 Nov 2009 10:48:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753175AbZKEKsD (ORCPT ); Thu, 5 Nov 2009 05:48:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750888AbZKEKsC (ORCPT ); Thu, 5 Nov 2009 05:48:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46618 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750775AbZKEKsB (ORCPT ); Thu, 5 Nov 2009 05:48:01 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nA5AlCml027147; Thu, 5 Nov 2009 05:47:13 -0500 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nA5AlAKR025074; Thu, 5 Nov 2009 05:47:10 -0500 From: Chris Lalancette To: torvalds@linux-foundation.org Cc: x86@kernel.org, mingo@elte.hu, mingo@redhat.com, kvm@vger.kernel.org, pbonzini@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, Chris Lalancette Subject: [PATCH] x86: Make sure get_user_desc() doesn't sign extend. Date: Thu, 5 Nov 2009 11:47:08 +0100 Message-Id: <1257418028-5557-1-git-send-email-clalance@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h index e8de2f6..617bd56 100644 --- a/arch/x86/include/asm/desc.h +++ b/arch/x86/include/asm/desc.h @@ -288,7 +288,7 @@ static inline void load_LDT(mm_context_t *pc) static inline unsigned long get_desc_base(const struct desc_struct *desc) { - return desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24); + return (unsigned)(desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24)); } static inline void set_desc_base(struct desc_struct *desc, unsigned long base)