android_kernel_samsung_msm8976/scripts
Alex Smith e16046836e recordmcount/MIPS: Fix possible incorrect mcount_loc table entries in modules
commit 91ad11d7cc6f4472ebf177a6252fbf0fd100d798 upstream.

On MIPS calls to _mcount in modules generate 2 instructions to load
the _mcount address (and therefore 2 relocations). The mcount_loc
table should only reference the first of these, so the second is
filtered out by checking the relocation offset and ignoring ones that
immediately follow the previous one seen.

However if a module has an _mcount call at offset 0, the second
relocation would not be filtered out due to old_r_offset == 0
being taken to mean that the current relocation is the first one
seen, and both would end up in the mcount_loc table.

This results in ftrace_make_nop() patching both (adjacent)
instructions to branches over the _mcount call sequence like so:

  0xffffffffc08a8000:  04 00 00 10     b       0xffffffffc08a8014
  0xffffffffc08a8004:  04 00 00 10     b       0xffffffffc08a8018
  0xffffffffc08a8008:  2d 08 e0 03     move    at,ra
  ...

The second branch is in the delay slot of the first, which is
defined to be unpredictable - on the platform on which this bug was
encountered, it triggers a reserved instruction exception.

Fix by initializing old_r_offset to ~0 and using that instead of 0
to determine whether the current relocation is the first seen.

Signed-off-by: Alex Smith <alex.smith@imgtec.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7098/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-06 18:54:13 -07:00
..
basic kbuild: fixdep: support concatenated dep files 2013-04-05 12:22:58 -06:00
coccinelle
dtc dtc: ensure #line directives don't consume data from the next line 2013-06-13 22:12:15 +01:00
genksyms genksyms: pass symbol-prefix instead of arch 2013-03-20 11:27:27 +10:30
kconfig kconfig/menu.c: fix multiple references to expressions in menu_add_prop() 2013-05-30 00:14:01 +02:00
ksymoops
mod powerpc: Add vr save/restore functions 2014-05-30 21:52:12 -07:00
package deb-pkg: Fix cross-building linux-headers package 2014-03-31 09:58:13 -07:00
rt-tester
selinux
tracing
.gitignore
asn1_compiler.c
bin2c.c
bloat-o-meter
bootgraph.pl
checkincludes.pl
checkkconfigsymbols.sh
checkpatch.pl checkpatch: add Suggested-by as a standard signature 2013-04-29 18:28:20 -07:00
checkstack.pl scripts/checkstack.pl: Add metag support 2013-03-02 20:09:55 +00:00
checksyscalls.sh
checkversion.pl
cleanfile
cleanpatch
coccicheck Coccinelle: Fix patch output when coccicheck is used with M= and C= 2013-04-08 15:42:03 +02:00
config scripts/config: fix assignment of parameters for short version of --*-after options 2013-05-20 14:15:17 +02:00
conmakehash.c
decodecode scripts/decodecode: make faulting insn ptr more robust 2013-04-29 15:54:27 -07:00
depmod.sh
diffconfig
docproc.c
export_report.pl
extract-ikconfig
extract-vmlinux
gcc-goto.sh
gcc-version.sh
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_initramfs_list.sh
get_maintainer.pl get_maintainer: use filename-only regex match for Tegra 2013-04-29 18:28:14 -07:00
gfp-translate
headerdep.pl
headers.sh
headers_check.pl
headers_install.sh kbuild: fix make headers_install when path is too long 2014-04-14 06:42:14 -07:00
kallsyms.c scripts/kallsyms: filter symbols not in kernel address space 2013-11-13 12:05:32 +09:00
Kbuild.include kbuild: fix ld-option function 2013-04-08 11:47:41 +02:00
kernel-doc
Lindent
link-vmlinux.sh scripts/kallsyms: filter symbols not in kernel address space 2013-11-13 12:05:32 +09:00
Makefile
Makefile.asm-generic
Makefile.build genksyms: pass symbol-prefix instead of arch 2013-03-20 11:27:27 +10:30
Makefile.clean
Makefile.fwinst
Makefile.headersinst kbuild: fix make headers_install when path is too long 2014-04-14 06:42:14 -07:00
Makefile.help
Makefile.host
Makefile.lib kbuild: make sure we clean up DTB temporary files 2013-06-13 22:12:13 +01:00
Makefile.modbuiltin
Makefile.modinst
Makefile.modpost modpost: handle huge numbers of modules. 2013-04-05 11:48:10 +10:30
Makefile.modsign
makelst
markup_oops.pl
mkcompile_h
mkmakefile
mksysmap
mkuboot.sh
mkversion
module-common.lds
namespace.pl
patch-kernel
pnmtologo.c
profile2linkerlist.pl
recordmcount.c
recordmcount.h recordmcount/MIPS: Fix possible incorrect mcount_loc table entries in modules 2014-07-06 18:54:13 -07:00
recordmcount.pl
setlocalversion
show_delta
sign-file
sortextable.c
sortextable.h
tags.sh scripts/tags.sh: Add magic for OFFSET and DEFINE 2013-03-27 14:22:03 +01:00
unifdef.c
ver_linux
xz_wrap.sh