[parisc-linux-cvs] linux-2.6 carlos

Carlos O'Donell carlos at parisc-linux.org
Fri Apr 30 14:07:04 MDT 2004


CVSROOT:	/var/cvs
Module name:	linux-2.6
Changes by:	carlos	04/04/30 14:07:04

Modified files:
	include/linux  : compat_siginfo.h 
	kernel         : compat_signal.c ptrace.c signal.c 

Log message:
----------------------------------------
Linux Kernel - siginfo_t compat changes
----------------------------------------

The Linuxthreads implementation of posix-threads uses
rt_sigqueueinfo. This is broken for 64-bit kernels running
32-bit userspace. It requires that kernel check for a compat
task and properly copy the siginfo_t out of userspace.

This change adds the requires compat checks in generic
places, and uses the previously implemented is_compat_task
macro to remove this code when there is no possibility of a
compat task.

----------------------------------------
include/linux/compat_siginfo.h

Cleanup and make more consistent with compat_* types.
Make __ARCH_SI_UID_T the correct compat type.

kernel/compat_signal.c

(compat_copy_siginfo_to_user)

Always copy the first three words, the kernel uses
these and we might need them later. Only copy the
_sifields._pad when the structure is from userspace.

(compat_copy_siginfo_from_user)

A brand new function that is going to be used by
ptrace_getsiginfo and sys_rt_sigqueueinfo, since both
functions read siginfo_t from userspace. This function
copies up a siginfo_t to the proper kernel size.

kernel/signal.c

(copy_siginfo_from_user)

If the task is compat use the compat version e.g.
compat_copy_siginfo_from_user, else fall back to
using copy_from_user.

(copy_siginfo_to_user)

Move the compat check to the start of the function, that way
we don't duplicate the access check.

(sys_rt_sigqueueinfo)

Call copy_siginfo_from_user to load a siginfo_t from
userspace.

kernel/ptrace.c

(ptrace_getsiginfo)

Call copy_siginfo_from_user to load a siginfo_t from
userspace.



More information about the parisc-linux-cvs mailing list