linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/ptrace: Mark expected switch fall-through
@ 2019-08-05 19:56 Gustavo A. R. Silva
  2019-08-05 20:19 ` Kees Cook
  2019-08-07 13:16 ` [tip:x86/urgent] " tip-bot for Gustavo A. R. Silva
  0 siblings, 2 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-08-05 19:56 UTC (permalink / raw)
  To: Oleg Nesterov, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	H. Peter Anvin, x86
  Cc: linux-kernel, Gustavo A. R. Silva, Kees Cook

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>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/ptrace: Mark expected switch fall-through
  2019-08-05 19:56 [PATCH] x86/ptrace: Mark expected switch fall-through Gustavo A. R. Silva
@ 2019-08-05 20:19 ` Kees Cook
  2019-08-07 13:16 ` [tip:x86/urgent] " tip-bot for Gustavo A. R. Silva
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2019-08-05 20:19 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Oleg Nesterov, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	H. Peter Anvin, x86, linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/urgent] x86/ptrace: Mark expected switch fall-through
  2019-08-05 19:56 [PATCH] x86/ptrace: Mark expected switch fall-through Gustavo A. R. Silva
  2019-08-05 20:19 ` Kees Cook
@ 2019-08-07 13:16 ` tip-bot for Gustavo A. R. Silva
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Gustavo A. R. Silva @ 2019-08-07 13:16 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: mingo, linux-kernel, tglx, gustavo, keescook, hpa

Commit-ID:  4ab9ab656a6cea5257bfa31f00c922d68f7a5c2f
Gitweb:     https://git.kernel.org/tip/4ab9ab656a6cea5257bfa31f00c922d68f7a5c2f
Author:     Gustavo A. R. Silva <gustavo@embeddedor.com>
AuthorDate: Mon, 5 Aug 2019 14:56:54 -0500
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 7 Aug 2019 15:12:01 +0200

x86/ptrace: Mark expected switch fall-through

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>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lkml.kernel.org/r/20190805195654.GA17831@embeddedor

---
 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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-07 13:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-05 19:56 [PATCH] x86/ptrace: Mark expected switch fall-through Gustavo A. R. Silva
2019-08-05 20:19 ` Kees Cook
2019-08-07 13:16 ` [tip:x86/urgent] " tip-bot for Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).