Skip to content

Commit

Permalink
Fix access_ok() fallout for sparc32 and powerpc
Browse files Browse the repository at this point in the history
These two architectures actually had an intentional use of the 'type'
argument to access_ok() just to avoid warnings.

I had actually noticed the powerpc one, but forgot to then fix it up.
And I missed the sparc32 case entirely.

This is hopefully all of it.

Reported-by: Mathieu Malaterre <malat@debian.org>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Fixes: 96d4f26 ("Remove 'type' argument from access_ok() function")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Linus Torvalds committed Jan 4, 2019
1 parent 96d4f26 commit 4caf4eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static inline int __access_ok(unsigned long addr, unsigned long size,
#endif

#define access_ok(addr, size) \
(__chk_user_ptr(addr), (void)(type), \
(__chk_user_ptr(addr), \
__access_ok((__force unsigned long)(addr), (size), get_fs()))

/*
Expand Down
3 changes: 1 addition & 2 deletions arch/sparc/include/asm/uaccess_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
#define __user_ok(addr, size) ({ (void)(size); (addr) < STACK_TOP; })
#define __kernel_ok (uaccess_kernel())
#define __access_ok(addr, size) (__user_ok((addr) & get_fs().seg, (size)))
#define access_ok(addr, size) \
({ (void)(type); __access_ok((unsigned long)(addr), size); })
#define access_ok(addr, size) __access_ok((unsigned long)(addr), size)

/*
* The exception table consists of pairs of addresses: the first is the
Expand Down

0 comments on commit 4caf4eb

Please sign in to comment.