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
Kirill Smelkov
linux
Commits
a668ce3a
Commit
a668ce3a
authored
Mar 28, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
um: switch to RAW_COPY_USER
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
d597580d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
arch/um/Kconfig.common
arch/um/Kconfig.common
+1
-0
arch/um/include/asm/uaccess.h
arch/um/include/asm/uaccess.h
+4
-4
arch/um/kernel/skas/uaccess.c
arch/um/kernel/skas/uaccess.c
+4
-4
No files found.
arch/um/Kconfig.common
View file @
a668ce3a
...
...
@@ -13,6 +13,7 @@ config UML
select GENERIC_CLOCKEVENTS
select HAVE_GCC_PLUGINS
select TTY # Needed for line.c
select ARCH_HAS_RAW_COPY_USER
config MMU
bool
...
...
arch/um/include/asm/uaccess.h
View file @
a668ce3a
...
...
@@ -21,8 +21,8 @@
#define __addr_range_nowrap(addr, size) \
((unsigned long) (addr) <= ((unsigned long) (addr) + (size)))
extern
long
_
_copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
);
extern
long
_
_copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
);
extern
unsigned
long
raw
_copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
);
extern
unsigned
long
raw
_copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
);
extern
long
__strncpy_from_user
(
char
*
dst
,
const
char
__user
*
src
,
long
count
);
extern
long
__strnlen_user
(
const
void
__user
*
str
,
long
len
);
extern
unsigned
long
__clear_user
(
void
__user
*
mem
,
unsigned
long
len
);
...
...
@@ -33,8 +33,8 @@ static inline int __access_ok(unsigned long addr, unsigned long size);
#define __clear_user __clear_user
#define __strnlen_user __strnlen_user
#define __strncpy_from_user __strncpy_from_user
#define
__copy_to_user_inatomic __copy_to_user
#define
__copy_from_user_inatomic __copy_from_user
#define
INLINE_COPY_FROM_USER
#define
INLINE_COPY_TO_USER
#include <asm-generic/uaccess.h>
...
...
arch/um/kernel/skas/uaccess.c
View file @
a668ce3a
...
...
@@ -139,7 +139,7 @@ static int copy_chunk_from_user(unsigned long from, int len, void *arg)
return
0
;
}
long
_
_copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
unsigned
long
raw
_copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
if
(
uaccess_kernel
())
{
memcpy
(
to
,
(
__force
void
*
)
from
,
n
);
...
...
@@ -148,7 +148,7 @@ long __copy_from_user(void *to, const void __user *from, unsigned long n)
return
buffer_op
((
unsigned
long
)
from
,
n
,
0
,
copy_chunk_from_user
,
&
to
);
}
EXPORT_SYMBOL
(
_
_copy_from_user
);
EXPORT_SYMBOL
(
raw
_copy_from_user
);
static
int
copy_chunk_to_user
(
unsigned
long
to
,
int
len
,
void
*
arg
)
{
...
...
@@ -159,7 +159,7 @@ static int copy_chunk_to_user(unsigned long to, int len, void *arg)
return
0
;
}
long
_
_copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
unsigned
long
raw
_copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
{
if
(
uaccess_kernel
())
{
memcpy
((
__force
void
*
)
to
,
from
,
n
);
...
...
@@ -168,7 +168,7 @@ long __copy_to_user(void __user *to, const void *from, unsigned long n)
return
buffer_op
((
unsigned
long
)
to
,
n
,
1
,
copy_chunk_to_user
,
&
from
);
}
EXPORT_SYMBOL
(
_
_copy_to_user
);
EXPORT_SYMBOL
(
raw
_copy_to_user
);
static
int
strncpy_chunk_from_user
(
unsigned
long
from
,
int
len
,
void
*
arg
)
{
...
...
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