]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ARCv2: save ABI registers across signal handling
authorVineet Gupta <vgupta@synopsys.com>
Wed, 9 Jun 2021 02:39:25 +0000 (19:39 -0700)
committerSasha Levin <sashal@kernel.org>
Wed, 30 Jun 2021 12:48:24 +0000 (08:48 -0400)
commitf2f1b3a34f06424b4b67fce30be2347d4fe5a213
tree887d551ae02980061407ba7a46e971b3d8b69a62
parent5489a33c043744f55737ab3eb53949029d1d7f64
ARCv2: save ABI registers across signal handling

commit 96f1b00138cb8f04c742c82d0a7c460b2202e887 upstream.

ARCv2 has some configuration dependent registers (r30, r58, r59) which
could be targetted by the compiler. To keep the ABI stable, these were
unconditionally part of the glibc ABI
(sysdeps/unix/sysv/linux/arc/sys/ucontext.h:mcontext_t) however we
missed populating them (by saving/restoring them across signal
handling).

This patch fixes the issue by
 - adding arcv2 ABI regs to kernel struct sigcontext
 - populating them during signal handling

Change to struct sigcontext might seem like a glibc ABI change (although
it primarily uses ucontext_t:mcontext_t) but the fact is
 - it has only been extended (existing fields are not touched)
 - the old sigcontext was ABI incomplete to begin with anyways

Fixes: https://github.com/foss-for-synopsys-dwc-arc-processors/linux/issues/53
Cc: <stable@vger.kernel.org>
Tested-by: kernel test robot <lkp@intel.com>
Reported-by: Vladimir Isaev <isaev@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arc/include/uapi/asm/sigcontext.h
arch/arc/kernel/signal.c