]> git.baikalelectronics.ru Git - kernel.git/commit
arm64/module: revert to unsigned interpretation of ABS16/32 relocations
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 28 May 2019 14:13:16 +0000 (16:13 +0200)
committerWill Deacon <will.deacon@arm.com>
Tue, 28 May 2019 14:15:53 +0000 (15:15 +0100)
commitd63ab6f71bbadd7307c03280ac2f7fcd3afb44d5
tree74c87fe15929c92b8a8368fec613b49968a11ef8
parentf6a41c5a2fcf79248eae2cbf5a14dc42e10bd4bf
arm64/module: revert to unsigned interpretation of ABS16/32 relocations

Commit 489ec9401de8

  ("arm64/module: deal with ambiguity in PRELxx relocation ranges")

updated the overflow checking logic in the relocation handling code to
ensure that PREL16/32 relocations don't overflow signed quantities.

However, the same code path is used for absolute relocations, where the
interpretation is the opposite: the only current use case for absolute
relocations operating on non-native word size quantities is the CRC32
handling in the CONFIG_MODVERSIONS code, and these CRCs are unsigned
32-bit quantities, which are now being rejected by the module loader
if bit 31 happens to be set.

So let's use different ranges for quanties subject to absolute vs.
relative relocations:
- ABS16/32 relocations should be in the range [0, Uxx_MAX)
- PREL16/32 relocations should be in the range [Sxx_MIN, Sxx_MAX)
- otherwise, print an error since no other 16 or 32 bit wide data
  relocations are currently supported.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/module.c