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
0c7e9a87
Commit
0c7e9a87
authored
Mar 28, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cris: switch to RAW_COPY_USER
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
b71f1bf5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
42 deletions
+12
-42
arch/cris/Kconfig
arch/cris/Kconfig
+1
-0
arch/cris/include/asm/uaccess.h
arch/cris/include/asm/uaccess.h
+11
-42
No files found.
arch/cris/Kconfig
View file @
0c7e9a87
...
...
@@ -71,6 +71,7 @@ config CRIS
select GENERIC_SCHED_CLOCK if ETRAX_ARCH_V32
select HAVE_DEBUG_BUGVERBOSE if ETRAX_ARCH_V32
select HAVE_NMI
select ARCH_HAS_RAW_COPY_USER
config HZ
int
...
...
arch/cris/include/asm/uaccess.h
View file @
0c7e9a87
...
...
@@ -336,64 +336,33 @@ static inline size_t clear_user(void __user *to, size_t n)
return
__do_clear_user
(
to
,
n
);
}
static
inline
size_t
copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
size_t
n
)
static
inline
unsigned
long
raw_copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
size_t
res
=
n
;
if
(
likely
(
access_ok
(
VERIFY_READ
,
from
,
n
)))
{
if
(
__builtin_constant_p
(
n
))
res
=
__constant_copy_from_user
(
to
,
from
,
n
);
return
__constant_copy_from_user
(
to
,
from
,
n
);
else
res
=
__copy_user_in
(
to
,
from
,
n
);
}
if
(
unlikely
(
res
))
memset
(
to
+
n
-
res
,
0
,
res
);
return
res
;
return
__copy_user_in
(
to
,
from
,
n
);
}
static
inline
size_t
copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
size_t
n
)
static
inline
unsigned
long
raw_copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
{
if
(
unlikely
(
!
access_ok
(
VERIFY_WRITE
,
to
,
n
)))
return
n
;
if
(
__builtin_constant_p
(
n
))
return
__constant_copy_to_user
(
to
,
from
,
n
);
else
return
__copy_user
(
to
,
from
,
n
);
}
/* We let the __ versions of copy_from/to_user inline, because they're often
* used in fast paths and have only a small space overhead.
*/
#define INLINE_COPY_FROM_USER
#define INLINE_COPY_TO_USER
static
inline
unsigned
long
__generic_copy_from_user_nocheck
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
return
__copy_user_in
(
to
,
from
,
n
);
}
static
inline
unsigned
long
__generic_copy_to_user_nocheck
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
{
return
__copy_user
(
to
,
from
,
n
);
}
static
inline
unsigned
long
__generic_clear_user_nocheck
(
void
__user
*
to
,
unsigned
long
n
)
__clear_user
(
void
__user
*
to
,
unsigned
long
n
)
{
return
__do_clear_user
(
to
,
n
);
}
/* without checking */
#define __copy_to_user(to, from, n) \
__generic_copy_to_user_nocheck((to), (from), (n))
#define __copy_from_user(to, from, n) \
__generic_copy_from_user_nocheck((to), (from), (n))
#define __copy_to_user_inatomic __copy_to_user
#define __copy_from_user_inatomic __copy_from_user
#define __clear_user(to, n) __generic_clear_user_nocheck((to), (n))
#define strlen_user(str) strnlen_user((str), 0x7ffffffe)
#endif
/* _CRIS_UACCESS_H */
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