All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Oleg Nesterov <oleg@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/ptrace: Mark expected switch fall-through
Date: Mon, 5 Aug 2019 13:19:20 -0700	[thread overview]
Message-ID: <201908051319.146A70C@keescook> (raw)
In-Reply-To: <20190805195654.GA17831@embeddedor>

On Mon, Aug 05, 2019 at 02:56:54PM -0500, Gustavo A. R. Silva wrote:
> Mark switch cases where we are expecting to fall through.
> 
> Fix the following warning (Building: allnoconfig i386):
> 
> arch/x86/kernel/ptrace.c:202:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    if (unlikely(value == 0))
>       ^
> arch/x86/kernel/ptrace.c:206:2: note: here
>   default:
>   ^~~~~~~
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  arch/x86/kernel/ptrace.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
> index 0fdbe89d0754..3c5bbe8e4120 100644
> --- a/arch/x86/kernel/ptrace.c
> +++ b/arch/x86/kernel/ptrace.c
> @@ -201,6 +201,7 @@ static int set_segment_reg(struct task_struct *task,
>  	case offsetof(struct user_regs_struct, ss):
>  		if (unlikely(value == 0))
>  			return -EIO;
> +		/* Else, fall through */
>  
>  	default:
>  		*pt_regs_access(task_pt_regs(task), offset) = value;
> -- 
> 2.22.0
> 

-- 
Kees Cook

  reply	other threads:[~2019-08-05 20:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-05 19:56 [PATCH] x86/ptrace: Mark expected switch fall-through Gustavo A. R. Silva
2019-08-05 20:19 ` Kees Cook [this message]
2019-08-07 13:16 ` [tip:x86/urgent] " tip-bot for Gustavo A. R. Silva

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=201908051319.146A70C@keescook \
    --to=keescook@chromium.org \
    --cc=bp@alien8.de \
    --cc=gustavo@embeddedor.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --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.