1
0
Fork 0
alistair23-linux/tools/arch
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
..
alpha/include tools headers uapi: Sync asm-generic/mman-common.h and linux/mman.h 2019-03-28 14:31:56 -03:00
arc/include/uapi/asm tools arch uapi: Copy missing unistd.h headers for arc, hexagon and riscv 2019-05-02 16:00:20 -04:00
arm/include tools headers kvm: Sync kvm headers with the kernel sources 2019-09-30 17:29:30 -03:00
arm64/include tools headers UAPI: Sync copy of arm64's asm/unistd.h with the kernel sources 2020-05-10 10:31:33 +02:00
csky/include/uapi/asm csky: Add support for libdw 2019-05-15 16:36:46 -03:00
h8300/include License cleanup: add SPDX license identifier to uapi header files with no license 2017-11-02 11:19:54 +01:00
hexagon/include/uapi/asm tools arch uapi: Copy missing unistd.h headers for arc, hexagon and riscv 2019-05-02 16:00:20 -04:00
ia64/include tools, perf: add and use optimized ring_buffer_{read_head, write_tail} helpers 2018-10-19 13:43:08 -07:00
microblaze/include/uapi/asm License cleanup: add SPDX license identifier to uapi header files with no license 2017-11-02 11:19:54 +01:00
mips/include tools headers uapi: Sync asm-generic/mman-common.h and linux/mman.h 2019-03-28 14:31:56 -03:00
parisc/include/uapi/asm tools headers uapi: Sync asm-generic/mman-common.h and linux/mman.h 2019-03-28 14:31:56 -03:00
powerpc/include tools headers UAPI: Update tools's copy of mman.h headers 2019-07-29 09:02:58 -03:00
riscv/include/uapi/asm riscv: Add support for libdw 2019-09-05 00:51:52 -07:00
s390/include tools headers kvm: Sync kvm headers with the kernel sources 2019-09-30 17:29:30 -03:00
sh/include License cleanup: add SPDX license identifier to uapi header files with no license 2017-11-02 11:19:54 +01:00
sparc/include tools headers UAPI: Update tools's copy of mman.h headers 2019-07-29 09:02:58 -03:00
x86 x86/uprobes: Do not use prefixes.nbytes when looping over prefixes.bytes 2020-12-11 13:23:30 +01:00
xtensa/include tools headers uapi: Sync asm-generic/mman-common.h and linux/mman.h 2019-03-28 14:31:56 -03:00