]> git.ipfire.org Git - thirdparty/haproxy.git/commit
DEBUG: crash using an invalid opcode on aarch64 instead of an invalid access
authorWilly Tarreau <w@1wt.eu>
Tue, 25 Apr 2023 17:01:48 +0000 (19:01 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 25 Apr 2023 17:53:39 +0000 (19:53 +0200)
commit543e2544cabf9900af92d45658b122bc25011c3d
tree8bddea6b88270c0f3a87621be980c1c6ad073da3
parent77787ec9bccaa6904dceb0dcce9bd8184cfdbece
DEBUG: crash using an invalid opcode on aarch64 instead of an invalid access

On aarch64 there's also a guaranted invalid instruction, called UDF, and
which even supports an optional 16-bit immediate operand:

   https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/UDF--Permanently-Undefined-?lang=en

It's conveniently encoded as 4 zeroes (when the operand is zero). It's
unclear when support for it was added into GAS, if at all; even a
not-so-old 2.27 doesn't know about it. Let's byte-encode it.

Tested on an A72 and works as expected.
include/haproxy/bug.h