From patchwork Fri Oct 23 11:20:17 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Lalancette X-Patchwork-Id: 55542 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 n9NBLfFS028250 for ; Fri, 23 Oct 2009 11:21:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751883AbZJWLVE (ORCPT ); Fri, 23 Oct 2009 07:21:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751729AbZJWLVE (ORCPT ); Fri, 23 Oct 2009 07:21:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3557 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751480AbZJWLVD (ORCPT ); Fri, 23 Oct 2009 07:21:03 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9NBKKNf023604; Fri, 23 Oct 2009 07:20:20 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9NBKHtq008171; Fri, 23 Oct 2009 07:20:18 -0400 From: Chris Lalancette To: x86@kernel.org Cc: mingo@elte.hu, kvm@vger.kernel.org, pbonzini@redhat.com, linux-kernel@vger.kernel.org, Chris Lalancette Subject: [PATCH] Make sure get_user_desc() doesn't sign extend. Date: Fri, 23 Oct 2009 13:20:17 +0200 Message-Id: <1256296817-25199-1-git-send-email-clalance@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 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)