Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
2692a71b
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
2692a71b
编写于
10月 14, 2016
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'work.uaccess' into for-linus
上级
7041c577
b0654442
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
47 addition
and
78 deletion
+47
-78
arch/alpha/include/asm/uaccess.h
arch/alpha/include/asm/uaccess.h
+5
-4
arch/alpha/lib/copy_user.S
arch/alpha/lib/copy_user.S
+1
-15
arch/alpha/lib/ev6-copy_user.S
arch/alpha/lib/ev6-copy_user.S
+1
-22
arch/arc/kernel/signal.c
arch/arc/kernel/signal.c
+4
-4
arch/arm/include/asm/uaccess.h
arch/arm/include/asm/uaccess.h
+6
-5
arch/arm/lib/copy_from_user.S
arch/arm/lib/copy_from_user.S
+3
-6
arch/arm64/include/asm/uaccess.h
arch/arm64/include/asm/uaccess.h
+6
-4
arch/arm64/lib/copy_from_user.S
arch/arm64/lib/copy_from_user.S
+1
-6
arch/blackfin/include/asm/uaccess.h
arch/blackfin/include/asm/uaccess.h
+20
-12
未找到文件。
arch/alpha/include/asm/uaccess.h
浏览文件 @
2692a71b
...
...
@@ -396,11 +396,12 @@ copy_to_user(void __user *to, const void *from, long n)
extern
inline
long
copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
long
n
)
{
long
res
=
n
;
if
(
likely
(
__access_ok
((
unsigned
long
)
from
,
n
,
get_fs
())))
n
=
__copy_tofrom_user_nocheck
(
to
,
(
__force
void
*
)
from
,
n
);
else
memset
(
to
,
0
,
n
);
return
n
;
res
=
__copy_from_user_inatomic
(
to
,
from
,
n
);
if
(
unlikely
(
res
))
memset
(
to
+
(
n
-
res
),
0
,
res
);
return
res
;
}
extern
void
__do_clear_user
(
void
);
...
...
arch/alpha/lib/copy_user.S
浏览文件 @
2692a71b
...
...
@@ -124,22 +124,8 @@ $65:
bis
$
31
,
$
31
,
$
0
$
41
:
$
35
:
$exitout
:
ret
$
31
,(
$
28
),
1
$exitin
:
/
*
A
stupid
byte
-
by
-
byte
zeroing
of
the
rest
of
the
output
buffer
.
This
cures
security
holes
by
never
leaving
random
kernel
data
around
to
be
copied
elsewhere
.
*/
mov
$
0
,
$
1
$
101
:
EXO
(
ldq_u
$
2
,
0
(
$
6
)
)
subq
$
1
,
1
,
$
1
mskbl
$
2
,
$
6
,
$
2
EXO
(
stq_u
$
2
,
0
(
$
6
)
)
addq
$
6
,
1
,
$
6
bgt
$
1
,
$
101
$exitout
:
ret
$
31
,(
$
28
),
1
.
end
__copy_user
arch/alpha/lib/ev6-copy_user.S
浏览文件 @
2692a71b
...
...
@@ -227,33 +227,12 @@ $dirtyentry:
bgt
$
0
,
$onebyteloop
#
U
..
..
..
:
U
L
U
L
$zerolength
:
$exitin
:
$exitout
:
#
Destination
for
exception
recovery
(?)
nop
#
..
..
..
E
nop
#
..
..
E
..
nop
#
..
E
..
..
ret
$
31
,(
$
28
),
1
#
L0
..
..
..
:
L
U
L
U
$exitin
:
/
*
A
stupid
byte
-
by
-
byte
zeroing
of
the
rest
of
the
output
buffer
.
This
cures
security
holes
by
never
leaving
random
kernel
data
around
to
be
copied
elsewhere
.
*/
nop
nop
nop
mov
$
0
,
$
1
$
101
:
EXO
(
stb
$
31
,
0
(
$
6
)
)
#
L
subq
$
1
,
1
,
$
1
#
E
addq
$
6
,
1
,
$
6
#
E
bgt
$
1
,
$
101
#
U
nop
nop
nop
ret
$
31
,(
$
28
),
1
#
L0
.
end
__copy_user
arch/arc/kernel/signal.c
浏览文件 @
2692a71b
...
...
@@ -107,13 +107,13 @@ static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf)
struct
user_regs_struct
uregs
;
err
=
__copy_from_user
(
&
set
,
&
sf
->
uc
.
uc_sigmask
,
sizeof
(
set
));
if
(
!
err
)
set_current_blocked
(
&
set
);
err
|=
__copy_from_user
(
&
uregs
.
scratch
,
&
(
sf
->
uc
.
uc_mcontext
.
regs
.
scratch
),
sizeof
(
sf
->
uc
.
uc_mcontext
.
regs
.
scratch
));
if
(
err
)
return
err
;
set_current_blocked
(
&
set
);
regs
->
bta
=
uregs
.
scratch
.
bta
;
regs
->
lp_start
=
uregs
.
scratch
.
lp_start
;
regs
->
lp_end
=
uregs
.
scratch
.
lp_end
;
...
...
@@ -138,7 +138,7 @@ static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf)
regs
->
r0
=
uregs
.
scratch
.
r0
;
regs
->
sp
=
uregs
.
scratch
.
sp
;
return
err
;
return
0
;
}
static
inline
int
is_do_ss_needed
(
unsigned
int
magic
)
...
...
arch/arm/include/asm/uaccess.h
浏览文件 @
2692a71b
...
...
@@ -533,11 +533,12 @@ __clear_user(void __user *addr, unsigned long n)
static
inline
unsigned
long
__must_check
copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
if
(
access_ok
(
VERIFY_READ
,
from
,
n
))
n
=
__copy_from_user
(
to
,
from
,
n
);
else
/* security hole - plug it */
memset
(
to
,
0
,
n
);
return
n
;
unsigned
long
res
=
n
;
if
(
likely
(
access_ok
(
VERIFY_READ
,
from
,
n
)))
res
=
__copy_from_user
(
to
,
from
,
n
);
if
(
unlikely
(
res
))
memset
(
to
+
(
n
-
res
),
0
,
res
);
return
res
;
}
static
inline
unsigned
long
__must_check
copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
...
...
arch/arm/lib/copy_from_user.S
浏览文件 @
2692a71b
...
...
@@ -98,12 +98,9 @@ ENDPROC(arm_copy_from_user)
.
pushsection
.
fixup
,
"ax"
.
align
0
copy_abort_preamble
ldmfd
sp
!,
{
r1
,
r2
}
sub
r3
,
r0
,
r1
rsb
r1
,
r3
,
r2
str
r1
,
[
sp
]
bl
__memzero
ldr
r0
,
[
sp
],
#
4
ldmfd
sp
!,
{
r1
,
r2
,
r3
}
sub
r0
,
r0
,
r1
rsb
r0
,
r0
,
r2
copy_abort_end
.
popsection
arch/arm64/include/asm/uaccess.h
浏览文件 @
2692a71b
...
...
@@ -278,14 +278,16 @@ static inline unsigned long __must_check __copy_to_user(void __user *to, const v
static
inline
unsigned
long
__must_check
copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
unsigned
long
res
=
n
;
kasan_check_write
(
to
,
n
);
if
(
access_ok
(
VERIFY_READ
,
from
,
n
))
{
check_object_size
(
to
,
n
,
false
);
n
=
__arch_copy_from_user
(
to
,
from
,
n
);
}
else
/* security hole - plug it */
memset
(
to
,
0
,
n
);
return
n
;
res
=
__arch_copy_from_user
(
to
,
from
,
n
);
}
if
(
unlikely
(
res
))
memset
(
to
+
(
n
-
res
),
0
,
res
);
return
res
;
}
static
inline
unsigned
long
__must_check
copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
...
...
arch/arm64/lib/copy_from_user.S
浏览文件 @
2692a71b
...
...
@@ -79,11 +79,6 @@ ENDPROC(__arch_copy_from_user)
.
section
.
fixup
,
"ax"
.
align
2
9998
:
sub
x0
,
end
,
dst
9999
:
strb
wzr
,
[
dst
],
#
1
//
zero
remaining
buffer
space
cmp
dst
,
end
b.lo
9999
b
9998
:
sub
x0
,
end
,
dst
//
bytes
not
copied
ret
.
previous
arch/blackfin/include/asm/uaccess.h
浏览文件 @
2692a71b
...
...
@@ -163,18 +163,29 @@ static inline int bad_user_access_length(void)
: "a" (__ptr(ptr))); \
})
#define __copy_from_user(to, from, n) copy_from_user(to, from, n)
#define __copy_to_user(to, from, n) copy_to_user(to, from, n)
#define __copy_to_user_inatomic __copy_to_user
#define __copy_from_user_inatomic __copy_from_user
static
inline
unsigned
long
__must_check
__copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
memcpy
(
to
,
(
const
void
__force
*
)
from
,
n
);
return
0
;
}
static
inline
unsigned
long
__must_check
__copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
{
memcpy
((
void
__force
*
)
to
,
from
,
n
);
SSYNC
();
return
0
;
}
static
inline
unsigned
long
__must_check
copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
if
(
likely
(
access_ok
(
VERIFY_READ
,
from
,
n
)))
{
memcpy
(
to
,
(
const
void
__force
*
)
from
,
n
);
return
0
;
}
if
(
likely
(
access_ok
(
VERIFY_READ
,
from
,
n
)))
return
__copy_from_user
(
to
,
from
,
n
);
memset
(
to
,
0
,
n
);
return
n
;
}
...
...
@@ -182,12 +193,9 @@ copy_from_user(void *to, const void __user *from, unsigned long n)
static
inline
unsigned
long
__must_check
copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
{
if
(
access_ok
(
VERIFY_WRITE
,
to
,
n
))
memcpy
((
void
__force
*
)
to
,
from
,
n
);
else
return
n
;
SSYNC
();
return
0
;
if
(
likely
(
access_ok
(
VERIFY_WRITE
,
to
,
n
)))
return
__copy_to_user
(
to
,
from
,
n
);
return
n
;
}
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录