diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-10-04 20:15:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-05 14:05:16 -0400 |
commit | 5ab1c309b344880d81494e9eab7fb27682bc6d9d (patch) | |
tree | 9509df6703c921d268db3b4b52c29992bcc24e35 /fs/binfmt_elf.c | |
parent | 0f4cfb2e4e7a7e4e97a3e90e2ba1062f07fb2cb1 (diff) |
coredump: pass siginfo_t* to do_coredump() and below, not merely signr
This is a preparatory patch for the introduction of NT_SIGINFO elf note.
With this patch we pass "siginfo_t *siginfo" instead of "int signr" to
do_coredump() and put it into coredump_params. It will be used by the
next patch. Most changes are simple s/signr/siginfo->si_signo/.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Cc: Amerigo Wang <amwang@redhat.com>
Cc: "Jonathan M. Foote" <jmfoote@cert.org>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Pedro Alves <palves@redhat.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r-- | fs/binfmt_elf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 7ef5f9fe2729..4450e82a05aa 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c | |||
@@ -1480,7 +1480,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t, | |||
1480 | 1480 | ||
1481 | static int fill_note_info(struct elfhdr *elf, int phdrs, | 1481 | static int fill_note_info(struct elfhdr *elf, int phdrs, |
1482 | struct elf_note_info *info, | 1482 | struct elf_note_info *info, |
1483 | long signr, struct pt_regs *regs) | 1483 | siginfo_t *siginfo, struct pt_regs *regs) |
1484 | { | 1484 | { |
1485 | struct task_struct *dump_task = current; | 1485 | struct task_struct *dump_task = current; |
1486 | const struct user_regset_view *view = task_user_regset_view(dump_task); | 1486 | const struct user_regset_view *view = task_user_regset_view(dump_task); |
@@ -1550,7 +1550,7 @@ static int fill_note_info(struct elfhdr *elf, int phdrs, | |||
1550 | * Now fill in each thread's information. | 1550 | * Now fill in each thread's information. |
1551 | */ | 1551 | */ |
1552 | for (t = info->thread; t != NULL; t = t->next) | 1552 | for (t = info->thread; t != NULL; t = t->next) |
1553 | if (!fill_thread_core_info(t, view, signr, &info->size)) | 1553 | if (!fill_thread_core_info(t, view, siginfo->si_signo, &info->size)) |
1554 | return 0; | 1554 | return 0; |
1555 | 1555 | ||
1556 | /* | 1556 | /* |
@@ -1713,14 +1713,14 @@ static int elf_note_info_init(struct elf_note_info *info) | |||
1713 | 1713 | ||
1714 | static int fill_note_info(struct elfhdr *elf, int phdrs, | 1714 | static int fill_note_info(struct elfhdr *elf, int phdrs, |
1715 | struct elf_note_info *info, | 1715 | struct elf_note_info *info, |
1716 | long signr, struct pt_regs *regs) | 1716 | siginfo_t *siginfo, struct pt_regs *regs) |
1717 | { | 1717 | { |
1718 | struct list_head *t; | 1718 | struct list_head *t; |
1719 | 1719 | ||
1720 | if (!elf_note_info_init(info)) | 1720 | if (!elf_note_info_init(info)) |
1721 | return 0; | 1721 | return 0; |
1722 | 1722 | ||
1723 | if (signr) { | 1723 | if (siginfo->si_signo) { |
1724 | struct core_thread *ct; | 1724 | struct core_thread *ct; |
1725 | struct elf_thread_status *ets; | 1725 | struct elf_thread_status *ets; |
1726 | 1726 | ||
@@ -1738,13 +1738,13 @@ static int fill_note_info(struct elfhdr *elf, int phdrs, | |||
1738 | int sz; | 1738 | int sz; |
1739 | 1739 | ||
1740 | ets = list_entry(t, struct elf_thread_status, list); | 1740 | ets = list_entry(t, struct elf_thread_status, list); |
1741 | sz = elf_dump_thread_status(signr, ets); | 1741 | sz = elf_dump_thread_status(siginfo->si_signo, ets); |
1742 | info->thread_status_size += sz; | 1742 | info->thread_status_size += sz; |
1743 | } | 1743 | } |
1744 | } | 1744 | } |
1745 | /* now collect the dump for the current */ | 1745 | /* now collect the dump for the current */ |
1746 | memset(info->prstatus, 0, sizeof(*info->prstatus)); | 1746 | memset(info->prstatus, 0, sizeof(*info->prstatus)); |
1747 | fill_prstatus(info->prstatus, current, signr); | 1747 | fill_prstatus(info->prstatus, current, siginfo->si_signo); |
1748 | elf_core_copy_regs(&info->prstatus->pr_reg, regs); | 1748 | elf_core_copy_regs(&info->prstatus->pr_reg, regs); |
1749 | 1749 | ||
1750 | /* Set up header */ | 1750 | /* Set up header */ |
@@ -1951,7 +1951,7 @@ static int elf_core_dump(struct coredump_params *cprm) | |||
1951 | * Collect all the non-memory information about the process for the | 1951 | * Collect all the non-memory information about the process for the |
1952 | * notes. This also sets up the file header. | 1952 | * notes. This also sets up the file header. |
1953 | */ | 1953 | */ |
1954 | if (!fill_note_info(elf, e_phnum, &info, cprm->signr, cprm->regs)) | 1954 | if (!fill_note_info(elf, e_phnum, &info, cprm->siginfo, cprm->regs)) |
1955 | goto cleanup; | 1955 | goto cleanup; |
1956 | 1956 | ||
1957 | has_dumped = 1; | 1957 | has_dumped = 1; |