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  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]
Date:   Thu, 19 Aug 2021 02:04:46 +0200
From:   Miguel Ojeda <>
To:     Kees Cook <>
Cc:     linux-kernel <>,
        Miguel Ojeda <>,
        Nathan Chancellor <>,
        Nick Desaulniers <>,
        clang-built-linux <>,
        Joe Perches <>,
        Andy Whitcroft <>,
        Dwaipayan Ray <>,
        Lukas Bulwahn <>,
        Christoph Lameter <>,
        Pekka Enberg <>,
        David Rientjes <>,
        Joonsoo Kim <>,
        Andrew Morton <>,
        Vlastimil Babka <>,
        Daniel Micay <>,
        Dennis Zhou <>, Tejun Heo <>,
        Masahiro Yamada <>,
        Michal Marek <>,
        Linux-MM <>,
        Linux Kbuild mailing list <>,
Subject: Re: [PATCH v2 1/7] Compiler Attributes: Add __alloc_size() for better
 bounds checking

On Wed, Aug 18, 2021 at 11:40 PM Kees Cook <> wrote:
> GCC and Clang can use the "alloc_size" attribute to better inform the
> results of __builtin_object_size() (for compile-time constant values).
> Clang can additionally use alloc_size to inform the results of
> __builtin_dynamic_object_size() (for run-time values).
> Because GCC sees the frequent use of struct_size() as an allocator size
> argument, and notices it can return SIZE_MAX (the overflow indication),
> it complains about these call sites may overflow (since SIZE_MAX is
> greater than the default -Walloc-size-larger-than=PTRDIFF_MAX). This
> isn't helpful since we already know a SIZE_MAX will be caught at run-time
> (this was an intentional design). Instead, just disable this check as
> it is both a false positive and redundant. (Clang does not have this
> warning option.)


Reviewed-by: Miguel Ojeda <>


Powered by blists - more mailing lists