From: Kees Cook <keescook@chromium.org>
To: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: netdev@vger.kernel.org, Jacob Keller <jacob.e.keller@intel.com>,
intel-wired-lan@lists.osuosl.org,
Alexander Lobakin <aleksander.lobakin@intel.com>,
linux-hardening@vger.kernel.org,
Steven Zou <steven.zou@intel.com>
Subject: Re: [PATCH net-next v3 1/7] overflow: add DEFINE_FLEX() for on-stack allocs
Date: Wed, 16 Aug 2023 13:38:01 -0700 [thread overview]
Message-ID: <202308161337.975C93F163@keescook> (raw)
In-Reply-To: <20230816140623.452869-2-przemyslaw.kitszel@intel.com>
On Wed, Aug 16, 2023 at 10:06:17AM -0400, Przemek Kitszel wrote:
> Add DEFINE_FLEX() macro for on-stack allocations of structs with
> flexible array member.
>
> Expose __struct_size() macro outside of fortify-string.h, as it could be
> used to read size of structs allocated by DEFINE_FLEX().
> Move __member_size() alongside it.
> -Kees
>
> Using underlying array for on-stack storage lets us to declare
> known-at-compile-time structures without kzalloc().
>
> Actual usage for ice driver is in following patches of the series.
>
> Missing __has_builtin() workaround is moved up to serve also assembly
> compilation with m68k-linux-gcc, see [1].
> Error was (note the .S file extension):
> In file included from ../include/linux/linkage.h:5,
> from ../arch/m68k/fpsp040/skeleton.S:40:
> ../include/linux/compiler_types.h:331:5: warning: "__has_builtin" is not defined, evaluates to 0 [-Wundef]
> 331 | #if __has_builtin(__builtin_dynamic_object_size)
> | ^~~~~~~~~~~~~
> ../include/linux/compiler_types.h:331:18: error: missing binary operator before token "("
> 331 | #if __has_builtin(__builtin_dynamic_object_size)
> | ^
Looks good to me! Thanks for working on this. :)
Acked-by: Kees Cook <keescook@chromium.org>
--
Kees Cook
next prev parent reply other threads:[~2023-08-16 20:38 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 14:06 [PATCH net-next v3 0/7] introduce DEFINE_FLEX() macro Przemek Kitszel
2023-08-16 14:06 ` [PATCH net-next v3 1/7] overflow: add DEFINE_FLEX() for on-stack allocs Przemek Kitszel
2023-08-16 16:35 ` kernel test robot
2023-08-18 10:37 ` Przemek Kitszel
2023-08-18 11:10 ` Miguel Ojeda
2023-08-18 12:07 ` Philip Li
2023-08-19 10:06 ` Greg KH
2023-08-16 20:38 ` Kees Cook [this message]
2023-08-17 14:35 ` David Laight
2023-08-17 17:00 ` Kees Cook
2023-08-18 7:14 ` David Laight
2023-08-18 10:28 ` Przemek Kitszel
2023-08-18 10:49 ` David Laight
2023-08-23 20:52 ` Przemek Kitszel
2023-08-28 14:41 ` Przemek Kitszel
2023-08-16 14:06 ` [PATCH net-next v3 2/7] ice: ice_sched_remove_elems: replace 1 elem array param by u32 Przemek Kitszel
2023-08-16 14:06 ` [PATCH net-next v3 3/7] ice: drop two params of ice_aq_move_sched_elems() Przemek Kitszel
2023-08-16 14:06 ` [PATCH net-next v3 4/7] ice: make use of DEFINE_FLEX() in ice_ddp.c Przemek Kitszel
2023-08-16 14:06 ` [PATCH net-next v3 5/7] ice: make use of DEFINE_FLEX() for struct ice_aqc_add_tx_qgrp Przemek Kitszel
2023-08-16 14:06 ` [PATCH net-next v3 6/7] ice: make use of DEFINE_FLEX() for struct ice_aqc_dis_txq_item Przemek Kitszel
2023-08-16 14:06 ` [PATCH net-next v3 7/7] ice: make use of DEFINE_FLEX() in ice_switch.c Przemek Kitszel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202308161337.975C93F163@keescook \
--to=keescook@chromium.org \
--cc=aleksander.lobakin@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jacob.e.keller@intel.com \
--cc=linux-hardening@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=przemyslaw.kitszel@intel.com \
--cc=steven.zou@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).