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
506f21c5
Commit
506f21c5
authored
Oct 05, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch elf_core_write_extra_phdrs() to dump_emit()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
ecc8c772
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
21 deletions
+15
-21
arch/ia64/kernel/elfcore.c
arch/ia64/kernel/elfcore.c
+2
-4
arch/x86/um/elfcore.c
arch/x86/um/elfcore.c
+2
-5
fs/binfmt_elf.c
fs/binfmt_elf.c
+2
-2
fs/binfmt_elf_fdpic.c
fs/binfmt_elf_fdpic.c
+3
-1
include/linux/elfcore.h
include/linux/elfcore.h
+3
-2
kernel/elfcore.c
kernel/elfcore.c
+3
-7
No files found.
arch/ia64/kernel/elfcore.c
View file @
506f21c5
...
@@ -11,8 +11,7 @@ Elf64_Half elf_core_extra_phdrs(void)
...
@@ -11,8 +11,7 @@ Elf64_Half elf_core_extra_phdrs(void)
return
GATE_EHDR
->
e_phnum
;
return
GATE_EHDR
->
e_phnum
;
}
}
int
elf_core_write_extra_phdrs
(
struct
file
*
file
,
loff_t
offset
,
size_t
*
size
,
int
elf_core_write_extra_phdrs
(
struct
coredump_params
*
cprm
,
loff_t
offset
)
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
);
...
@@ -35,8 +34,7 @@ int elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
...
@@ -35,8 +34,7 @@ int elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
phdr
.
p_offset
+=
ofs
;
phdr
.
p_offset
+=
ofs
;
}
}
phdr
.
p_paddr
=
0
;
/* match other core phdrs */
phdr
.
p_paddr
=
0
;
/* match other core phdrs */
*
size
+=
sizeof
(
phdr
);
if
(
!
dump_emit
(
cprm
,
&
phdr
,
sizeof
(
phdr
)))
if
(
*
size
>
limit
||
!
dump_write
(
file
,
&
phdr
,
sizeof
(
phdr
)))
return
0
;
return
0
;
}
}
return
1
;
return
1
;
...
...
arch/x86/um/elfcore.c
View file @
506f21c5
...
@@ -11,8 +11,7 @@ Elf32_Half elf_core_extra_phdrs(void)
...
@@ -11,8 +11,7 @@ Elf32_Half elf_core_extra_phdrs(void)
return
vsyscall_ehdr
?
(((
struct
elfhdr
*
)
vsyscall_ehdr
)
->
e_phnum
)
:
0
;
return
vsyscall_ehdr
?
(((
struct
elfhdr
*
)
vsyscall_ehdr
)
->
e_phnum
)
:
0
;
}
}
int
elf_core_write_extra_phdrs
(
struct
file
*
file
,
loff_t
offset
,
size_t
*
size
,
int
elf_core_write_extra_phdrs
(
struct
coredump_params
*
cprm
,
loff_t
offset
)
unsigned
long
limit
)
{
{
if
(
vsyscall_ehdr
)
{
if
(
vsyscall_ehdr
)
{
const
struct
elfhdr
*
const
ehdrp
=
const
struct
elfhdr
*
const
ehdrp
=
...
@@ -32,9 +31,7 @@ int elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
...
@@ -32,9 +31,7 @@ int elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
phdr
.
p_offset
+=
ofs
;
phdr
.
p_offset
+=
ofs
;
}
}
phdr
.
p_paddr
=
0
;
/* match other core phdrs */
phdr
.
p_paddr
=
0
;
/* match other core phdrs */
*
size
+=
sizeof
(
phdr
);
if
(
!
dump_emit
(
cprm
,
&
phdr
,
sizeof
(
phdr
)))
if
(
*
size
>
limit
||
!
dump_write
(
file
,
&
phdr
,
sizeof
(
phdr
)))
return
0
;
return
0
;
}
}
}
}
...
...
fs/binfmt_elf.c
View file @
506f21c5
...
@@ -2152,11 +2152,11 @@ static int elf_core_dump(struct coredump_params *cprm)
...
@@ -2152,11 +2152,11 @@ static int elf_core_dump(struct coredump_params *cprm)
if
(
!
dump_emit
(
cprm
,
&
phdr
,
sizeof
(
phdr
)))
if
(
!
dump_emit
(
cprm
,
&
phdr
,
sizeof
(
phdr
)))
goto
end_coredump
;
goto
end_coredump
;
}
}
size
=
cprm
->
written
;
if
(
!
elf_core_write_extra_phdrs
(
cprm
->
file
,
offset
,
&
size
,
cprm
->
limi
t
))
if
(
!
elf_core_write_extra_phdrs
(
cprm
,
offse
t
))
goto
end_coredump
;
goto
end_coredump
;
size
=
cprm
->
written
;
cprm
->
written
=
foffset
;
/* will disappear */
cprm
->
written
=
foffset
;
/* will disappear */
/* write out the notes section */
/* write out the notes section */
if
(
!
write_note_info
(
&
info
,
cprm
))
if
(
!
write_note_info
(
&
info
,
cprm
))
...
...
fs/binfmt_elf_fdpic.c
View file @
506f21c5
...
@@ -1791,9 +1791,11 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
...
@@ -1791,9 +1791,11 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
goto
end_coredump
;
goto
end_coredump
;
}
}
if
(
!
elf_core_write_extra_phdrs
(
cprm
->
file
,
offset
,
&
size
,
cprm
->
limit
))
cprm
->
written
=
size
;
if
(
!
elf_core_write_extra_phdrs
(
cprm
,
offset
))
goto
end_coredump
;
goto
end_coredump
;
size
=
cprm
->
written
;
/* write out the notes section */
/* write out the notes section */
for
(
i
=
0
;
i
<
numnote
;
i
++
)
for
(
i
=
0
;
i
<
numnote
;
i
++
)
if
(
!
writenote
(
notes
+
i
,
cprm
->
file
,
&
foffset
))
if
(
!
writenote
(
notes
+
i
,
cprm
->
file
,
&
foffset
))
...
...
include/linux/elfcore.h
View file @
506f21c5
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
#include <asm/elf.h>
#include <asm/elf.h>
#include <uapi/linux/elfcore.h>
#include <uapi/linux/elfcore.h>
struct
coredump_params
;
static
inline
void
elf_core_copy_regs
(
elf_gregset_t
*
elfregs
,
struct
pt_regs
*
regs
)
static
inline
void
elf_core_copy_regs
(
elf_gregset_t
*
elfregs
,
struct
pt_regs
*
regs
)
{
{
#ifdef ELF_CORE_COPY_REGS
#ifdef ELF_CORE_COPY_REGS
...
@@ -63,8 +65,7 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse
...
@@ -63,8 +65,7 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse
*/
*/
extern
Elf_Half
elf_core_extra_phdrs
(
void
);
extern
Elf_Half
elf_core_extra_phdrs
(
void
);
extern
int
extern
int
elf_core_write_extra_phdrs
(
struct
file
*
file
,
loff_t
offset
,
size_t
*
size
,
elf_core_write_extra_phdrs
(
struct
coredump_params
*
cprm
,
loff_t
offset
);
unsigned
long
limit
);
extern
int
extern
int
elf_core_write_extra_data
(
struct
file
*
file
,
size_t
*
size
,
unsigned
long
limit
);
elf_core_write_extra_data
(
struct
file
*
file
,
size_t
*
size
,
unsigned
long
limit
);
extern
size_t
elf_core_extra_data_size
(
void
);
extern
size_t
elf_core_extra_data_size
(
void
);
...
...
kernel/elfcore.c
View file @
506f21c5
#include <linux/elf.h>
#include <linux/elf.h>
#include <linux/fs.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/mm.h>
#include <linux/binfmts.h>
#include <asm/elf.h>
Elf_Half
__weak
elf_core_extra_phdrs
(
void
)
Elf_Half
__weak
elf_core_extra_phdrs
(
void
)
{
{
return
0
;
return
0
;
}
}
int
__weak
elf_core_write_extra_phdrs
(
struct
file
*
file
,
loff_t
offset
,
size_t
*
size
,
int
__weak
elf_core_write_extra_phdrs
(
struct
coredump_params
*
cprm
,
loff_t
offset
)
unsigned
long
limit
)
{
{
return
1
;
return
1
;
}
}
int
__weak
elf_core_write_extra_data
(
struct
file
*
file
,
size_t
*
size
,
int
__weak
elf_core_write_extra_data
(
struct
coredump_params
*
cprm
)
unsigned
long
limit
)
{
{
return
1
;
return
1
;
}
}
...
...
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