Skip to content

Commit 8f13621

Browse files
author
Al Viro
committed
sigpending(): move compat to native
... and kill set_fs() use Signed-off-by: Al Viro <[email protected]>
1 parent d9e968c commit 8f13621

File tree

2 files changed

+12
-23
lines changed

2 files changed

+12
-23
lines changed

kernel/compat.c

-23
Original file line numberDiff line numberDiff line change
@@ -350,29 +350,6 @@ COMPAT_SYSCALL_DEFINE3(setitimer, int, which,
350350
return 0;
351351
}
352352

353-
#ifdef __ARCH_WANT_SYS_SIGPENDING
354-
355-
/*
356-
* Assumption: old_sigset_t and compat_old_sigset_t are both
357-
* types that can be passed to put_user()/get_user().
358-
*/
359-
360-
COMPAT_SYSCALL_DEFINE1(sigpending, compat_old_sigset_t __user *, set)
361-
{
362-
old_sigset_t s;
363-
long ret;
364-
mm_segment_t old_fs = get_fs();
365-
366-
set_fs(KERNEL_DS);
367-
ret = sys_sigpending((old_sigset_t __user *) &s);
368-
set_fs(old_fs);
369-
if (ret == 0)
370-
ret = put_user(s, set);
371-
return ret;
372-
}
373-
374-
#endif
375-
376353
#ifdef __ARCH_WANT_SYS_SIGPROCMASK
377354

378355
/*

kernel/signal.c

+12
Original file line numberDiff line numberDiff line change
@@ -3254,6 +3254,18 @@ SYSCALL_DEFINE1(sigpending, old_sigset_t __user *, set)
32543254
return sys_rt_sigpending((sigset_t __user *)set, sizeof(old_sigset_t));
32553255
}
32563256

3257+
#ifdef CONFIG_COMPAT
3258+
COMPAT_SYSCALL_DEFINE1(sigpending, compat_old_sigset_t __user *, set32)
3259+
{
3260+
sigset_t set;
3261+
int err = do_sigpending(&set, sizeof(old_sigset_t));
3262+
if (err == 0)
3263+
if (copy_to_user(set32, &set, sizeof(old_sigset_t)))
3264+
err = -EFAULT;
3265+
return err;
3266+
}
3267+
#endif
3268+
32573269
#endif
32583270

32593271
#ifdef __ARCH_WANT_SYS_SIGPROCMASK

0 commit comments

Comments
 (0)