All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Len Brown <lenb@kernel.org>,
	Robert Moore <robert.moore@intel.com>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org,
	acpica-devel@lists.linuxfoundation.org
Subject: Re: [PATCH] ACPICA: Replace fake flexible arrays with flexible array members
Date: Fri, 27 Jan 2023 10:33:17 -0800	[thread overview]
Message-ID: <202301271032.43B50EB7@keescook> (raw)
In-Reply-To: <CAJZ5v0hQypNonoqr1V1xqN5bX+pKBF3AR=F-mRynN5yvcS9kyA@mail.gmail.com>

On Fri, Jan 27, 2023 at 07:08:39PM +0100, Rafael J. Wysocki wrote:
> On Fri, Jan 20, 2023 at 8:16 PM Kees Cook <keescook@chromium.org> wrote:
> >
> > On Fri, Jan 20, 2023 at 07:10:52PM +0100, Rafael J. Wysocki wrote:
> > > On Sun, Jan 15, 2023 at 7:38 PM Kees Cook <keescook@chromium.org> wrote:
> > > >
> > > > On Fri, Nov 18, 2022 at 10:15:51AM -0800, Kees Cook wrote:
> > > > > Functionally identical to ACPICA upstream pull request 813:
> > > > > https://github.com/acpica/acpica/pull/813
> > > >
> > > > Any update on this? Upstream is currently unbuildable since October.
> > > >
> > > > > One-element arrays (and multi-element arrays being treated as
> > > > > dynamically sized) are deprecated[1] and are being replaced with
> > > > > flexible array members in support of the ongoing efforts to tighten the
> > > > > FORTIFY_SOURCE routines on memcpy(), correctly instrument array indexing
> > > > > with UBSAN_BOUNDS, and to globally enable -fstrict-flex-arrays=3.
> > > > >
> > > > > Replace one-element array with flexible-array member in struct
> > > > > acpi_resource_extended_irq. Replace 4-byte fixed-size array with 4-byte
> > > > > padding in a union with a flexible-array member in struct
> > > > > acpi_pci_routing_table.
> > > > >
> > > > > This results in no differences in binary output.
> > > >
> > > > In the meantime, can you take this patch for Linux, and we can wait for
> > > > ACPICA to catch up?
> > >
> > > Applied now (as 6.3 material), sorry for the delay.
> >
> > Thanks!
> 
> Unfortunately, this breaks compilation for the ACPI tools in tools/power/acpi/.

What's the make target to test this?

> Apparently, the problem is that DECLARE_FLEX_ARRAY() is not defined
> when the tools are built, because kernel headers are not used then.

This should exist in the stddef.h tools headers, but perhaps it isn't
included already?

> I guess the changes from your upstream PR need to be backported
> literally for this to work, so I'll drop this one for the time being.
> Or please let me know if you have a better idea.

I can send a new version if I can reproduce the build failure you see...

-- 
Kees Cook

  reply	other threads:[~2023-01-27 18:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18 18:15 [PATCH] ACPICA: Replace fake flexible arrays with flexible array members Kees Cook
2023-01-15 18:38 ` Kees Cook
2023-01-20 18:10   ` Rafael J. Wysocki
2023-01-20 19:16     ` Kees Cook
2023-01-27 18:08       ` Rafael J. Wysocki
2023-01-27 18:33         ` Kees Cook [this message]
2023-01-27 18:52           ` Rafael J. Wysocki

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=202301271032.43B50EB7@keescook \
    --to=keescook@chromium.org \
    --cc=acpica-devel@lists.linuxfoundation.org \
    --cc=gustavoars@kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robert.moore@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.