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]
Date:   Mon, 4 Dec 2017 19:11:12 +0100
From:   Daniel Vetter <daniel@...ll.ch>
To:     "Gustavo A. R. Silva" <garsilva@...eddedor.com>
Cc:     Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
        Kees Cook <keescook@...omium.org>,
        David Airlie <airlied@...ux.ie>,
        intel-gfx <intel-gfx@...ts.freedesktop.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        Rodrigo Vivi <rodrigo.vivi@...el.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Mark expected switch fall-throughs

On Mon, Dec 4, 2017 at 4:20 PM, Gustavo A. R. Silva
<garsilva@...eddedor.com> wrote:
> Hi Joonas,
>
> Quoting Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>:
>
>> On Mon, 2017-11-27 at 16:17 -0600, Gustavo A. R. Silva wrote:
>>>
>>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
>>> where we are expecting to fall through.
>>
>>
>> I have to say I'm totally not sold on regexps matching comment
>> contents. Was something more explicit ever considered? Like:
>>
>> #define FALLTHROUGH __attribute__((fallthrough));
>>
>> With the appropriate version checks, of course.
>>
>
> One of the arguments is that comments lets us leverage the existing static
> analyzers.
>
> We've been discussing this during the last week, feel free to join the
> discussion:
>
> http://www.spinics.net/lists/kernel/msg2659908.html
> http://www.spinics.net/lists/kernel/msg2659906.html

If we go with existing rules, then either pls patch coding style, or
be a bit more liberal in what you accept. E.g. fallthrough vs fall
through seems a bit a bikeshed (and will be an endless source of work
for you).

I'd also claim that "this shouldn't happen, dump a backtrace and hope
for the best" style macros like i915's MISSING_CASE or WARN_ON (as the
only thing) should count as an auto-fallthrough annotation.

>From a quick look, that would cover everything in your patch.
-Daniel

>
> Thanks!
> --
> Gustavo A. R. Silva
>
>
>
>
>
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ