Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
e35ac62d
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看板
提交
e35ac62d
编写于
8月 03, 2013
作者:
R
Russell King
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'security-fixes' into fixes
上级
24195cad
8c0cc8a5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
31 addition
and
28 deletion
+31
-28
arch/arm/include/asm/elf.h
arch/arm/include/asm/elf.h
+2
-0
arch/arm/kernel/process.c
arch/arm/kernel/process.c
+5
-4
arch/arm/kernel/signal.c
arch/arm/kernel/signal.c
+24
-24
未找到文件。
arch/arm/include/asm/elf.h
浏览文件 @
e35ac62d
...
...
@@ -130,8 +130,10 @@ struct mm_struct;
extern
unsigned
long
arch_randomize_brk
(
struct
mm_struct
*
mm
);
#define arch_randomize_brk arch_randomize_brk
#ifdef CONFIG_MMU
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
struct
linux_binprm
;
int
arch_setup_additional_pages
(
struct
linux_binprm
*
,
int
);
#endif
#endif
arch/arm/kernel/process.c
浏览文件 @
e35ac62d
...
...
@@ -474,17 +474,18 @@ const char *arch_vma_name(struct vm_area_struct *vma)
"[sigpage]"
:
NULL
;
}
static
struct
page
*
signal_page
;
extern
struct
page
*
get_signal_page
(
void
);
int
arch_setup_additional_pages
(
struct
linux_binprm
*
bprm
,
int
uses_interp
)
{
struct
mm_struct
*
mm
=
current
->
mm
;
struct
page
*
page
;
unsigned
long
addr
;
int
ret
;
page
=
get_signal_page
();
if
(
!
page
)
if
(
!
signal_page
)
signal_page
=
get_signal_page
();
if
(
!
signal_page
)
return
-
ENOMEM
;
down_write
(
&
mm
->
mmap_sem
);
...
...
@@ -496,7 +497,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
ret
=
install_special_mapping
(
mm
,
addr
,
PAGE_SIZE
,
VM_READ
|
VM_EXEC
|
VM_MAYREAD
|
VM_MAYWRITE
|
VM_MAYEXEC
,
&
page
);
&
signal_
page
);
if
(
ret
==
0
)
mm
->
context
.
sigpage
=
addr
;
...
...
arch/arm/kernel/signal.c
浏览文件 @
e35ac62d
...
...
@@ -402,7 +402,8 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,
__put_user
(
sigreturn_codes
[
idx
+
1
],
rc
+
1
))
return
1
;
if
((
cpsr
&
MODE32_BIT
)
&&
!
IS_ENABLED
(
CONFIG_ARM_MPU
))
{
#ifdef CONFIG_MMU
if
(
cpsr
&
MODE32_BIT
)
{
struct
mm_struct
*
mm
=
current
->
mm
;
/*
...
...
@@ -412,7 +413,9 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,
*/
retcode
=
mm
->
context
.
sigpage
+
signal_return_offset
+
(
idx
<<
2
)
+
thumb
;
}
else
{
}
else
#endif
{
/*
* Ensure that the instruction cache sees
* the return code written onto the stack.
...
...
@@ -614,35 +617,32 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
return
0
;
}
static
struct
page
*
signal_page
;
struct
page
*
get_signal_page
(
void
)
{
if
(
!
signal_page
)
{
unsigned
long
ptr
;
unsigned
offset
;
void
*
addr
;
unsigned
long
ptr
;
unsigned
offset
;
struct
page
*
page
;
void
*
addr
;
signal_
page
=
alloc_pages
(
GFP_KERNEL
,
0
);
page
=
alloc_pages
(
GFP_KERNEL
,
0
);
if
(
!
signal_
page
)
return
NULL
;
if
(
!
page
)
return
NULL
;
addr
=
page_address
(
signal_
page
);
addr
=
page_address
(
page
);
/* Give the signal return code some randomness */
offset
=
0x200
+
(
get_random_int
()
&
0x7fc
);
signal_return_offset
=
offset
;
/* Give the signal return code some randomness */
offset
=
0x200
+
(
get_random_int
()
&
0x7fc
);
signal_return_offset
=
offset
;
/*
* Copy signal return handlers into the vector page, and
* set sigreturn to be a pointer to these.
*/
memcpy
(
addr
+
offset
,
sigreturn_codes
,
sizeof
(
sigreturn_codes
));
/*
* Copy signal return handlers into the vector page, and
* set sigreturn to be a pointer to these.
*/
memcpy
(
addr
+
offset
,
sigreturn_codes
,
sizeof
(
sigreturn_codes
));
ptr
=
(
unsigned
long
)
addr
+
offset
;
flush_icache_range
(
ptr
,
ptr
+
sizeof
(
sigreturn_codes
));
}
ptr
=
(
unsigned
long
)
addr
+
offset
;
flush_icache_range
(
ptr
,
ptr
+
sizeof
(
sigreturn_codes
));
return
signal_
page
;
return
page
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录