linux/arch/mips
Maciej W. Rozycki 547da67317 MIPS: Fix an n32 core file generation regset support regression
Fix a commit 7aeb753b53 ("MIPS: Implement task_user_regset_view.")
regression, then activated by commit 6a9c001b7e ("MIPS: Switch ELF
core dumper to use regsets.)", that caused n32 processes to dump o32
core files by failing to set the EF_MIPS_ABI2 flag in the ELF core file
header's `e_flags' member:

$ file tls-core
tls-core: ELF 32-bit MSB executable, MIPS, N32 MIPS64 rel2 version 1 (SYSV), [...]
$ ./tls-core
Aborted (core dumped)
$ file core
core: ELF 32-bit MSB core file MIPS, MIPS-I version 1 (SYSV), SVR4-style
$

Previously the flag was set as the result of a:

statement placed in arch/mips/kernel/binfmt_elfn32.c, however in the
regset case, i.e. when CORE_DUMP_USE_REGSET is set, ELF_CORE_EFLAGS is
no longer used by `fill_note_info' in fs/binfmt_elf.c, and instead the
`->e_flags' member of the regset view chosen is.  We have the views
defined in arch/mips/kernel/ptrace.c, however only an o32 and an n64
one, and the latter is used for n32 as well.  Consequently an o32 core
file is incorrectly dumped from n32 processes (the ELF32 vs ELF64 class
is chosen elsewhere, and the 32-bit one is correctly selected for n32).

Correct the issue then by defining an n32 regset view and using it as
appropriate.  Issue discovered in GDB testing.

Fixes: 7aeb753b53 ("MIPS: Implement task_user_regset_view.")
Signed-off-by: Maciej W. Rozycki <macro@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Djordje Todorovic <djordje.todorovic@rt-rk.com>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # 3.13+
Patchwork: https://patchwork.linux-mips.org/patch/17617/
Signed-off-by: James Hogan <jhogan@kernel.org>
2017-11-09 15:04:57 +00:00
..
alchemy MIPS: Alchemy: make clk_ops const 2017-11-07 18:33:16 +00:00
ar7 MIPS: AR7: allow NULL clock for clk_get_rate 2017-09-06 12:35:21 +02:00
ath25
ath79 MIPS: PCI: Move map_irq() hooks out of initdata 2017-09-19 14:55:26 -05:00
bcm47xx MIPS: BCM47XX: Fix LED inversion for WRT54GSv1 2017-11-07 22:40:31 +00:00
bcm63xx MIPS: BCM63XX: split out swpkt_sar/usb clocks 2017-11-07 18:33:20 +00:00
bmips MIPS: BMIPS: Support APPENDED_DTB 2016-10-06 17:31:02 +02:00
boot MIPS: generic: Add support for MIPSfpga 2017-11-08 22:53:44 +00:00
cavium-octeon MIPS: Octeon: Remove usage of cvmx_wait() everywhere. 2017-11-07 18:33:14 +00:00
cobalt MIPS: Cobalt: Fix typo 2016-08-03 08:16:30 +02:00
configs MIPS: Xilfpga: Switch to using generic defconfigs 2017-11-08 22:54:14 +00:00
dec MIPS: DEC: Fix an int-handler.S CPU_DADDI_WORKAROUNDS regression 2017-08-07 16:31:03 +02:00
emma MIPS: Avoid old-style declaration 2017-01-25 02:51:11 +01:00
fw MIPS: SMP: Constify smp ops 2017-08-29 15:21:50 +02:00
generic MIPS: generic: Add support for MIPSfpga 2017-11-08 22:53:44 +00:00
include MIPS: Fix MIPS64 FP save/restore on 32-bit kernels 2017-11-09 14:13:40 +00:00
jazz MIPS: Audit and remove any unnecessary uses of module.h 2017-02-14 09:00:25 +00:00
jz4740 MIPS: jz4740: Remove custom GPIO code 2017-05-22 17:26:34 +02:00
kernel MIPS: Fix an n32 core file generation regset support regression 2017-11-09 15:04:57 +00:00
kvm kvm,mips: Fix potential swait_active() races 2017-09-15 16:57:13 +02:00
lantiq MIPS: Lantiq: Fix ASC0/ASC1 clocks 2017-11-07 22:40:15 +00:00
lasat MIPS: Lasat: Use setup_timer() helper 2017-11-08 22:12:15 +00:00
lib MIPS: Add __ioread64_copy 2017-09-04 13:53:14 +02:00
loongson32 MIPS: clockevent drivers: Set ->min_delta_ticks and ->max_delta_ticks 2017-04-14 13:11:16 -07:00
loongson64 MIPS: Loongson 2F: allow NULL clock for clk_get_rate 2017-09-06 12:36:59 +02:00
math-emu MIPS: math-emu: Use preferred flavor of unsigned integer declarations 2017-11-07 18:33:16 +00:00
mm MIPS: Remove unused variable 'lastpfn' 2017-10-09 14:53:57 +02:00
mti-malta irqchip: mips-gic: Move gic_get_c0_*_int() to asm/mips-gic.h 2017-09-04 13:53:14 +02:00
net MIPS,bpf: fix missing break in switch statement 2017-08-22 16:18:00 -07:00
netlogic Merge branch '4.14-features' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2017-09-15 20:43:33 -07:00
oprofile MIPS: Abstract CPU core & VP(E) ID access through accessor functions 2017-08-30 00:57:26 +02:00
paravirt MIPS: SMP: Allow boot_secondary SMP op to return errors 2017-08-30 00:57:27 +02:00
pci MIPS: Octeon: Remove usage of cvmx_wait() everywhere. 2017-11-07 18:33:14 +00:00
pic32 clocksource/drivers: Rename clocksource_probe to timer_probe 2017-06-14 11:59:16 +02:00
pistachio MIPS: Remove unnecessary inclusions of linux/irqchip/mips-gic.h 2017-09-04 13:53:14 +02:00
pmcs-msp71xx MIPS: MSP71xx: Include asm/setup.h 2017-09-21 16:15:17 +02:00
pnx833x mtd: nand: Rename nand.h into rawnand.h 2017-08-13 10:11:49 +02:00
power
ralink MIPS: ralink: Drop obsolete USB_ARCH_HAS_HCD select 2017-11-08 10:23:36 +00:00
rb532 mtd: nand: Rename nand.h into rawnand.h 2017-08-13 10:11:49 +02:00
sgi-ip22 mips: sgi-ip22: ecard: use dev_groups and not dev_attrs for bus_type 2017-06-09 11:00:45 +02:00
sgi-ip27 MIPS: SMP: Allow boot_secondary SMP op to return errors 2017-08-30 00:57:27 +02:00
sgi-ip32 MIPS: Add missing include files 2017-03-08 10:38:06 +01:00
sibyte MIPS: SMP: Allow boot_secondary SMP op to return errors 2017-08-30 00:57:27 +02:00
sni char/genrtc: remove asm-generic/rtc.h from mips 2016-06-04 00:23:36 +02:00
tools MIPS: generic: Allow filtering enabled boards by requirements 2017-08-30 00:57:28 +02:00
txx9 MIPS: PCI: Move map_irq() hooks out of initdata 2017-09-19 14:55:26 -05:00
vdso MIPS: Add DWARF unwinding to assembly 2017-09-06 11:01:52 +02:00
vr41xx MIPS: Audit and remove any unnecessary uses of module.h 2017-02-14 09:00:25 +00:00
Kbuild MIPS: Disable Werror when W= is set 2017-04-10 11:56:07 +02:00
Kbuild.platforms MIPS: Xilfpga: Switch to using generic defconfigs 2017-11-08 22:54:14 +00:00
Kconfig MIPS: Xilfpga: Switch to using generic defconfigs 2017-11-08 22:54:14 +00:00
Kconfig.debug MIPS: Sibyte: Fix Kconfig warning. 2017-04-21 03:34:01 +02:00
Makefile MIPS: Xilfpga: Switch to using generic defconfigs 2017-11-08 22:54:14 +00:00
Makefile.postlink MIPS: Fix distclean with Makefile.postlink 2017-02-13 18:57:34 +00:00