]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: alternative: Disallow patching instructions using literals
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Fri, 9 Sep 2016 13:07:11 +0000 (14:07 +0100)
committerWill Deacon <will.deacon@arm.com>
Fri, 9 Sep 2016 14:03:28 +0000 (15:03 +0100)
commit44a5c504a87b7576096ef9bb481c6aa02d286297
tree9c046ca20a4e8b7cbae0424a3ddf15cc8a5fac2a
parent082f7f295e7bfdb758c81170c7ecc4f870f8dd82
arm64: alternative: Disallow patching instructions using literals

The alternative code patching doesn't check if the replaced instruction
uses a pc relative literal. This could cause silent corruption in the
instruction stream as the instruction will be executed from a different
address than what it was compiled for. Catch all such cases.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Suggested-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/alternative.c