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:   Sun, 18 Feb 2018 14:15:38 +0100
From:   Ingo Molnar <mingo@...nel.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     Josh Poimboeuf <jpoimboe@...hat.com>, x86@...nel.org,
        linux-kernel@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Jason Baron <jbaron@...mai.com>, Borislav Petkov <bp@...e.de>
Subject: Re: [PATCH v2 1/2] jump_label: Explicitly disable jump labels in
 __init code


* Ingo Molnar <mingo@...nel.org> wrote:

> 2) code robustness 
> 
> For example:
> 
>         for (i = 0; i < 10; i++)
>                 if (foo)
>                         bar(i);
>                 baz(i);
> 
> Is probably buggy code, although technically it's valid syntax and will compile 
> just fine.
> 
> If all multi-line statements have curly braces then this type of bug cannot occur:
> 
>         for (i = 0; i < 10; i++) {
>                 if (foo)
>                         bar(i);
>                 baz(i);
> 	}

Note that newer versions of GCC will warn about this pattern:

     warning: this ‘for’ clause does not guard
              this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’

But the warning is pretty restrictive and GCC won't warn about slightly more 
complex patterns like:

          for (i = 0; i < 10; i++)
                  if (foo)
                          bar(i);
//                debug_fn();
                  baz(i);

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ