From patchwork Wed Nov 4 14:11:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Lalancette X-Patchwork-Id: 57588 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 nA4EDY2v022072 for ; Wed, 4 Nov 2009 14:13:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756404AbZKDOMn (ORCPT ); Wed, 4 Nov 2009 09:12:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756398AbZKDOMn (ORCPT ); Wed, 4 Nov 2009 09:12:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58529 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756384AbZKDOMm (ORCPT ); Wed, 4 Nov 2009 09:12:42 -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 nA4EBbFQ026730; Wed, 4 Nov 2009 09:11:37 -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 nA4EBZo7018115; Wed, 4 Nov 2009 09:11:35 -0500 From: Chris Lalancette To: mingo@elte.hu Cc: x86@kernel.org, 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: Wed, 4 Nov 2009 15:11:33 +0100 Message-Id: <1257343893-6142-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)