]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
powerpc/64/module: REL32 relocation range check
authorNicholas Piggin <npiggin@gmail.com>
Wed, 29 Aug 2018 11:56:56 +0000 (21:56 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Nov 2018 08:21:55 +0000 (09:21 +0100)
commitc467bb652d448ed6f8e9c0e0e7047e6dec5c9e22
tree7da634e49c37b7692b1dab5d5b7c348ea0a958bf
parent8d16dd049428072519333e4ab6ed5df8084d1435
powerpc/64/module: REL32 relocation range check

[ Upstream commit b851ba02a6f3075f0f99c60c4bc30a4af80cf428 ]

The recent module relocation overflow crash demonstrated that we
have no range checking on REL32 relative relocations. This patch
implements a basic check, the same kernel that previously oopsed
and rebooted now continues with some of these errors when loading
the module:

  module_64: x_tables: REL32 527703503449812 out of range!

Possibly other relocations (ADDR32, REL16, TOC16, etc.) should also have
overflow checks.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kernel/module_64.c