All of lore.kernel.org
 help / color / mirror / Atom feed
From: Colin Ian King <colin.king@canonical.com>
To: Muhammad Usama Anjum <musamaanjum@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	dan.carpenter@oracle.com
Subject: Re: [PATCH] x86/kprobes: Remove dead code
Date: Wed, 24 Mar 2021 17:50:16 +0000	[thread overview]
Message-ID: <5fcd5b04-0fab-3672-c5d2-6e8f73f93bbc@canonical.com> (raw)
In-Reply-To: <20210324173641.GA404706@LEGION>

On 24/03/2021 17:36, Muhammad Usama Anjum wrote:
> The condition in switch statement `opcode & 0xf0` cannot evaluate to
> 0xff. So this case statement will never execute. Remove it.
> 
> Fixes: 6256e668b7 ("x86/kprobes: Use int3 instead of debug trap for single-step")
> Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
> ---
>  arch/x86/kernel/kprobes/core.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
> index 89d9f26785c7..3b7bcc077020 100644
> --- a/arch/x86/kernel/kprobes/core.c
> +++ b/arch/x86/kernel/kprobes/core.c
> @@ -177,9 +177,6 @@ int can_boost(struct insn *insn, void *addr)
>  	case 0xf0:
>  		/* clear and set flags are boostable */
>  		return (opcode == 0xf5 || (0xf7 < opcode && opcode < 0xfe));
> -	case 0xff:
> -		/* indirect jmp is boostable */
> -		return X86_MODRM_REG(insn->modrm.bytes[0]) == 4;
>  	default:
>  		/* CS override prefix and call are not boostable */
>  		return (opcode != 0x2e && opcode != 0x9a);
> 

The 0xff case was added with some form of intention to be executed so I
suspect removing it is not an appropriate fix.


  reply	other threads:[~2021-03-24 17:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24 17:36 [PATCH] x86/kprobes: Remove dead code Muhammad Usama Anjum
2021-03-24 17:50 ` Colin Ian King [this message]
2021-03-24 22:56   ` Masami Hiramatsu
2021-03-24 23:50     ` Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5fcd5b04-0fab-3672-c5d2-6e8f73f93bbc@canonical.com \
    --to=colin.king@canonical.com \
    --cc=bp@alien8.de \
    --cc=dan.carpenter@oracle.com \
    --cc=hpa@zytor.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=musamaanjum@gmail.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.