From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 21:45:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3DE0106566B; Thu, 27 Jan 2011 21:45:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E36D18FC19; Thu, 27 Jan 2011 21:45:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLjcNp037961; Thu, 27 Jan 2011 21:45:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLjc8l037959; Thu, 27 Jan 2011 21:45:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101272145.p0RLjc8l037959@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 27 Jan 2011 21:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217991 - head/sys/amd64/linux32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:45:39 -0000 Author: kib Date: Thu Jan 27 21:45:38 2011 New Revision: 217991 URL: http://svn.freebsd.org/changeset/base/217991 Log: linux_sigreturn() loads the struct trapframe from l_sigcontext members, thus making a signed extension of 32 bit register context. If the register is not touched in usermode between return from signal and next syscall entry, the sign-extension part of 64bit register is not cleared, causing linux32_fetch_syscall_args() to read wrong values. Use unsigned type for the registers in the linux sigcontext. Reported by: Jacob Frelinger , arundel In collaboration with: dchagin MFC after: 1 week Modified: head/sys/amd64/linux32/linux.h Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Thu Jan 27 21:41:27 2011 (r217990) +++ head/sys/amd64/linux32/linux.h Thu Jan 27 21:45:38 2011 (r217991) @@ -370,28 +370,28 @@ typedef struct { /* The Linux sigcontext, pretty much a standard 386 trapframe. */ struct l_sigcontext { - l_int sc_gs; - l_int sc_fs; - l_int sc_es; - l_int sc_ds; - l_int sc_edi; - l_int sc_esi; - l_int sc_ebp; - l_int sc_esp; - l_int sc_ebx; - l_int sc_edx; - l_int sc_ecx; - l_int sc_eax; - l_int sc_trapno; - l_int sc_err; - l_int sc_eip; - l_int sc_cs; - l_int sc_eflags; - l_int sc_esp_at_signal; - l_int sc_ss; - l_int sc_387; - l_int sc_mask; - l_int sc_cr2; + l_uint sc_gs; + l_uint sc_fs; + l_uint sc_es; + l_uint sc_ds; + l_uint sc_edi; + l_uint sc_esi; + l_uint sc_ebp; + l_uint sc_esp; + l_uint sc_ebx; + l_uint sc_edx; + l_uint sc_ecx; + l_uint sc_eax; + l_uint sc_trapno; + l_uint sc_err; + l_uint sc_eip; + l_uint sc_cs; + l_uint sc_eflags; + l_uint sc_esp_at_signal; + l_uint sc_ss; + l_uint sc_387; + l_uint sc_mask; + l_uint sc_cr2; } __packed; struct l_ucontext {