[parisc-linux-cvs] linux-2.6 tausq
Carlos O'Donell
carlos at baldric.uwo.ca
Tue Oct 5 23:08:09 MDT 2004
On Mon, Oct 04, 2004 at 01:45:04PM -0700, Randolph Chung wrote:
> > compat_sys_timer_create: handle the case where timer_event_spec == NULL
> > compat_sys_waitid: __user annotation
>
> also contains the change in the next commit. -randolph
>
> Index: kernel/compat.c
> ===================================================================
> RCS file: /var/cvs/linux-2.6/kernel/compat.c,v
> retrieving revision 1.16
> retrieving revision 1.18
> diff -u -p -r1.16 -r1.18
> --- kernel/compat.c 30 Sep 2004 19:53:55 -0000 1.16
> +++ kernel/compat.c 4 Oct 2004 20:44:11 -0000 1.18
> @@ -606,12 +606,18 @@ long compat_sys_timer_create(clockid_t w
> compat_timer_t __user * created_timer_id)
> {
> sigevent_t kevent;
> + mm_segment_t old_fs = get_fs();
> + long ret;
>
> if (timer_event_spec != NULL)
> if (compat_copy_sigevent_from_user(&kevent, timer_event_spec) != 0)
> return -EFAULT;
>
> - return sys_timer_create(which_clock, &kevent, created_timer_id);
> + set_fs(KERNEL_DS);
> + ret = sys_timer_create(which_clock, timer_event_spec ? (sigevent_t __user *)&kevent : NULL, created_timer_id);
> + set_fs(old_fs);
> +
> + return ret;
> }
Good catch, if timer_event_spec is NULL we don't want to pass a bogus
kevent to sys_timer_create :)
c.
More information about the parisc-linux-cvs
mailing list