UPSTREAM: 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

Reported-by: David Binderman <>
Signed-off-by: Ard Biesheuvel <>
Signed-off-by: Will Deacon <>

Bug: None
Patchset: arm64-kmod-loading-fixes

(cherry-picked from f930896967fa3f9ab16a6f87267b92798308d48f)
Signed-off-by: Mattias Nissler <>

Change-Id: I4edb68cd15f7a41dd42c3b6480c688183b853430
1 file changed