kernel-hacking-2024-linux-s.../arch/unicore32/kernel
Eric W. Biederman d8f7f3228a signal/unicore32: Use FPE_FLTUNK instead of 0 in ucf64_raise_sigfpe
The si_code of 0 (aka SI_USER) has fields si_pid and si_uid not
si_addr so it so only by luck would the appropriate fields by copied
to userspace by copy_siginfo_to_user.

This is just broken and wrong.

Make it obvious what is happening by moving the si_code from a
parameter of the one call to ucf64_raise_sigfpe to a constant value
that info.si_code gets set to.

Explicitly set the si_code to FPE_FLTUNK the newly reserved floating
point si_code for an unknown floating point exception.

It looks like there is a fair chance that this is a code path that has
never been used in real life on unicore32.  The bad si_code and the
print statement that calls it an unhandled exception.  So I really
don't expect anyone will mind if this just gets fixed.

In similar situations on more popular architectures the conclusion was
just fix it.

Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Arnd Bergmann <arnd@arndb.de>
Fixes: d9bc15794d ("unicore32 additional architecture files: float point handling")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2018-04-25 10:40:56 -05:00
..
asm-offsets.c
clock.c
debug-macro.S
debug.S
dma.c
early_printk.c
elf.c
entry.S
fpu-ucf64.c signal/unicore32: Use FPE_FLTUNK instead of 0 in ucf64_raise_sigfpe 2018-04-25 10:40:56 -05:00
gpio.c unicore32: use the new LED disk activity trigger 2016-06-27 08:58:42 +02:00
head.S
hibernate.c
hibernate_asm.S
irq.c
ksyms.c unicore32: get rid of zeroing and switch to RAW_COPY_USER 2017-03-28 18:24:04 -04:00
ksyms.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
module.c
pci.c unicore32/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks 2017-08-03 16:29:34 -05:00
pm.c
process.c unicore32: do not use print_symbol() 2018-01-05 15:21:10 +01:00
ptrace.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
puv3-core.c
puv3-nb0916.c
setup.c
setup.h
signal.c
sleep.S
stacktrace.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/debug.h> 2017-03-02 08:42:34 +01:00
sys.c
time.c unicore32/time: Set ->min_delta_ticks and ->max_delta_ticks 2017-04-14 13:11:22 -07:00
traps.c kernel/exit.c: export abort() to modules 2018-01-04 16:45:09 -08:00
vmlinux.lds.S nmi_backtrace: generate one-line reports for idle cpus 2016-10-07 18:46:30 -07:00