linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] skbuff: Mark expected switch fall-throughs
Date: Mon, 15 Oct 2018 14:30:31 -0700	[thread overview]
Message-ID: <CAGXu5j+rLGyGCozaSMqFV0p+cHoJFmJBXWXHz5WfYEaDkHJdGw@mail.gmail.com> (raw)
In-Reply-To: <20181013115646.GA3516@embeddedor.com>

On Sat, Oct 13, 2018 at 4:56 AM, Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

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

-Kees

> ---
>  include/linux/skbuff.h | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index 119d092..92ec346 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -3505,13 +3505,19 @@ static inline bool __skb_metadata_differs(const struct sk_buff *skb_a,
>  #define __it(x, op) (x -= sizeof(u##op))
>  #define __it_diff(a, b, op) (*(u##op *)__it(a, op)) ^ (*(u##op *)__it(b, op))
>         case 32: diffs |= __it_diff(a, b, 64);
> +               /* fall through */
>         case 24: diffs |= __it_diff(a, b, 64);
> +               /* fall through */
>         case 16: diffs |= __it_diff(a, b, 64);
> +               /* fall through */
>         case  8: diffs |= __it_diff(a, b, 64);
>                 break;
>         case 28: diffs |= __it_diff(a, b, 64);
> +               /* fall through */
>         case 20: diffs |= __it_diff(a, b, 64);
> +               /* fall through */
>         case 12: diffs |= __it_diff(a, b, 64);
> +               /* fall through */
>         case  4: diffs |= __it_diff(a, b, 32);
>                 break;
>         }
> --
> 2.7.4
>



-- 
Kees Cook
Pixel Security

  reply	other threads:[~2018-10-15 21:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-13 11:56 [PATCH] skbuff: Mark expected switch fall-throughs Gustavo A. R. Silva
2018-10-15 21:30 ` Kees Cook [this message]
2018-10-16 22:41   ` Kees Cook
2018-10-17 10:55     ` 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=CAGXu5j+rLGyGCozaSMqFV0p+cHoJFmJBXWXHz5WfYEaDkHJdGw@mail.gmail.com \
    --to=keescook@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=gustavo@embeddedor.com \
    --cc=linux-kernel@vger.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 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).