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
48f666c9
Commit
48f666c9
authored
Mar 21, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
frv: switch to RAW_COPY_USER
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
9a7513cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
34 deletions
+24
-34
arch/frv/Kconfig
arch/frv/Kconfig
+1
-0
arch/frv/include/asm/uaccess.h
arch/frv/include/asm/uaccess.h
+23
-34
No files found.
arch/frv/Kconfig
View file @
48f666c9
...
...
@@ -16,6 +16,7 @@ config FRV
select OLD_SIGACTION
select HAVE_DEBUG_STACKOVERFLOW
select ARCH_NO_COHERENT_DMA_MMAP
select ARCH_HAS_RAW_COPY_USER
config ZONE_DMA
bool
...
...
arch/frv/include/asm/uaccess.h
View file @
48f666c9
...
...
@@ -233,61 +233,50 @@ do { \
/*
*
*/
#define ____force(x) (__force void *)(void __user *)(x)
#ifdef CONFIG_MMU
extern
long
__memset_user
(
void
*
dst
,
unsigned
long
count
);
extern
long
__memcpy_user
(
void
*
dst
,
const
void
*
src
,
unsigned
long
count
);
#define __clear_user(dst,count) __memset_user(____force(dst), (count))
#define __copy_from_user_inatomic(to, from, n) __memcpy_user((to), ____force(from), (n))
#define __copy_to_user_inatomic(to, from, n) __memcpy_user(____force(to), (from), (n))
#else
#define __clear_user(dst,count) (memset(____force(dst), 0, (count)), 0)
#define __copy_from_user_inatomic(to, from, n) (memcpy((to), ____force(from), (n)), 0)
#define __copy_to_user_inatomic(to, from, n) (memcpy(____force(to), (from), (n)), 0)
#endif
static
inline
unsigned
long
__must_check
clear_user
(
void
__user
*
to
,
unsigned
long
n
)
{
if
(
likely
(
__access_ok
(
to
,
n
)))
n
=
__clear_user
(
to
,
n
);
return
n
;
}
static
inline
unsigned
long
__must_check
__copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
{
might_fault
();
return
__copy_to_user_inatomic
(
to
,
from
,
n
);
}
static
inline
unsigned
long
_
_copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
raw
_copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
might_fault
();
return
__copy_from_user_inatomic
(
to
,
from
,
n
);
#ifdef CONFIG_MMU
return
__memcpy_user
(
to
,
(
__force
const
void
*
)
from
,
n
);
#else
memcpy
(
to
,
(
__force
const
void
*
)
from
,
n
);
return
0
;
#endif
}
static
inline
long
copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
static
inline
unsigned
long
raw_copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
{
unsigned
long
ret
=
n
;
if
(
likely
(
__access_ok
(
from
,
n
)))
ret
=
__copy_from_user
(
to
,
from
,
n
);
if
(
unlikely
(
ret
!=
0
))
memset
(
to
+
(
n
-
ret
),
0
,
ret
);
return
ret
;
#ifdef CONFIG_MMU
return
__memcpy_user
((
__force
void
*
)
to
,
from
,
n
);
#else
memcpy
((
__force
void
*
)
to
,
from
,
n
);
return
0
;
#endif
}
#define INLINE_COPY_TO_USER
#define INLINE_COPY_FROM_USER
static
inline
long
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
)
{
return
likely
(
__access_ok
(
to
,
n
))
?
__copy_to_user
(
to
,
from
,
n
)
:
n
;
if
(
likely
(
__access_ok
(
to
,
n
)))
n
=
__clear_user
(
to
,
n
);
return
n
;
}
extern
long
strncpy_from_user
(
char
*
dst
,
const
char
__user
*
src
,
long
count
);
...
...
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