lkml.org 
[lkml]   [2005]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Consolidate compat_sys_waitid
On Tue, Feb 15, 2005 at 02:01:49PM +1100, Stephen Rothwell wrote:
> +asmlinkage long compat_sys_waitid(u32 which, u32 pid,
> + struct compat_siginfo __user *uinfo, u32 options,
> + struct compat_rusage __user *uru)
> +{
> + siginfo_t info;
> + struct rusage ru;
> + long ret;
> + mm_segment_t old_fs = get_fs();
> +
> + memset(&info, 0, sizeof(info));
> +
> + set_fs(KERNEL_DS);
> + ret = sys_waitid(which, pid, (siginfo_t __user *)&info, options,
> + uru ? (struct rusage __user *)&ru : NULL);
> + set_fs(old_fs);

I don't think this will work for sparc64/s390/UML etc.
They cannot access kernel data inside KERNEL_DS. You would need to use
compat_alloc_user_space() for ru

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:10    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site