From: Linus Torvalds <torvalds@linux-foundation.org>
To: Kees Cook <keescook@chromium.org>
Cc: linux-kernel@vger.kernel.org, Alexey Dobriyan <adobriyan@gmail.com>
Subject: Re: [GIT PULL] hardening fixes for v6.6-rc3
Date: Fri, 22 Sep 2023 16:55:45 -0700 [thread overview]
Message-ID: <CAHk-=wg0C+eEm0Tegpvc1zZjcqkdG9L0ed10tg_rQ1-WZciMGA@mail.gmail.com> (raw)
In-Reply-To: <202309220957.927ADC0586@keescook>
On Fri, 22 Sept 2023 at 09:59, Kees Cook <keescook@chromium.org> wrote:
>
> - Fix UAPI stddef.h to avoid C++-ism (Alexey Dobriyan)
Ugh. Did we really have to make two different versions of that define?
Ok, so C++ did something stupid wrt an empty struct. Fine.
But I think we could have still shared the same definition by just
using the same 'zero-sized array' trick, regardless of any 'empty
struct has a size in C++'.
IOW, wouldn't this just work universally, without any "two completely
different versions" hack?
#define __DECLARE_FLEX_ARRAY(TYPE, NAME) \
struct { \
char __empty_ ## NAME[0]; \
TYPE NAME[]; \
}
I didn't test. I'm just hating on that '#ifdef __cplusplus'.
Linus
next prev parent reply other threads:[~2023-09-22 23:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-22 16:59 [GIT PULL] hardening fixes for v6.6-rc3 Kees Cook
2023-09-22 23:55 ` Linus Torvalds [this message]
2023-09-23 3:49 ` Kees Cook
2023-09-23 18:04 ` Linus Torvalds
2023-09-24 16:58 ` Alexey Dobriyan
2023-09-24 17:24 ` Linus Torvalds
2023-09-23 16:53 ` Alexey Dobriyan
2023-09-23 18:02 ` Linus Torvalds
2023-09-22 23:58 ` pr-tracker-bot
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='CAHk-=wg0C+eEm0Tegpvc1zZjcqkdG9L0ed10tg_rQ1-WZciMGA@mail.gmail.com' \
--to=torvalds@linux-foundation.org \
--cc=adobriyan@gmail.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
/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).