Files
linux/arch/x86/include/asm
Masami Hiramatsu e4384790cb 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
[sudip: adjust context, use old insn.h]
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-16 09:51:41 +09:00
..
2023-05-15 08:58:16 +09:00
2018-01-17 10:29:45 +01:00
2015-05-28 15:31:53 +02:00
2012-03-28 18:11:12 +01:00
2014-03-04 21:47:51 +01:00
2011-04-18 09:26:48 -07:00
2015-10-21 11:17:32 +02:00
2018-01-05 15:46:32 +01:00
2023-05-12 16:56:24 +09:00
2009-08-27 00:35:56 +02:00
2015-04-24 15:36:55 +02:00
2010-10-26 16:52:08 -07:00
2012-06-25 13:48:30 +02:00
2018-01-05 15:46:35 +01:00
2016-08-18 18:41:27 +02:00
2009-06-13 15:37:30 +02:00
2016-01-12 12:17:28 +01:00
2010-06-09 11:12:36 +02:00
2015-07-31 13:31:10 +02:00
2017-06-07 12:07:47 +02:00
2008-10-22 22:55:23 -07:00
2014-02-27 08:07:39 -08:00
2018-02-13 12:36:00 +01:00
2023-05-15 14:49:51 +09:00
2015-12-19 11:53:40 +01:00
2018-03-18 12:07:50 +01:00
2008-10-22 22:55:23 -07:00
2014-09-01 10:15:31 +02:00
2011-03-15 15:34:15 -07:00
2016-09-20 09:26:15 +02:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2015-05-19 15:47:30 +02:00
2016-01-30 11:22:17 +01:00
2016-09-05 11:47:31 +02:00
2016-06-16 00:04:31 +02:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2008-10-22 22:55:23 -07:00
2023-05-15 17:16:29 +09:00
2016-06-16 00:04:31 +02:00
2015-05-19 15:47:30 +02:00