Re: [PATCH -mm 2/4] ptrace: compat_ptrace_request siginfo

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jeff Dike
Date: Thursday, March 13, 2008 - 7:42 am

On Thu, Mar 13, 2008 at 01:32:43AM -0700, Roland McGrath wrote:

BTW, this also fixes a long-standing bug in x86_64 ptrace32_siginfo:

	ret = sys_ptrace(request, pid, addr, (unsigned long)si);
	if (ret)
		return ret;
	if (request == PTRACE_GETSIGINFO) {
		if (copy_from_user(&ssi, si, sizeof(siginfo_t)))
			return -EFAULT;
		ret = copy_siginfo_to_user32(si32, &ssi);
	}

si comes back with the upper bits of si_code missing, courtesy of
copy_siginfo_to_user:

	err |= __put_user((short)from->si_code, &to->si_code);

causing copy_siginfo_to_user32 to not copy any fields of the union
past the first word because the upper 16 bits are used to figure out
what needs copying.

			Jeff

-- 
Work email - jdike at linux dot intel dot com
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH -mm 1/4] powerpc copy_siginfo_from_user32, Roland McGrath, (Thu Mar 13, 1:31 am)
[PATCH -mm 2/4] ptrace: compat_ptrace_request siginfo, Roland McGrath, (Thu Mar 13, 1:32 am)
Re: [PATCH -mm 2/4] ptrace: compat_ptrace_request siginfo, Jeff Dike, (Thu Mar 13, 7:42 am)
Re: [PATCH -mm 1/4] powerpc copy_siginfo_from_user32, Andrew Morton, (Thu Mar 13, 2:35 pm)
Re: [PATCH -mm 1/4] powerpc copy_siginfo_from_user32, Roland McGrath, (Thu Mar 13, 4:36 pm)