arm64: module: avoid undefined shift behavior in reloc_data()
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 5 Jan 2016 09:18:52 +0000 (10:18 +0100)
committerAlex Shi <alex.shi@linaro.org>
Wed, 11 May 2016 09:01:07 +0000 (17:01 +0800)
commit3fd9316702a82b498fcf7055f9781589ea6c1e1c
tree156d78410f9053e0a2dd748a502e88e4e22c1326
parent12037cecc2cfc56e01851c0fbf605be9e05bbe95
arm64: module: avoid undefined shift behavior in reloc_data()

Compilers may engage the improbability drive when encountering shifts
by a distance that is a multiple of the size of the operand type. Since
the required bounds check is very simple here, we can get rid of all the
fuzzy masking, shifting and comparing, and use the documented bounds
directly.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit f930896967fa3f9ab16a6f87267b92798308d48f)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
arch/arm64/kernel/module.c