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
Kirill Smelkov
linux
Commits
aa3e7eaf
Commit
aa3e7eaf
authored
Oct 05, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch elf_core_write_extra_data() to dump_emit()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
506f21c5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
13 deletions
+11
-13
arch/ia64/kernel/elfcore.c
arch/ia64/kernel/elfcore.c
+2
-4
arch/x86/um/elfcore.c
arch/x86/um/elfcore.c
+2
-6
fs/binfmt_elf.c
fs/binfmt_elf.c
+3
-1
fs/binfmt_elf_fdpic.c
fs/binfmt_elf_fdpic.c
+3
-1
include/linux/elfcore.h
include/linux/elfcore.h
+1
-1
No files found.
arch/ia64/kernel/elfcore.c
View file @
aa3e7eaf
...
@@ -40,8 +40,7 @@ int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset)
...
@@ -40,8 +40,7 @@ int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset)
return
1
;
return
1
;
}
}
int
elf_core_write_extra_data
(
struct
file
*
file
,
size_t
*
size
,
int
elf_core_write_extra_data
(
struct
coredump_params
*
cprm
)
unsigned
long
limit
)
{
{
const
struct
elf_phdr
*
const
gate_phdrs
=
const
struct
elf_phdr
*
const
gate_phdrs
=
(
const
struct
elf_phdr
*
)
(
GATE_ADDR
+
GATE_EHDR
->
e_phoff
);
(
const
struct
elf_phdr
*
)
(
GATE_ADDR
+
GATE_EHDR
->
e_phoff
);
...
@@ -52,8 +51,7 @@ int elf_core_write_extra_data(struct file *file, size_t *size,
...
@@ -52,8 +51,7 @@ int elf_core_write_extra_data(struct file *file, size_t *size,
void
*
addr
=
(
void
*
)
gate_phdrs
[
i
].
p_vaddr
;
void
*
addr
=
(
void
*
)
gate_phdrs
[
i
].
p_vaddr
;
size_t
memsz
=
PAGE_ALIGN
(
gate_phdrs
[
i
].
p_memsz
);
size_t
memsz
=
PAGE_ALIGN
(
gate_phdrs
[
i
].
p_memsz
);
*
size
+=
memsz
;
if
(
!
dump_emit
(
cprm
,
addr
,
memsz
))
if
(
*
size
>
limit
||
!
dump_write
(
file
,
addr
,
memsz
))
return
0
;
return
0
;
break
;
break
;
}
}
...
...
arch/x86/um/elfcore.c
View file @
aa3e7eaf
...
@@ -38,8 +38,7 @@ int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset)
...
@@ -38,8 +38,7 @@ int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset)
return
1
;
return
1
;
}
}
int
elf_core_write_extra_data
(
struct
file
*
file
,
size_t
*
size
,
int
elf_core_write_extra_data
(
struct
coredump_params
*
cprm
)
unsigned
long
limit
)
{
{
if
(
vsyscall_ehdr
)
{
if
(
vsyscall_ehdr
)
{
const
struct
elfhdr
*
const
ehdrp
=
const
struct
elfhdr
*
const
ehdrp
=
...
@@ -52,10 +51,7 @@ int elf_core_write_extra_data(struct file *file, size_t *size,
...
@@ -52,10 +51,7 @@ int elf_core_write_extra_data(struct file *file, size_t *size,
if
(
phdrp
[
i
].
p_type
==
PT_LOAD
)
{
if
(
phdrp
[
i
].
p_type
==
PT_LOAD
)
{
void
*
addr
=
(
void
*
)
phdrp
[
i
].
p_vaddr
;
void
*
addr
=
(
void
*
)
phdrp
[
i
].
p_vaddr
;
size_t
filesz
=
phdrp
[
i
].
p_filesz
;
size_t
filesz
=
phdrp
[
i
].
p_filesz
;
if
(
!
dump_emit
(
cprm
,
addr
,
filesz
))
*
size
+=
filesz
;
if
(
*
size
>
limit
||
!
dump_write
(
file
,
addr
,
filesz
))
return
0
;
return
0
;
}
}
}
}
...
...
fs/binfmt_elf.c
View file @
aa3e7eaf
...
@@ -2196,8 +2196,10 @@ static int elf_core_dump(struct coredump_params *cprm)
...
@@ -2196,8 +2196,10 @@ static int elf_core_dump(struct coredump_params *cprm)
}
}
}
}
if
(
!
elf_core_write_extra_data
(
cprm
->
file
,
&
size
,
cprm
->
limit
))
cprm
->
written
=
size
;
if
(
!
elf_core_write_extra_data
(
cprm
))
goto
end_coredump
;
goto
end_coredump
;
size
=
cprm
->
written
;
if
(
e_phnum
==
PN_XNUM
)
{
if
(
e_phnum
==
PN_XNUM
)
{
size
+=
sizeof
(
*
shdr4extnum
);
size
+=
sizeof
(
*
shdr4extnum
);
...
...
fs/binfmt_elf_fdpic.c
View file @
aa3e7eaf
...
@@ -1818,8 +1818,10 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
...
@@ -1818,8 +1818,10 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
cprm
->
mm_flags
)
<
0
)
cprm
->
mm_flags
)
<
0
)
goto
end_coredump
;
goto
end_coredump
;
if
(
!
elf_core_write_extra_data
(
cprm
->
file
,
&
size
,
cprm
->
limit
))
cprm
->
written
=
size
;
if
(
!
elf_core_write_extra_data
(
cprm
))
goto
end_coredump
;
goto
end_coredump
;
size
=
cprm
->
written
;
if
(
e_phnum
==
PN_XNUM
)
{
if
(
e_phnum
==
PN_XNUM
)
{
size
+=
sizeof
(
*
shdr4extnum
);
size
+=
sizeof
(
*
shdr4extnum
);
...
...
include/linux/elfcore.h
View file @
aa3e7eaf
...
@@ -67,7 +67,7 @@ extern Elf_Half elf_core_extra_phdrs(void);
...
@@ -67,7 +67,7 @@ extern Elf_Half elf_core_extra_phdrs(void);
extern
int
extern
int
elf_core_write_extra_phdrs
(
struct
coredump_params
*
cprm
,
loff_t
offset
);
elf_core_write_extra_phdrs
(
struct
coredump_params
*
cprm
,
loff_t
offset
);
extern
int
extern
int
elf_core_write_extra_data
(
struct
file
*
file
,
size_t
*
size
,
unsigned
long
limit
);
elf_core_write_extra_data
(
struct
coredump_params
*
cprm
);
extern
size_t
elf_core_extra_data_size
(
void
);
extern
size_t
elf_core_extra_data_size
(
void
);
#endif
/* _LINUX_ELFCORE_H */
#endif
/* _LINUX_ELFCORE_H */
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