Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
9a677341
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9a677341
编写于
3月 21, 2017
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
m32r: switch to RAW_COPY_USER
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
8cd920f2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
115 deletion
+8
-115
arch/m32r/Kconfig
arch/m32r/Kconfig
+1
-0
arch/m32r/include/asm/uaccess.h
arch/m32r/include/asm/uaccess.h
+7
-91
arch/m32r/kernel/m32r_ksyms.c
arch/m32r/kernel/m32r_ksyms.c
+0
-2
arch/m32r/lib/usercopy.c
arch/m32r/lib/usercopy.c
+0
-22
未找到文件。
arch/m32r/Kconfig
浏览文件 @
9a677341
...
...
@@ -19,6 +19,7 @@ config M32R
select HAVE_DEBUG_STACKOVERFLOW
select CPU_NO_EFFICIENT_FFS
select DMA_NOOP_OPS
select ARCH_HAS_RAW_COPY_USER
config SBUS
bool
...
...
arch/m32r/include/asm/uaccess.h
浏览文件 @
9a677341
...
...
@@ -13,6 +13,7 @@
*/
#include <asm/page.h>
#include <asm/setup.h>
#include <linux/prefetch.h>
/*
* The fs value determines whether argument validity checking should be
...
...
@@ -463,107 +464,22 @@ do { \
/* 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.
*/
static
inline
unsigned
long
__generic_copy_from_user_nocheck
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
static
inline
unsigned
long
raw_copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
prefetchw
(
to
);
__copy_user
(
to
,
from
,
n
);
return
n
;
}
static
inline
unsigned
long
__generic_copy_to_user_nocheck
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
static
inline
unsigned
long
raw_copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
{
prefetch
(
from
);
__copy_user
(
to
,
from
,
n
);
return
n
;
}
unsigned
long
__generic_copy_to_user
(
void
__user
*
,
const
void
*
,
unsigned
long
);
unsigned
long
__generic_copy_from_user
(
void
*
,
const
void
__user
*
,
unsigned
long
);
/**
* __copy_to_user: - Copy a block of data into user space, with less checking.
* @to: Destination address, in user space.
* @from: Source address, in kernel space.
* @n: Number of bytes to copy.
*
* Context: User context only. This function may sleep if pagefaults are
* enabled.
*
* Copy data from kernel space to user space. Caller must check
* the specified block with access_ok() before calling this function.
*
* Returns number of bytes that could not be copied.
* On success, this will be zero.
*/
#define __copy_to_user(to, from, n) \
__generic_copy_to_user_nocheck((to), (from), (n))
#define __copy_to_user_inatomic __copy_to_user
#define __copy_from_user_inatomic __copy_from_user
/**
* copy_to_user: - Copy a block of data into user space.
* @to: Destination address, in user space.
* @from: Source address, in kernel space.
* @n: Number of bytes to copy.
*
* Context: User context only. This function may sleep if pagefaults are
* enabled.
*
* Copy data from kernel space to user space.
*
* Returns number of bytes that could not be copied.
* On success, this will be zero.
*/
#define copy_to_user(to, from, n) \
({ \
might_fault(); \
__generic_copy_to_user((to), (from), (n)); \
})
/**
* __copy_from_user: - Copy a block of data from user space, with less checking. * @to: Destination address, in kernel space.
* @from: Source address, in user space.
* @n: Number of bytes to copy.
*
* Context: User context only. This function may sleep if pagefaults are
* enabled.
*
* Copy data from user space to kernel space. Caller must check
* the specified block with access_ok() before calling this function.
*
* Returns number of bytes that could not be copied.
* On success, this will be zero.
*
* If some data could not be copied, this function will pad the copied
* data to the requested size using zero bytes.
*/
#define __copy_from_user(to, from, n) \
__generic_copy_from_user_nocheck((to), (from), (n))
/**
* copy_from_user: - Copy a block of data from user space.
* @to: Destination address, in kernel space.
* @from: Source address, in user space.
* @n: Number of bytes to copy.
*
* Context: User context only. This function may sleep if pagefaults are
* enabled.
*
* Copy data from user space to kernel space.
*
* Returns number of bytes that could not be copied.
* On success, this will be zero.
*
* If some data could not be copied, this function will pad the copied
* data to the requested size using zero bytes.
*/
#define copy_from_user(to, from, n) \
({ \
might_fault(); \
__generic_copy_from_user((to), (from), (n)); \
})
long
__must_check
strncpy_from_user
(
char
*
dst
,
const
char
__user
*
src
,
long
count
);
long
__must_check
__strncpy_from_user
(
char
*
dst
,
...
...
arch/m32r/kernel/m32r_ksyms.c
浏览文件 @
9a677341
...
...
@@ -26,8 +26,6 @@ EXPORT_SYMBOL(strncpy_from_user);
EXPORT_SYMBOL
(
__strncpy_from_user
);
EXPORT_SYMBOL
(
clear_user
);
EXPORT_SYMBOL
(
__clear_user
);
EXPORT_SYMBOL
(
__generic_copy_from_user
);
EXPORT_SYMBOL
(
__generic_copy_to_user
);
EXPORT_SYMBOL
(
strnlen_user
);
#ifdef CONFIG_SMP
...
...
arch/m32r/lib/usercopy.c
浏览文件 @
9a677341
...
...
@@ -11,28 +11,6 @@
#include <linux/thread_info.h>
#include <linux/uaccess.h>
unsigned
long
__generic_copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
{
prefetch
(
from
);
if
(
access_ok
(
VERIFY_WRITE
,
to
,
n
))
__copy_user
(
to
,
from
,
n
);
return
n
;
}
unsigned
long
__generic_copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
unsigned
long
ret
=
n
;
prefetchw
(
to
);
if
(
access_ok
(
VERIFY_READ
,
from
,
n
))
ret
=
__copy_user
(
to
,
from
,
n
);
if
(
unlikely
(
ret
))
memset
(
to
+
n
-
ret
,
0
,
ret
);
return
ret
;
}
/*
* Copy a null terminated string from userspace.
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录