From patchwork Wed Oct 28 15:35:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Lalancette X-Patchwork-Id: 56307 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 n9SFagRc009050 for ; Wed, 28 Oct 2009 15:36:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754598AbZJ1Pfy (ORCPT ); Wed, 28 Oct 2009 11:35:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754587AbZJ1Pfy (ORCPT ); Wed, 28 Oct 2009 11:35:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36101 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754505AbZJ1Pfx (ORCPT ); Wed, 28 Oct 2009 11:35:53 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9SFZUSq006872; Wed, 28 Oct 2009 11:35:30 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9SFZSbG027904; Wed, 28 Oct 2009 11:35:28 -0400 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, Chris Lalancette Subject: [PATCH] x86: Make sure get_user_desc() doesn't sign extend. Date: Wed, 28 Oct 2009 16:35:27 +0100 Message-Id: <1256744127-9056-1-git-send-email-clalance@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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)