Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
ef41f460
Commit
ef41f460
authored
Apr 28, 2009
by
Ralf Baechle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MIPS: uaccess: Switch lock annotations to might_fault().
Signed-off-by:
Ralf Baechle
<
ralf@linux-mips.org
>
parent
005076a1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
18 deletions
+23
-18
arch/mips/include/asm/checksum.h
arch/mips/include/asm/checksum.h
+2
-2
arch/mips/include/asm/uaccess.h
arch/mips/include/asm/uaccess.h
+21
-16
No files found.
arch/mips/include/asm/checksum.h
View file @
ef41f460
...
...
@@ -40,7 +40,7 @@ static inline
__wsum
csum_partial_copy_from_user
(
const
void
__user
*
src
,
void
*
dst
,
int
len
,
__wsum
sum
,
int
*
err_ptr
)
{
might_
sleep
();
might_
fault
();
return
__csum_partial_copy_user
((
__force
void
*
)
src
,
dst
,
len
,
sum
,
err_ptr
);
}
...
...
@@ -53,7 +53,7 @@ static inline
__wsum
csum_and_copy_to_user
(
const
void
*
src
,
void
__user
*
dst
,
int
len
,
__wsum
sum
,
int
*
err_ptr
)
{
might_
sleep
();
might_
fault
();
if
(
access_ok
(
VERIFY_WRITE
,
dst
,
len
))
return
__csum_partial_copy_user
(
src
,
(
__force
void
*
)
dst
,
len
,
sum
,
err_ptr
);
...
...
arch/mips/include/asm/uaccess.h
View file @
ef41f460
...
...
@@ -245,6 +245,7 @@ do { \
int __gu_err = -EFAULT; \
const __typeof__(*(ptr)) __user * __gu_ptr = (ptr); \
\
might_fault(); \
if (likely(access_ok(VERIFY_READ, __gu_ptr, size))) \
__get_user_common((x), size, __gu_ptr); \
\
...
...
@@ -334,6 +335,7 @@ do { \
__typeof__(*(ptr)) __pu_val = (x); \
int __pu_err = -EFAULT; \
\
might_fault(); \
if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) { \
switch (size) { \
case 1: __put_user_asm("sb", __pu_addr); break; \
...
...
@@ -708,10 +710,10 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n);
const void *__cu_from; \
long __cu_len; \
\
might_sleep(); \
__cu_to = (to); \
__cu_from = (from); \
__cu_len = (n); \
might_fault(); \
__cu_len = __invoke_copy_to_user(__cu_to, __cu_from, __cu_len); \
__cu_len; \
})
...
...
@@ -764,13 +766,14 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
const void *__cu_from; \
long __cu_len; \
\
might_sleep(); \
__cu_to = (to); \
__cu_from = (from); \
__cu_len = (n); \
if (access_ok(VERIFY_WRITE, __cu_to, __cu_len)) \
if (access_ok(VERIFY_WRITE, __cu_to, __cu_len)) { \
might_fault(); \
__cu_len = __invoke_copy_to_user(__cu_to, __cu_from, \
__cu_len); \
} \
__cu_len; \
})
...
...
@@ -843,10 +846,10 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
const void __user *__cu_from; \
long __cu_len; \
\
might_sleep(); \
__cu_to = (to); \
__cu_from = (from); \
__cu_len = (n); \
might_fault(); \
__cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \
__cu_len); \
__cu_len; \
...
...
@@ -874,13 +877,14 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
const void __user *__cu_from; \
long __cu_len; \
\
might_sleep(); \
__cu_to = (to); \
__cu_from = (from); \
__cu_len = (n); \
if (access_ok(VERIFY_READ, __cu_from, __cu_len)) \
if (access_ok(VERIFY_READ, __cu_from, __cu_len)) { \
might_fault(); \
__cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \
__cu_len); \
} \
__cu_len; \
})
...
...
@@ -890,10 +894,10 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
const void __user *__cu_from; \
long __cu_len; \
\
might_sleep(); \
__cu_to = (to); \
__cu_from = (from); \
__cu_len = (n); \
might_fault(); \
__cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \
__cu_len); \
__cu_len; \
...
...
@@ -905,14 +909,15 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
const void __user *__cu_from; \
long __cu_len; \
\
might_sleep(); \
__cu_to = (to); \
__cu_from = (from); \
__cu_len = (n); \
if (likely(access_ok(VERIFY_READ, __cu_from, __cu_len) && \
access_ok(VERIFY_WRITE, __cu_to, __cu_len))) \
access_ok(VERIFY_WRITE, __cu_to, __cu_len))) { \
might_fault(); \
__cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \
__cu_len); \
} \
__cu_len; \
})
...
...
@@ -932,7 +937,7 @@ __clear_user(void __user *addr, __kernel_size_t size)
{
__kernel_size_t
res
;
might_
sleep
();
might_
fault
();
__asm__
__volatile__
(
"move
\t
$4, %1
\n\t
"
"move
\t
$5, $0
\n\t
"
...
...
@@ -981,7 +986,7 @@ __strncpy_from_user(char *__to, const char __user *__from, long __len)
{
long
res
;
might_
sleep
();
might_
fault
();
__asm__
__volatile__
(
"move
\t
$4, %1
\n\t
"
"move
\t
$5, %2
\n\t
"
...
...
@@ -1018,7 +1023,7 @@ strncpy_from_user(char *__to, const char __user *__from, long __len)
{
long
res
;
might_
sleep
();
might_
fault
();
__asm__
__volatile__
(
"move
\t
$4, %1
\n\t
"
"move
\t
$5, %2
\n\t
"
...
...
@@ -1037,7 +1042,7 @@ static inline long __strlen_user(const char __user *s)
{
long
res
;
might_
sleep
();
might_
fault
();
__asm__
__volatile__
(
"move
\t
$4, %1
\n\t
"
__MODULE_JAL
(
__strlen_user_nocheck_asm
)
...
...
@@ -1067,7 +1072,7 @@ static inline long strlen_user(const char __user *s)
{
long
res
;
might_
sleep
();
might_
fault
();
__asm__
__volatile__
(
"move
\t
$4, %1
\n\t
"
__MODULE_JAL
(
__strlen_user_asm
)
...
...
@@ -1084,7 +1089,7 @@ static inline long __strnlen_user(const char __user *s, long n)
{
long
res
;
might_
sleep
();
might_
fault
();
__asm__
__volatile__
(
"move
\t
$4, %1
\n\t
"
"move
\t
$5, %2
\n\t
"
...
...
@@ -1115,7 +1120,7 @@ static inline long strnlen_user(const char __user *s, long n)
{
long
res
;
might_
sleep
();
might_
fault
();
__asm__
__volatile__
(
"move
\t
$4, %1
\n\t
"
"move
\t
$5, %2
\n\t
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment