]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerRussell King <rmk+kernel@armlinux.org.uk>
Sun, 18 Apr 2021 18:14:45 +0000 (19:14 +0100)
commite3a69821c98eb6b2937b73a9e9308c77426e5b5a
tree0f2f62725529cb8e7131f464df4f94e20366eeea
parent4f73dce2d15e7e8678af3160631b43383e72c45c
ARM: 9071/1: uprobes: Don't hook on thumb instructions

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: 8c75975b1516 ("ARM: add uprobes support")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/probes/uprobes/core.c