powerpc64/module elfv1: Set opd addresses after module relocation
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Tue, 29 May 2018 06:51:00 +0000 (12:21 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:08:50 +0000 (11:08 -0800)
commit5f489579ef918970f655b3afc19c03732f16cbc4
tree23ccc8bb8b9dc9166921749282d9cbd160c4b3c8
parent778af261c53b0852ba5d9e2f45d4c03f46eddee6
powerpc64/module elfv1: Set opd addresses after module relocation

commit 59fe7eaf3598a89cbcd72e645b1d08afd76f7b29 upstream.

module_frob_arch_sections() is called before the module is moved to its
final location. The function descriptor section addresses we are setting
here are thus invalid. Fix this by processing opd section during
module_finalize()

Fixes: 5633e85b2c313 ("powerpc64: Add .opd based function descriptor dereference")
Cc: stable@vger.kernel.org # v4.16
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kernel/module.c
arch/powerpc/kernel/module_64.c