From: Will Deacon <will@kernel.org>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
"Kaneda, Erik" <erik.kaneda@intel.com>,
"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
"Moore, Robert" <robert.moore@intel.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"lorenzo.pieralisi@arm.com" <lorenzo.pieralisi@arm.com>,
"glider@google.com" <glider@google.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"guohanjun@huawei.com" <guohanjun@huawei.com>,
"devel@acpica.org" <devel@acpica.org>,
"pcc@google.com" <pcc@google.com>,
Ard Biesheuvel <ardb@kernel.org>,
"dvyukov@google.com" <dvyukov@google.com>,
Len Brown <lenb@kernel.org>
Subject: Re: [PATCH] ACPICA: fix UBSAN warning using __builtin_offsetof
Date: Mon, 8 Jun 2020 15:51:50 +0100 [thread overview]
Message-ID: <20200608145150.GA7418@willie-the-truck> (raw)
In-Reply-To: <CAKwvOdmsCmPFiDOq7AYUyEx=60B=qo8u9yhnJDQ6nd6Ew7xDkQ@mail.gmail.com>
Hey Nick,
On Tue, Jun 02, 2020 at 11:46:31AM -0700, Nick Desaulniers wrote:
> On Mon, Jun 1, 2020 at 5:03 PM Kaneda, Erik <erik.kaneda@intel.com> wrote:
> > > Will reported UBSAN warnings:
> > > UBSAN: null-ptr-deref in drivers/acpi/acpica/tbfadt.c:459:37
> > > UBSAN: null-ptr-deref in arch/arm64/kernel/smp.c:596:6
> > >
> > > Looks like the emulated offsetof macro ACPI_OFFSET is causing these. We
> > > can avoid this by using the compiler builtin, __builtin_offsetof.
> >
> > I'll take a look at this tomorrow
> > >
> > > The non-kernel runtime of UBSAN would print:
> > > runtime error: member access within null pointer of type for this macro.
> >
> > actypes.h is owned by ACPICA so we typically do not allow compiler-specific
> > extensions because the code is intended to be compiled using the C99 standard
> > without compiler extensions. We could allow this sort of thing in a Linux-specific
> > header file like include/acpi/platform/aclinux.h but I'll take a look at the error as well..
>
> If I'm not allowed to touch that header, it looks like I can include
> <linux/stddef.h> (rather than my host's <stddef.h>) to get a
> definition of `offsetof` thats implemented in terms of
> `__builtin_offsetof`. I should be able to use that to replace uses of
> ACPI_OFFSET. Are any of these off limits?
It's not so much about not being allowed to touch the header, but rather
that the kernel imports the code from a different project:
https://acpica.org/community
> $ grep -rn ACPI_OFFSET
> arch/arm64/include/asm/acpi.h:34:#define ACPI_MADT_GICC_MIN_LENGTH
> ACPI_OFFSET( \
> arch/arm64/include/asm/acpi.h:41:#define ACPI_MADT_GICC_SPE
> (ACPI_OFFSET(struct acpi_madt_generic_interrupt, \
I'm happy to take patches to the stuff under arch/arm64/, fwiw.
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-06-08 14:52 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-21 10:09 arm64/acpi: NULL dereference reports from UBSAN at boot Will Deacon
2020-05-21 17:37 ` Lorenzo Pieralisi
2020-05-26 20:21 ` Will Deacon
2020-05-27 13:41 ` Lorenzo Pieralisi
2020-06-01 7:05 ` Will Deacon
2020-06-01 21:51 ` Nick Desaulniers
2020-06-01 21:57 ` Ard Biesheuvel
2020-06-01 22:19 ` Nick Desaulniers
2020-06-01 22:28 ` Ard Biesheuvel
2020-06-01 23:18 ` [PATCH] ACPICA: fix UBSAN warning using __builtin_offsetof Nick Desaulniers
2020-06-01 23:37 ` Peter Collingbourne
2020-06-01 23:48 ` Nick Desaulniers
2020-06-02 0:02 ` Kaneda, Erik
2020-06-02 18:46 ` Nick Desaulniers
2020-06-08 14:51 ` Will Deacon [this message]
2020-06-08 20:29 ` Nick Desaulniers
2020-06-08 20:38 ` [PATCH v2] arm64: acpi: fix UBSAN warning Nick Desaulniers
2020-06-09 17:46 ` Lorenzo Pieralisi
2020-06-09 19:50 ` Jeremy Linton
2020-06-10 11:21 ` Will Deacon
2020-06-08 23:20 ` [PATCH] ACPICA: fix UBSAN warning using __builtin_offsetof Kaneda, Erik
2020-06-10 23:06 ` Kaneda, Erik
2020-06-10 23:29 ` Nick Desaulniers
2020-06-10 23:46 ` Jung-uk Kim
2020-06-11 16:45 ` [Devel] " Kaneda, Erik
2020-06-11 17:06 ` Nick Desaulniers
2020-06-16 21:39 ` Kaneda, Erik
2020-06-10 23:31 ` Jung-uk Kim
2020-05-22 8:07 ` arm64/acpi: NULL dereference reports from UBSAN at boot Hanjun Guo
2020-05-22 9:43 ` Hanjun Guo
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=20200608145150.GA7418@willie-the-truck \
--to=will@kernel.org \
--cc=ardb@kernel.org \
--cc=devel@acpica.org \
--cc=dvyukov@google.com \
--cc=erik.kaneda@intel.com \
--cc=glider@google.com \
--cc=guohanjun@huawei.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=mark.rutland@arm.com \
--cc=ndesaulniers@google.com \
--cc=pcc@google.com \
--cc=rafael.j.wysocki@intel.com \
--cc=rjw@rjwysocki.net \
--cc=robert.moore@intel.com \
--cc=stable@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