]> git.baikalelectronics.ru Git - kernel.git/commit
arm64/module: deal with ambiguity in PRELxx relocation ranges
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 23 May 2019 10:38:54 +0000 (11:38 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 23 May 2019 14:34:04 +0000 (15:34 +0100)
commit489ec9401de8154e6ba41cf08c2761e0a3a85a87
treeb7ac77f874e0c0e4d8c246ef90ebfe70bf5c12cf
parent1f603c38798c9d3787be3e3f8c12f88c093fefa2
arm64/module: deal with ambiguity in PRELxx relocation ranges

The R_AARCH64_PREL16 and R_AARCH64_PREL32 relocations are
documented as permitting a range of [-2^15 .. 2^16), resp.
[-2^31 .. 2^32). It is also documented that this means we
cannot detect overflow in some cases, which is bad.

Since we always interpret the targets of these relocations as
signed quantities (e.g., in the ksymtab handling code), let's
tighten the overflow checks so that targets that are out of
range for our signed interpretation of the relocated quantity
get flagged.

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