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: <1D53887A-B277-4813-A3E6-9367CCFC8759@kernel.org>
Date: Thu, 23 Oct 2025 06:45:31 -0700
From: Kees Cook <kees@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
CC: Miguel Ojeda <ojeda@...nel.org>, Nathan Chancellor <nathan@...nel.org>,
 Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
 Bill Wendling <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>,
 Marco Elver <elver@...gle.com>,
 Przemek Kitszel <przemyslaw.kitszel@...el.com>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Masahiro Yamada <masahiroy@...nel.org>,
 Christophe Leroy <christophe.leroy@...roup.eu>,
 Johannes Weiner <hannes@...xchg.org>, llvm@...ts.linux.dev,
 Al Viro <viro@...iv.linux.org.uk>, Arnd Bergmann <arnd@...db.de>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
 Nicolas Schier <nicolas.schier@...ux.dev>, Shuah Khan <shuah@...nel.org>,
 "Gustavo A. R. Silva" <gustavoars@...nel.org>,
 Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
 Tamir Duberstein <tamird@...il.com>, Michael Kelley <mhklinux@...look.com>,
 kernel test robot <lkp@...el.com>, Heiko Carstens <hca@...ux.ibm.com>,
 Uros Bizjak <ubizjak@...il.com>, Jan Hendrik Farr <kernel@...rr.cc>,
 Yafang Shao <laoar.shao@...il.com>,
 Marc Herbert <Marc.Herbert@...ux.intel.com>,
 Christopher Ferris <cferris@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Alexander Lobakin <aleksander.lobakin@...el.com>,
 Paolo Abeni <pabeni@...hat.com>, Tejun Heo <tj@...nel.org>,
 Jeff Xu <jeffxu@...omium.org>,
 Michal Koutný <mkoutny@...e.com>,
 Shakeel Butt <shakeel.butt@...ux.dev>, Randy Dunlap <rdunlap@...radead.org>,
 Brian Gerst <brgerst@...il.com>, linux-kernel@...r.kernel.org,
 linux-fsdevel@...r.kernel.org, linux-kbuild@...r.kernel.org,
 linux-kselftest@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH 1/3] compiler_types: Introduce __counted_by_ptr()



On October 23, 2025 1:01:23 AM PDT, Peter Zijlstra <peterz@...radead.org> wrote:
>On Wed, Oct 22, 2025 at 05:47:43PM -0700, Kees Cook wrote:
>> On Tue, Oct 21, 2025 at 12:24:05PM -0700, Kees Cook wrote:
>> > On Tue, Oct 21, 2025 at 11:54:47AM +0200, Peter Zijlstra wrote:
>> > > > [...]
>> > > > Unfortunately, this annotation cannot be used for "void *" members
>> > > > (since such a member is considered a pointer to an incomplete type,
>> > > > and neither Clang nor GCC developers could be convinced otherwise[1],
>> > > > even in the face of the GNU extension that "void *" has size "1 byte"
>> > > > for pointer arithmetic). For "void *" members, we must use the coming
>> > > > "sized_by" attribute.
>> > > 
>> > > So why do we need both __counted_by_ptr() and this __sized_by(), won't
>> > > one be good enough?
>> > [...]
>> > Let me take another stab at it...
>> 
>> It seems this will be acceptable as long as it is gated by GNU
>> extensions.
>
>Excellent!
>
>> GCC patch in progress. Clang PR here:
>> https://github.com/llvm/llvm-project/pull/163698
>
>I think you've got your link mixed up, this appears to be arm-kcfi (also
>good ofc). Either that, or I need copy/paste lessons.
>
>This one?
>
>  https://github.com/llvm/llvm-project/pull/164737

Whoops, yes, that's the one! Seems I'm the one needing those lessons. ;)


-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ