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
13046ece
Commit
13046ece
authored
Oct 05, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
binfmt_elf: convert writing actual dump pages to dump_emit()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
aa3e7eaf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
fs/binfmt_elf.c
fs/binfmt_elf.c
+3
-11
No files found.
fs/binfmt_elf.c
View file @
13046ece
...
...
@@ -2093,7 +2093,6 @@ static int elf_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 */
{
...
...
@@ -2157,7 +2156,6 @@ static int elf_core_dump(struct coredump_params *cprm)
goto
end_coredump
;
size
=
cprm
->
written
;
cprm
->
written
=
foffset
;
/* will disappear */
/* write out the notes section */
if
(
!
write_note_info
(
&
info
,
cprm
))
goto
end_coredump
;
...
...
@@ -2170,6 +2168,7 @@ static int elf_core_dump(struct coredump_params *cprm)
if
(
!
dump_seek
(
cprm
->
file
,
dataoff
-
foffset
))
goto
end_coredump
;
cprm
->
written
=
size
;
for
(
vma
=
first_vma
(
current
,
gate_vma
);
vma
!=
NULL
;
vma
=
next_vma
(
vma
,
gate_vma
))
{
unsigned
long
addr
;
...
...
@@ -2184,9 +2183,7 @@ static int elf_core_dump(struct coredump_params *cprm)
page
=
get_dump_page
(
addr
);
if
(
page
)
{
void
*
kaddr
=
kmap
(
page
);
stop
=
((
size
+=
PAGE_SIZE
)
>
cprm
->
limit
)
||
!
dump_write
(
cprm
->
file
,
kaddr
,
PAGE_SIZE
);
stop
=
!
dump_emit
(
cprm
,
kaddr
,
PAGE_SIZE
);
kunmap
(
page
);
page_cache_release
(
page
);
}
else
...
...
@@ -2196,16 +2193,11 @@ static int elf_core_dump(struct coredump_params *cprm)
}
}
cprm
->
written
=
size
;
if
(
!
elf_core_write_extra_data
(
cprm
))
goto
end_coredump
;
size
=
cprm
->
written
;
if
(
e_phnum
==
PN_XNUM
)
{
size
+=
sizeof
(
*
shdr4extnum
);
if
(
size
>
cprm
->
limit
||
!
dump_write
(
cprm
->
file
,
shdr4extnum
,
sizeof
(
*
shdr4extnum
)))
if
(
!
dump_emit
(
cprm
,
shdr4extnum
,
sizeof
(
*
shdr4extnum
)))
goto
end_coredump
;
}
...
...
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