1
0
Fork 0
alistair23-linux/tools/arch/x86/include/asm
Masami Hiramatsu 579c977253 x86/uprobes: Do not use prefixes.nbytes when looping over prefixes.bytes
commit 4e9a5ae8df upstream.

Since insn.prefixes.nbytes can be bigger than the size of
insn.prefixes.bytes[] when a prefix is repeated, the proper check must
be

  insn.prefixes.bytes[i] != 0 and i < 4

instead of using insn.prefixes.nbytes.

Introduce a for_each_insn_prefix() macro for this purpose. Debugged by
Kees Cook <keescook@chromium.org>.

 [ bp: Massage commit message, sync with the respective header in tools/
   and drop "we". ]

Fixes: 2b14449835 ("uprobes, mm, x86: Add the ability to install and remove uprobes breakpoints")
Reported-by: syzbot+9b64b619f10f19d19a7c@syzkaller.appspotmail.com
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/160697103739.3146288.7437620795200799020.stgit@devnote2
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-11 13:23:30 +01:00
..
atomic.h Merge branch 'linus' into locking/core, to resolve conflicts 2017-11-07 10:32:44 +01:00
barrier.h tools: add smp_* barrier variants to include infrastructure 2019-04-11 14:45:50 -07:00
cmpxchg.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cpufeatures.h tools arch x86: Sync asm/cpufeatures.h with the kernel sources 2019-09-20 15:00:49 -03:00
disabled-features.h tools headers x86: Sync disabled-features.h 2019-01-03 13:53:59 -03:00
inat.h perf intel-pt: Use shared x86 insn decoder 2019-08-31 22:27:52 -03:00
inat_types.h objtool: Move x86 insn decoder to a common location 2019-08-31 22:27:52 -03:00
insn.h x86/uprobes: Do not use prefixes.nbytes when looping over prefixes.bytes 2020-12-11 13:23:30 +01:00
mcsafe_test.h tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' 2018-07-30 12:36:51 -03:00
orc_types.h objtool: Move x86 insn decoder to a common location 2019-08-31 22:27:52 -03:00
required-features.h tools/headers: Synchronize kernel ABI headers, v4.17-rc1 2018-04-17 09:47:39 -03:00
rmwcc.h jump_label: move 'asm goto' support test to Kconfig 2019-01-06 09:46:51 +09:00
unistd_32.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
unistd_64.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00