]> git.proxmox.com Git - mirror_ubuntu-focal-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)
commit3fd00beb14a56c5ca10c3f67e5b8156f4f9223b5
tree74c87fe15929c92b8a8368fec613b49968a11ef8
parent00377277166bac6939d8f72b429301369acaf2d8
arm64/module: revert to unsigned interpretation of ABS16/32 relocations

Commit 1cf24a2cc3fd

  ("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