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] [thread-next>] [day] [month] [year] [list]
Message-ID: <202305221312.F5EDE0548@keescook>
Date:   Mon, 22 May 2023 13:14:30 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Nick Desaulniers <ndesaulniers@...gle.com>
Cc:     linux-hardening@...r.kernel.org, Andy Shevchenko <andy@...nel.org>,
        Cezary Rojewski <cezary.rojewski@...el.com>,
        Puyou Lu <puyou.lu@...il.com>, Mark Brown <broonie@...nel.org>,
        Josh Poimboeuf <jpoimboe@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Brendan Higgins <brendan.higgins@...ux.dev>,
        David Gow <davidgow@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Nathan Chancellor <nathan@...nel.org>,
        Alexander Potapenko <glider@...gle.com>,
        Zhaoyang Huang <zhaoyang.huang@...soc.com>,
        Randy Dunlap <rdunlap@...radead.org>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Miguel Ojeda <ojeda@...nel.org>,
        Alexander Lobakin <aleksander.lobakin@...el.com>,
        Liam Howlett <liam.howlett@...cle.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Dan Williams <dan.j.williams@...el.com>,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        Yury Norov <yury.norov@...il.com>,
        "Jason A. Donenfeld" <Jason@...c4.com>,
        Sander Vanheule <sander@...nheule.net>,
        Eric Biggers <ebiggers@...gle.com>,
        "Masami Hiramatsu (Google)" <mhiramat@...nel.org>,
        Andrey Konovalov <andreyknvl@...il.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Daniel Latypov <dlatypov@...gle.com>,
        José Expósito <jose.exposito89@...il.com>,
        linux-kernel@...r.kernel.org, kunit-dev@...glegroups.com
Subject: Re: [PATCH v2 01/10] kunit: tool: Enable CONFIG_FORTIFY_SOURCE under
 UML

On Mon, May 22, 2023 at 12:43:51PM -0700, Nick Desaulniers wrote:
> On Wed, May 10, 2023 at 12:24 PM Kees Cook <keescook@...omium.org> wrote:
> >
> > On Fri, Apr 07, 2023 at 04:42:27PM -0700, Nick Desaulniers wrote:
> > > On Fri, Apr 7, 2023 at 4:33 PM Nick Desaulniers <ndesaulniers@...gle.com> wrote:
> > > >
> > > > On Fri, Apr 7, 2023 at 12:27 PM Kees Cook <keescook@...omium.org> wrote:
> > > > >
> > > > > Since commit ba38961a069b ("um: Enable FORTIFY_SOURCE"), it's possible
> > > > > to run the FORTIFY tests under UML. Enable CONFIG_FORTIFY_SOURCE when
> > > > > running with --altests to gain additional coverage, and by default under
> > > >
> > > > two L's in alltest?
> > >
> > > Also, while testing this series:
> > > ```
> > > $ LLVM=1 ./tools/testing/kunit/kunit.py run
> > > ...
> > > [16:40:09] ================== fortify (24 subtests) ===================
> > > [16:40:09] [PASSED] known_sizes_test
> > > [16:40:09] [PASSED] control_flow_split_test
> > > [16:40:09] [PASSED] alloc_size_kmalloc_const_test
> > > [16:40:09]     # alloc_size_kmalloc_dynamic_test: EXPECTATION FAILED
> > > at lib/fortify_kunit.c:249
> > > [16:40:09]     Expected __builtin_dynamic_object_size(p, 1) == expected, but
> > > [16:40:09]         __builtin_dynamic_object_size(p, 1) == -1
> > > (0xffffffffffffffff)
> > > [16:40:09]         expected == 11 (0xb)
> > > [16:40:09] __alloc_size() not working with __bdos on kmemdup("hello
> > > there", len, gfp)
> >
> > I'm still tracking this down. I'm not sure what's happening here, but it
> > seems to be Clang-specific, and due to some interaction with the changes
> > I made for Kunit examination. WHY it happens I haven't found yet.
> 
> Was this what exposed https://github.com/llvm/llvm-project/issues/62789?

Nope -- I found this while working on:
https://lore.kernel.org/lkml/20230517225838.never.965-kees@kernel.org/

i.e. I was surprised I could use static initializers with a flexible
array, and then I went and verified various related behaviors between
GCC and Clang.

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ