OSDN Git Service

ARM: 9071/1: uprobes: Don't hook on thumb instructions
authorFredrik Strupe <fredrik@strupe.net>
Mon, 5 Apr 2021 20:52:05 +0000 (21:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Apr 2021 11:16:51 +0000 (13:16 +0200)
commitc91673744e2d2070fcdbb6e82f61300660649dbd
tree2b2262e6e9b89f601da31fafe0ffc11792e1ecc4
parent2643da6aa57920d9159a1a579fb04f89a2b0d29a
ARM: 9071/1: uprobes: Don't hook on thumb instructions

commit d2f7eca60b29006285d57c7035539e33300e89e5 upstream.

Since uprobes is not supported for thumb, check that the thumb bit is
not set when matching the uprobes instruction hooks.

The Arm UDF instructions used for uprobes triggering
(UPROBE_SWBP_ARM_INSN and UPROBE_SS_ARM_INSN) coincidentally share the
same encoding as a pair of unallocated 32-bit thumb instructions (not
UDF) when the condition code is 0b1111 (0xf). This in effect makes it
possible to trigger the uprobes functionality from thumb, and at that
using two unallocated instructions which are not permanently undefined.

Signed-off-by: Fredrik Strupe <fredrik@strupe.net>
Cc: stable@vger.kernel.org
Fixes: c7edc9e326d5 ("ARM: add uprobes support")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/probes/uprobes/core.c