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 <jacob.frelinger duke edu>, 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 { _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"