android_kernel_oneplus_msm8998/arch/powerpc
Naveen N. Rao a2943ce580 powerpc/signal: Properly handle return value from uprobe_deny_signal()
commit 46725b17f1c6c815a41429259b3f070c01e71bc1 upstream.

When a uprobe is installed on an instruction that we currently do not
emulate, we copy the instruction into a xol buffer and single step
that instruction. If that instruction generates a fault, we abort the
single stepping before invoking the signal handler. Once the signal
handler is done, the uprobe trap is hit again since the instruction is
retried and the process repeats.

We use uprobe_deny_signal() to detect if the xol instruction triggered
a signal. If so, we clear TIF_SIGPENDING and set TIF_UPROBE so that the
signal is not handled until after the single stepping is aborted. In
this case, uprobe_deny_signal() returns true and get_signal() ends up
returning 0. However, in do_signal(), we are not looking at the return
value, but depending on ksig.sig for further action, all with an
uninitialized ksig that is not touched in this scenario. Fix the same
by initializing ksig.sig to 0.

Fixes: 129b69df9c ("powerpc: Use get_signal() signal_setup_done()")
Reported-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-30 08:37:24 +00:00
..
boot powerpc/corenet: explicitly disable the SDHC controller on kmcoge4 2017-11-15 17:13:09 +01:00
configs powerpc updates for 4.4 2015-11-05 23:38:43 -08:00
crypto crypto: powerpc/md5 - use md5 IV MD5_HX instead of their raw value 2015-05-18 12:20:20 +08:00
include Revert "powerpc/numa: Fix percpu allocations to be NUMA aware" 2017-08-06 19:19:40 -07:00
kernel powerpc/signal: Properly handle return value from uprobe_deny_signal() 2017-11-30 08:37:24 +00:00
kvm KVM: PPC: Book 3S: XICS: correct the real mode ICP rejecting counter 2017-11-15 17:13:09 +01:00
lib powerpc: Fix emulation of mfocrf in emulate_step() 2017-07-27 15:06:05 -07:00
math-emu
mm powerpc/slb: Force a full SLB flush when we insert for a bad EA 2017-06-29 12:48:52 +02:00
net net: filter: make JITs zero A for SKF_AD_ALU_XOR_X 2016-01-06 00:43:52 -05:00
oprofile powerpc: Remove mtmsrd(), use existing mtmsr() 2015-07-13 15:47:28 +10:00
perf powerpc updates for 4.4 2015-11-05 23:38:43 -08:00
platforms powerpc/pseries: Fix parent_dn reference leak in add_dt_node() 2017-10-05 09:41:45 +02:00
sysdev Merge branch 'for-4.4/io-poll' of git://git.kernel.dk/linux-block 2015-11-10 17:23:49 -08:00
xmon powerpc/xmon: Add some more elements to the existing PACA dump list 2015-10-15 20:32:02 +11:00
Kconfig security/keys: add CONFIG_KEYS_COMPAT to Kconfig 2017-11-18 11:11:07 +01:00
Kconfig.debug powerpc: Make STRICT_MM_TYPECHECKS a config option 2015-05-11 19:53:59 +10:00
Makefile powerpc/cell: Drop CONFIG_TUNE_CELL in favour of CONFIG_CELL_CPU 2015-10-19 19:51:18 +11:00
relocs_check.sh