Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
9b56d543
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9b56d543
编写于
10月 08, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dump_skip(): dump_seek() replacement taking coredump_params
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
2507a4fb
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
22 addition
and
43 deletion
+22
-43
arch/x86/ia32/ia32_aout.c
arch/x86/ia32/ia32_aout.c
+1
-1
fs/binfmt_aout.c
fs/binfmt_aout.c
+1
-1
fs/binfmt_elf.c
fs/binfmt_elf.c
+2
-2
fs/binfmt_elf_fdpic.c
fs/binfmt_elf_fdpic.c
+3
-8
fs/coredump.c
fs/coredump.c
+14
-29
include/linux/coredump.h
include/linux/coredump.h
+1
-2
未找到文件。
arch/x86/ia32/ia32_aout.c
浏览文件 @
9b56d543
...
...
@@ -187,7 +187,7 @@ static int aout_core_dump(struct coredump_params *cprm)
if
(
!
dump_emit
(
cprm
,
&
dump
,
sizeof
(
dump
)))
goto
end_coredump
;
/* Now dump all of the user data. Include malloced stuff as well */
if
(
!
dump_s
eek
(
cprm
->
file
,
PAGE_SIZE
-
sizeof
(
dump
)))
if
(
!
dump_s
kip
(
cprm
,
PAGE_SIZE
-
sizeof
(
dump
)))
goto
end_coredump
;
/* now we start writing out the user space info */
set_fs
(
USER_DS
);
...
...
fs/binfmt_aout.c
浏览文件 @
9b56d543
...
...
@@ -87,7 +87,7 @@ static int aout_core_dump(struct coredump_params *cprm)
if
(
!
dump_emit
(
cprm
,
&
dump
,
sizeof
(
dump
)))
goto
end_coredump
;
/* Now dump all of the user data. Include malloced stuff as well */
if
(
!
dump_s
eek
(
cprm
->
file
,
PAGE_SIZE
-
sizeof
(
dump
)))
if
(
!
dump_s
kip
(
cprm
,
PAGE_SIZE
-
sizeof
(
dump
)))
goto
end_coredump
;
/* now we start writing out the user space info */
set_fs
(
USER_DS
);
...
...
fs/binfmt_elf.c
浏览文件 @
9b56d543
...
...
@@ -2162,7 +2162,7 @@ static int elf_core_dump(struct coredump_params *cprm)
goto
end_coredump
;
/* Align to page */
if
(
!
dump_s
eek
(
cprm
->
file
,
dataoff
-
cprm
->
written
))
if
(
!
dump_s
kip
(
cprm
,
dataoff
-
cprm
->
written
))
goto
end_coredump
;
for
(
vma
=
first_vma
(
current
,
gate_vma
);
vma
!=
NULL
;
...
...
@@ -2183,7 +2183,7 @@ static int elf_core_dump(struct coredump_params *cprm)
kunmap
(
page
);
page_cache_release
(
page
);
}
else
stop
=
!
dump_s
eek
(
cprm
->
file
,
PAGE_SIZE
);
stop
=
!
dump_s
kip
(
cprm
,
PAGE_SIZE
);
if
(
stop
)
goto
end_coredump
;
}
...
...
fs/binfmt_elf_fdpic.c
浏览文件 @
9b56d543
...
...
@@ -1509,7 +1509,7 @@ static bool elf_fdpic_dump_segments(struct coredump_params *cprm)
kunmap
(
page
);
page_cache_release
(
page
);
}
else
{
res
=
dump_s
eek
(
file
,
PAGE_SIZE
);
res
=
dump_s
kip
(
cprm
,
PAGE_SIZE
);
}
if
(
!
res
)
return
false
;
...
...
@@ -1547,11 +1547,10 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
int
has_dumped
=
0
;
mm_segment_t
fs
;
int
segs
;
size_t
size
=
0
;
int
i
;
struct
vm_area_struct
*
vma
;
struct
elfhdr
*
elf
=
NULL
;
loff_t
offset
=
0
,
dataoff
,
foffset
;
loff_t
offset
=
0
,
dataoff
;
int
numnote
;
struct
memelfnote
*
notes
=
NULL
;
struct
elf_prstatus
*
prstatus
=
NULL
;
/* NT_PRSTATUS */
...
...
@@ -1682,7 +1681,6 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
offset
+=
sizeof
(
*
elf
);
/* Elf header */
offset
+=
segs
*
sizeof
(
struct
elf_phdr
);
/* Program headers */
foffset
=
offset
;
/* Write notes phdr entry */
{
...
...
@@ -1751,8 +1749,6 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
if
(
!
elf_core_write_extra_phdrs
(
cprm
,
offset
))
goto
end_coredump
;
size
=
cprm
->
written
;
cprm
->
written
=
foffset
;
/* write out the notes section */
for
(
i
=
0
;
i
<
numnote
;
i
++
)
if
(
!
writenote
(
notes
+
i
,
cprm
))
...
...
@@ -1768,10 +1764,9 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
goto
end_coredump
;
}
if
(
!
dump_s
eek
(
cprm
->
file
,
dataoff
-
cprm
->
written
))
if
(
!
dump_s
kip
(
cprm
,
dataoff
-
cprm
->
written
))
goto
end_coredump
;
cprm
->
written
=
size
;
if
(
!
elf_fdpic_dump_segments
(
cprm
))
goto
end_coredump
;
...
...
fs/coredump.c
浏览文件 @
9b56d543
...
...
@@ -685,14 +685,6 @@ void do_coredump(siginfo_t *siginfo)
* do on a core-file: use only these functions to write out all the
* necessary info.
*/
int
dump_write
(
struct
file
*
file
,
const
void
*
addr
,
int
nr
)
{
return
!
dump_interrupted
()
&&
access_ok
(
VERIFY_READ
,
addr
,
nr
)
&&
file
->
f_op
->
write
(
file
,
addr
,
nr
,
&
file
->
f_pos
)
==
nr
;
}
EXPORT_SYMBOL
(
dump_write
);
int
dump_emit
(
struct
coredump_params
*
cprm
,
const
void
*
addr
,
int
nr
)
{
struct
file
*
file
=
cprm
->
file
;
...
...
@@ -714,32 +706,25 @@ int dump_emit(struct coredump_params *cprm, const void *addr, int nr)
}
EXPORT_SYMBOL
(
dump_emit
);
int
dump_s
eek
(
struct
file
*
file
,
loff_t
off
)
int
dump_s
kip
(
struct
coredump_params
*
cprm
,
size_t
nr
)
{
int
ret
=
1
;
static
char
zeroes
[
PAGE_SIZE
]
;
struct
file
*
file
=
cprm
->
file
;
if
(
file
->
f_op
->
llseek
&&
file
->
f_op
->
llseek
!=
no_llseek
)
{
if
(
cprm
->
written
+
nr
>
cprm
->
limit
)
return
0
;
if
(
dump_interrupted
()
||
file
->
f_op
->
llseek
(
file
,
off
,
SEEK_CUR
)
<
0
)
file
->
f_op
->
llseek
(
file
,
nr
,
SEEK_CUR
)
<
0
)
return
0
;
cprm
->
written
+=
nr
;
return
1
;
}
else
{
char
*
buf
=
(
char
*
)
get_zeroed_page
(
GFP_KERNEL
);
if
(
!
buf
)
return
0
;
while
(
off
>
0
)
{
unsigned
long
n
=
off
;
if
(
n
>
PAGE_SIZE
)
n
=
PAGE_SIZE
;
if
(
!
dump_write
(
file
,
buf
,
n
))
{
ret
=
0
;
break
;
}
off
-=
n
;
while
(
nr
>
PAGE_SIZE
)
{
if
(
!
dump_emit
(
cprm
,
zeroes
,
PAGE_SIZE
))
return
0
;
nr
-=
PAGE_SIZE
;
}
free_page
((
unsigned
long
)
buf
);
return
dump_emit
(
cprm
,
zeroes
,
nr
);
}
return
ret
;
}
EXPORT_SYMBOL
(
dump_s
eek
);
EXPORT_SYMBOL
(
dump_s
kip
);
include/linux/coredump.h
浏览文件 @
9b56d543
...
...
@@ -11,8 +11,7 @@
* functions to write out all the necessary info.
*/
struct
coredump_params
;
extern
int
dump_write
(
struct
file
*
file
,
const
void
*
addr
,
int
nr
);
extern
int
dump_seek
(
struct
file
*
file
,
loff_t
off
);
extern
int
dump_skip
(
struct
coredump_params
*
cprm
,
size_t
nr
);
extern
int
dump_emit
(
struct
coredump_params
*
cprm
,
const
void
*
addr
,
int
nr
);
#ifdef CONFIG_COREDUMP
extern
void
do_coredump
(
siginfo_t
*
siginfo
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录