lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGXu5j+p-UivAA8_6Mu0s_uL5mOY0fhxskqnyPSY2+2PL8+i4Q@mail.gmail.com>
Date:   Mon, 15 Oct 2018 14:30:06 -0700
From:   Kees Cook <keescook@...omium.org>
To:     "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] compat: Mark expected switch fall-throughs

On Sat, Oct 13, 2018 at 4:50 AM, Gustavo A. R. Silva
<gustavo@...eddedor.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@...eddedor.com>

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

-Kees

> ---
>  include/linux/compat.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/include/linux/compat.h b/include/linux/compat.h
> index d30e4db..06e7747 100644
> --- a/include/linux/compat.h
> +++ b/include/linux/compat.h
> @@ -488,8 +488,11 @@ put_compat_sigset(compat_sigset_t __user *compat, const sigset_t *set,
>         compat_sigset_t v;
>         switch (_NSIG_WORDS) {
>         case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3];
> +               /* fall through */
>         case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2];
> +               /* fall through */
>         case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1];
> +               /* fall through */
>         case 1: v.sig[1] = (set->sig[0] >> 32); v.sig[0] = set->sig[0];
>         }
>         return copy_to_user(compat, &v, size) ? -EFAULT : 0;
> --
> 2.7.4
>



-- 
Kees Cook
Pixel Security

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ