Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit84da009

Browse files
mhiramatsuryasaimadhu
authored andcommitted
x86/sev-es: Use new for_each_insn_prefix() macro to loop over prefixes bytes
Since insn.prefixes.nbytes can be bigger than the size ofinsn.prefixes.bytes[] when a prefix is repeated, the propercheck must be: insn.prefixes.bytes[i] != 0 and i < 4instead of using insn.prefixes.nbytes. Use the newfor_each_insn_prefix() macro which does it correctly.Debugged by Kees Cook <keescook@chromium.org>. [ bp: Massage commit message. ]Fixes:25189d0 ("x86/sev-es: Add support for handling IOIO exceptions")Reported-by: syzbot+9b64b619f10f19d19a7c@syzkaller.appspotmail.comSigned-off-by: Masami Hiramatsu <mhiramat@kernel.org>Signed-off-by: Borislav Petkov <bp@suse.de>Link:https://lkml.kernel.org/r/160697106089.3146288.2052422845039649176.stgit@devnote2
1 parent12cb908 commit84da009

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

‎arch/x86/boot/compressed/sev-es.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ struct ghcb *boot_ghcb;
3232
*/
3333
staticboolinsn_has_rep_prefix(structinsn*insn)
3434
{
35+
insn_byte_tp;
3536
inti;
3637

3738
insn_get_prefixes(insn);
3839

39-
for (i=0;i<insn->prefixes.nbytes;i++) {
40-
insn_byte_tp=insn->prefixes.bytes[i];
41-
40+
for_each_insn_prefix(insn,i,p) {
4241
if (p==0xf2||p==0xf3)
4342
return true;
4443
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp