Commit 96d4f267 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Remove 'type' argument from access_ok() function


Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument
of the user address range verification function since we got rid of the
old racy i386-only code to walk page tables by hand.

It existed because the original 80386 would not honor the write protect
bit when in kernel mode, so you had to do COW by hand before doing any
user access.  But we haven't supported that in a long time, and these
days the 'type' argument is a purely historical artifact.

A discussion about extending 'user_access_begin()' to do the range
checking resulted this patch, because there is no way we're going to
move the old VERIFY_xyz interface to that model.  And it's best done at
the end of the merge window when I've done most of my merges, so let's
just get this done once and for all.

This patch was mostly done with a sed-script, with manual fix-ups for
the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form.

There were a couple of notable cases:

 - csky still had the old "verify_area()" name as an alias.

 - the iter_iov code had magical hardcoded knowledge of the actual
   values of VERIFY_{READ,WRITE} (not that they mattered, since nothing
   really used it)

 - microblaze used the type argument for a debug printout

but other than those oddities this should be a total no-op patch.

I tried to fix up all architectures, did fairly extensive grepping for
access_ok() uses, and the changes are trivial, but I may have missed
something.  Any missed conversion should be trivially fixable, though.
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 135143b2
...@@ -68,7 +68,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, ...@@ -68,7 +68,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
int ret = 0, cmp; int ret = 0, cmp;
u32 prev; u32 prev;
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) if (!access_ok(uaddr, sizeof(u32)))
return -EFAULT; return -EFAULT;
__asm__ __volatile__ ( __asm__ __volatile__ (
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#define __access_ok(addr, size) \ #define __access_ok(addr, size) \
((get_fs().seg & (addr | size | (addr+size))) == 0) ((get_fs().seg & (addr | size | (addr+size))) == 0)
#define access_ok(type, addr, size) \ #define access_ok(addr, size) \
({ \ ({ \
__chk_user_ptr(addr); \ __chk_user_ptr(addr); \
__access_ok(((unsigned long)(addr)), (size)); \ __access_ok(((unsigned long)(addr)), (size)); \
......
...@@ -65,7 +65,7 @@ SYSCALL_DEFINE3(osf_sigaction, int, sig, ...@@ -65,7 +65,7 @@ SYSCALL_DEFINE3(osf_sigaction, int, sig,
if (act) { if (act) {
old_sigset_t mask; old_sigset_t mask;
if (!access_ok(VERIFY_READ, act, sizeof(*act)) || if (!access_ok(act, sizeof(*act)) ||
__get_user(new_ka.sa.sa_handler, &act->sa_handler) || __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
__get_user(new_ka.sa.sa_flags, &act->sa_flags) || __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
__get_user(mask, &act->sa_mask)) __get_user(mask, &act->sa_mask))
...@@ -77,7 +77,7 @@ SYSCALL_DEFINE3(osf_sigaction, int, sig, ...@@ -77,7 +77,7 @@ SYSCALL_DEFINE3(osf_sigaction, int, sig,
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
if (!ret && oact) { if (!ret && oact) {
if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || if (!access_ok(oact, sizeof(*oact)) ||
__put_user(old_ka.sa.sa_handler, &oact->sa_handler) || __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
__put_user(old_ka.sa.sa_flags, &oact->sa_flags) || __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
...@@ -207,7 +207,7 @@ do_sigreturn(struct sigcontext __user *sc) ...@@ -207,7 +207,7 @@ do_sigreturn(struct sigcontext __user *sc)
sigset_t set; sigset_t set;
/* Verify that it's a good sigcontext before using it */ /* Verify that it's a good sigcontext before using it */
if (!access_ok(VERIFY_READ, sc, sizeof(*sc))) if (!access_ok(sc, sizeof(*sc)))
goto give_sigsegv; goto give_sigsegv;
if (__get_user(set.sig[0], &sc->sc_mask)) if (__get_user(set.sig[0], &sc->sc_mask))
goto give_sigsegv; goto give_sigsegv;
...@@ -235,7 +235,7 @@ do_rt_sigreturn(struct rt_sigframe __user *frame) ...@@ -235,7 +235,7 @@ do_rt_sigreturn(struct rt_sigframe __user *frame)
sigset_t set; sigset_t set;
/* Verify that it's a good ucontext_t before using it */ /* Verify that it's a good ucontext_t before using it */
if (!access_ok(VERIFY_READ, &frame->uc, sizeof(frame->uc))) if (!access_ok(&frame->uc, sizeof(frame->uc)))
goto give_sigsegv; goto give_sigsegv;
if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
goto give_sigsegv; goto give_sigsegv;
...@@ -332,7 +332,7 @@ setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs) ...@@ -332,7 +332,7 @@ setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
oldsp = rdusp(); oldsp = rdusp();
frame = get_sigframe(ksig, oldsp, sizeof(*frame)); frame = get_sigframe(ksig, oldsp, sizeof(*frame));
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) if (!access_ok(frame, sizeof(*frame)))
return -EFAULT; return -EFAULT;
err |= setup_sigcontext(&frame->sc, regs, set->sig[0], oldsp); err |= setup_sigcontext(&frame->sc, regs, set->sig[0], oldsp);
...@@ -377,7 +377,7 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs) ...@@ -377,7 +377,7 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
oldsp = rdusp(); oldsp = rdusp();
frame = get_sigframe(ksig, oldsp, sizeof(*frame)); frame = get_sigframe(ksig, oldsp, sizeof(*frame));
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) if (!access_ok(frame, sizeof(*frame)))
return -EFAULT; return -EFAULT;
err |= copy_siginfo_to_user(&frame->info, &ksig->info); err |= copy_siginfo_to_user(&frame->info, &ksig->info);
......
...@@ -333,7 +333,7 @@ csum_partial_copy_from_user(const void __user *src, void *dst, int len, ...@@ -333,7 +333,7 @@ csum_partial_copy_from_user(const void __user *src, void *dst, int len,
unsigned long doff = 7 & (unsigned long) dst; unsigned long doff = 7 & (unsigned long) dst;
if (len) { if (len) {
if (!access_ok(VERIFY_READ, src, len)) { if (!access_ok(src, len)) {
if (errp) *errp = -EFAULT; if (errp) *errp = -EFAULT;
memset(dst, 0, len); memset(dst, 0, len);
return sum; return sum;
......
...@@ -126,7 +126,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 expval, ...@@ -126,7 +126,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 expval,
int ret = 0; int ret = 0;
u32 existval; u32 existval;
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) if (!access_ok(uaddr, sizeof(u32)))
return -EFAULT; return -EFAULT;
#ifndef CONFIG_ARC_HAS_LLSC #ifndef CONFIG_ARC_HAS_LLSC
......
...@@ -61,7 +61,7 @@ SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, int, new) ...@@ -61,7 +61,7 @@ SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, int, new)
/* Z indicates to userspace if operation succeded */ /* Z indicates to userspace if operation succeded */
regs->status32 &= ~STATUS_Z_MASK; regs->status32 &= ~STATUS_Z_MASK;
ret = access_ok(VERIFY_WRITE, uaddr, sizeof(*uaddr)); ret = access_ok(uaddr, sizeof(*uaddr));
if (!ret) if (!ret)
goto fail; goto fail;
......
...@@ -169,7 +169,7 @@ SYSCALL_DEFINE0(rt_sigreturn) ...@@ -169,7 +169,7 @@ SYSCALL_DEFINE0(rt_sigreturn)
sf = (struct rt_sigframe __force __user *)(regs->sp); sf = (struct rt_sigframe __force __user *)(regs->sp);
if (!access_ok(VERIFY_READ, sf, sizeof(*sf))) if (!access_ok(sf, sizeof(*sf)))
goto badframe; goto badframe;
if (__get_user(magic, &sf->sigret_magic)) if (__get_user(magic, &sf->sigret_magic))
...@@ -219,7 +219,7 @@ static inline void __user *get_sigframe(struct ksignal *ksig, ...@@ -219,7 +219,7 @@ static inline void __user *get_sigframe(struct ksignal *ksig,
frame = (void __user *)((sp - framesize) & ~7); frame = (void __user *)((sp - framesize) & ~7);
/* Check that we can actually write to the signal frame */ /* Check that we can actually write to the signal frame */
if (!access_ok(VERIFY_WRITE, frame, framesize)) if (!access_ok(frame, framesize))
frame = NULL; frame = NULL;
return frame; return frame;
......
...@@ -50,7 +50,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, ...@@ -50,7 +50,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
int ret; int ret;
u32 val; u32 val;
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) if (!access_ok(uaddr, sizeof(u32)))
return -EFAULT; return -EFAULT;
smp_mb(); smp_mb();
...@@ -104,7 +104,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, ...@@ -104,7 +104,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
int ret = 0; int ret = 0;
u32 val; u32 val;
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) if (!access_ok(uaddr, sizeof(u32)))
return -EFAULT; return -EFAULT;
preempt_disable(); preempt_disable();
......
...@@ -279,7 +279,7 @@ static inline void set_fs(mm_segment_t fs) ...@@ -279,7 +279,7 @@ static inline void set_fs(mm_segment_t fs)
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
#define access_ok(type, addr, size) (__range_ok(addr, size) == 0) #define access_ok(addr, size) (__range_ok(addr, size) == 0)
#define user_addr_max() \ #define user_addr_max() \
(uaccess_kernel() ? ~0UL : get_fs()) (uaccess_kernel() ? ~0UL : get_fs())
...@@ -560,7 +560,7 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n) ...@@ -560,7 +560,7 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
static inline unsigned long __must_check clear_user(void __user *to, unsigned long n) static inline unsigned long __must_check clear_user(void __user *to, unsigned long n)
{ {
if (access_ok(VERIFY_WRITE, to, n)) if (access_ok(to, n))
n = __clear_user(to, n); n = __clear_user(to, n);
return n; return n;
} }
......
...@@ -37,7 +37,7 @@ user_backtrace(struct frame_tail __user *tail, ...@@ -37,7 +37,7 @@ user_backtrace(struct frame_tail __user *tail,
struct frame_tail buftail; struct frame_tail buftail;
unsigned long err; unsigned long err;
if (!access_ok(VERIFY_READ, tail, sizeof(buftail))) if (!access_ok(tail, sizeof(buftail)))
return NULL; return NULL;
pagefault_disable(); pagefault_disable();
......
...@@ -241,7 +241,7 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs) ...@@ -241,7 +241,7 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs)
frame = (struct sigframe __user *)regs->ARM_sp; frame = (struct sigframe __user *)regs->ARM_sp;
if (!access_ok(VERIFY_READ, frame, sizeof (*frame))) if (!access_ok(frame, sizeof (*frame)))
goto badframe; goto badframe;
if (restore_sigframe(regs, frame)) if (restore_sigframe(regs, frame))
...@@ -271,7 +271,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs) ...@@ -271,7 +271,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
frame = (struct rt_sigframe __user *)regs->ARM_sp; frame = (struct rt_sigframe __user *)regs->ARM_sp;
if (!access_ok(VERIFY_READ, frame, sizeof (*frame))) if (!access_ok(frame, sizeof (*frame)))
goto badframe; goto badframe;
if (restore_sigframe(regs, &frame->sig)) if (restore_sigframe(regs, &frame->sig))
...@@ -355,7 +355,7 @@ get_sigframe(struct ksignal *ksig, struct pt_regs *regs, int framesize) ...@@ -355,7 +355,7 @@ get_sigframe(struct ksignal *ksig, struct pt_regs *regs, int framesize)
/* /*
* Check that we can actually write to the signal frame. * Check that we can actually write to the signal frame.
*/ */
if (!access_ok(VERIFY_WRITE, frame, framesize)) if (!access_ok(frame, framesize))
frame = NULL; frame = NULL;
return frame; return frame;
......
...@@ -198,7 +198,7 @@ static int swp_handler(struct pt_regs *regs, unsigned int instr) ...@@ -198,7 +198,7 @@ static int swp_handler(struct pt_regs *regs, unsigned int instr)
destreg, EXTRACT_REG_NUM(instr, RT2_OFFSET), data); destreg, EXTRACT_REG_NUM(instr, RT2_OFFSET), data);
/* Check access in reasonable access range for both SWP and SWPB */ /* Check access in reasonable access range for both SWP and SWPB */
if (!access_ok(VERIFY_WRITE, (address & ~3), 4)) { if (!access_ok((address & ~3), 4)) {
pr_debug("SWP{B} emulation: access to %p not allowed!\n", pr_debug("SWP{B} emulation: access to %p not allowed!\n",
(void *)address); (void *)address);
res = -EFAULT; res = -EFAULT;
......
...@@ -285,7 +285,7 @@ asmlinkage long sys_oabi_epoll_wait(int epfd, ...@@ -285,7 +285,7 @@ asmlinkage long sys_oabi_epoll_wait(int epfd,
maxevents > (INT_MAX/sizeof(*kbuf)) || maxevents > (INT_MAX/sizeof(*kbuf)) ||
maxevents > (INT_MAX/sizeof(*events))) maxevents > (INT_MAX/sizeof(*events)))
return -EINVAL; return -EINVAL;
if (!access_ok(VERIFY_WRITE, events, sizeof(*events) * maxevents)) if (!access_ok(events, sizeof(*events) * maxevents))
return -EFAULT; return -EFAULT;
kbuf = kmalloc_array(maxevents, sizeof(*kbuf), GFP_KERNEL); kbuf = kmalloc_array(maxevents, sizeof(*kbuf), GFP_KERNEL);
if (!kbuf) if (!kbuf)
...@@ -326,7 +326,7 @@ asmlinkage long sys_oabi_semtimedop(int semid, ...@@ -326,7 +326,7 @@ asmlinkage long sys_oabi_semtimedop(int semid,
if (nsops < 1 || nsops > SEMOPM) if (nsops < 1 || nsops > SEMOPM)
return -EINVAL; return -EINVAL;
if (!access_ok(VERIFY_READ, tsops, sizeof(*tsops) * nsops)) if (!access_ok(tsops, sizeof(*tsops) * nsops))
return -EFAULT; return -EFAULT;
sops = kmalloc_array(nsops, sizeof(*sops), GFP_KERNEL); sops = kmalloc_array(nsops, sizeof(*sops), GFP_KERNEL);
if (!sops) if (!sops)
......
...@@ -582,7 +582,7 @@ do_cache_op(unsigned long start, unsigned long end, int flags) ...@@ -582,7 +582,7 @@ do_cache_op(unsigned long start, unsigned long end, int flags)
if (end < start || flags) if (end < start || flags)
return -EINVAL; return -EINVAL;
if (!access_ok(VERIFY_READ, start, end - start)) if (!access_ok(start, end - start))
return -EFAULT; return -EFAULT;
return __do_cache_op(start, end); return __do_cache_op(start, end);
......
...@@ -88,7 +88,7 @@ static struct frame_tail* user_backtrace(struct frame_tail *tail) ...@@ -88,7 +88,7 @@ static struct frame_tail* user_backtrace(struct frame_tail *tail)
struct frame_tail buftail[2]; struct frame_tail buftail[2];
/* Also check accessibility of one struct frame_tail beyond */ /* Also check accessibility of one struct frame_tail beyond */
if (!access_ok(VERIFY_READ, tail, sizeof(buftail))) if (!access_ok(tail, sizeof(buftail)))
return NULL; return NULL;
if (__copy_from_user_inatomic(buftail, tail, sizeof(buftail))) if (__copy_from_user_inatomic(buftail, tail, sizeof(buftail)))
return NULL; return NULL;
......
...@@ -96,7 +96,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *_uaddr, ...@@ -96,7 +96,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *_uaddr,
u32 val, tmp; u32 val, tmp;
u32 __user *uaddr; u32 __user *uaddr;
if (!access_ok(VERIFY_WRITE, _uaddr, sizeof(u32))) if (!access_ok(_uaddr, sizeof(u32)))
return -EFAULT; return -EFAULT;
uaddr = __uaccess_mask_ptr(_uaddr); uaddr = __uaccess_mask_ptr(_uaddr);
......
...@@ -95,7 +95,7 @@ static inline unsigned long __range_ok(const void __user *addr, unsigned long si ...@@ -95,7 +95,7 @@ static inline unsigned long __range_ok(const void __user *addr, unsigned long si
return ret; return ret;
} }
#define access_ok(type, addr, size) __range_ok(addr, size) #define access_ok(addr, size) __range_ok(addr, size)
#define user_addr_max get_fs #define user_addr_max get_fs
#define _ASM_EXTABLE(from, to) \ #define _ASM_EXTABLE(from, to) \
...@@ -301,7 +301,7 @@ do { \ ...@@ -301,7 +301,7 @@ do { \
({ \ ({ \
__typeof__(*(ptr)) __user *__p = (ptr); \ __typeof__(*(ptr)) __user *__p = (ptr); \
might_fault(); \ might_fault(); \
if (access_ok(VERIFY_READ, __p, sizeof(*__p))) { \ if (access_ok(__p, sizeof(*__p))) { \
__p = uaccess_mask_ptr(__p); \ __p = uaccess_mask_ptr(__p); \
__get_user_err((x), __p, (err)); \ __get_user_err((x), __p, (err)); \
} else { \ } else { \
...@@ -370,7 +370,7 @@ do { \ ...@@ -370,7 +370,7 @@ do { \
({ \ ({ \
__typeof__(*(ptr)) __user *__p = (ptr); \ __typeof__(*(ptr)) __user *__p = (ptr); \
might_fault(); \ might_fault(); \
if (access_ok(VERIFY_WRITE, __p, sizeof(*__p))) { \ if (access_ok(__p, sizeof(*__p))) { \
__p = uaccess_mask_ptr(__p); \ __p = uaccess_mask_ptr(__p); \
__put_user_err((x), __p, (err)); \ __put_user_err((x), __p, (err)); \
} else { \ } else { \
...@@ -418,7 +418,7 @@ extern unsigned long __must_check __arch_copy_in_user(void __user *to, const voi ...@@ -418,7 +418,7 @@ extern unsigned long __must_check __arch_copy_in_user(void __user *to, const voi
extern unsigned long __must_check __arch_clear_user(void __user *to, unsigned long n); extern unsigned long __must_check __arch_clear_user(void __user *to, unsigned long n);
static inline unsigned long __must_check __clear_user(void __user *to, unsigned long n) static inline unsigned long __must_check __clear_user(void __user *to, unsigned long n)
{ {
if (access_ok(VERIFY_WRITE, to, n)) if (access_ok(to, n))
n = __arch_clear_user(__uaccess_mask_ptr(to), n); n = __arch_clear_user(__uaccess_mask_ptr(to), n);
return n; return n;
} }
......
...@@ -402,7 +402,7 @@ static int swp_handler(struct pt_regs *regs, u32 instr) ...@@ -402,7 +402,7 @@ static int swp_handler(struct pt_regs *regs, u32 instr)
/* Check access in reasonable access range for both SWP and SWPB */ /* Check access in reasonable access range for both SWP and SWPB */
user_ptr = (const void __user *)(unsigned long)(address & ~3); user_ptr = (const void __user *)(unsigned long)(address & ~3);
if (!access_ok(VERIFY_WRITE, user_ptr, 4)) { if (!access_ok(user_ptr, 4)) {
pr_debug("SWP{B} emulation: access to 0x%08x not allowed!\n", pr_debug("SWP{B} emulation: access to 0x%08x not allowed!\n",
address); address);
goto fault; goto fault;
......
...@@ -39,7 +39,7 @@ user_backtrace(struct frame_tail __user *tail, ...@@ -39,7 +39,7 @@ user_backtrace(struct frame_tail __user *tail,
unsigned long lr; unsigned long lr;
/* Also check accessibility of one struct frame_tail beyond */ /* Also check accessibility of one struct frame_tail beyond */
if (!access_ok(VERIFY_READ, tail, sizeof(buftail))) if (!access_ok(tail, sizeof(buftail)))
return NULL; return NULL;
pagefault_disable(); pagefault_disable();
...@@ -86,7 +86,7 @@ compat_user_backtrace(struct compat_frame_tail __user *tail, ...@@ -86,7 +86,7 @@ compat_user_backtrace(struct compat_frame_tail __user *tail,
unsigned long err; unsigned long err;
/* Also check accessibility of one struct frame_tail beyond */ /* Also check accessibility of one struct frame_tail beyond */
if (!access_ok(VERIFY_READ, tail, sizeof(buftail))) if (!access_ok(tail, sizeof(buftail)))
return NULL; return NULL;
pagefault_disable(); pagefault_disable();
......
...@@ -470,7 +470,7 @@ static int parse_user_sigframe(struct user_ctxs *user, ...@@ -470,7 +470,7 @@ static int parse_user_sigframe(struct user_ctxs *user,
offset = 0; offset = 0;
limit = extra_size; limit = extra_size;
if (!access_ok(VERIFY_READ, base, limit)) if (!access_ok(base, limit))
goto invalid; goto invalid;
continue; continue;
...@@ -556,7 +556,7 @@ SYSCALL_DEFINE0(rt_sigreturn) ...@@ -556,7 +556,7 @@ SYSCALL_DEFINE0(rt_sigreturn)
frame = (struct rt_sigframe __user *)regs->sp; frame = (struct rt_sigframe __user *)regs->sp;
if (!access_ok(VERIFY_READ, frame, sizeof (*frame))) if (!access_ok(frame, sizeof (*frame)))
goto badframe; goto badframe;
if (restore_sigframe(regs, frame)) if (restore_sigframe(regs, frame))
...@@ -730,7 +730,7 @@ static int get_sigframe(struct rt_sigframe_user_layout *user, ...@@ -730,7 +730,7 @@ static int get_sigframe(struct rt_sigframe_user_layout *user,
/* /*
* Check that we can actually write to the signal frame. * Check that we can actually write to the signal frame.
*/ */
if (!access_ok(VERIFY_WRITE, user->sigframe, sp_top - sp)) if (!access_ok(user->sigframe, sp_top - sp))
return -EFAULT; return -EFAULT;
return 0; return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment