On Mon, Jun 1, 2020 at 4:37 PM Peter Collingbourne pcc@google.com wrote:
On Mon, Jun 1, 2020 at 4:18 PM Nick Desaulniers ndesaulniers@google.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.
Would it be better to s/ACPI_OFFSET/offsetof/g the existing users of this macro and remove it? It looks like offsetof is already being used pervasively in the kernel, and its definition comes from <linux/stddef.h>.
I count only 9 uses in the tree, so not too bad a yak shave. Good idea; I'll send tomorrow short of any other feedback. I still think we want the builtin, since we don't want to include stddef.h in the kernel, I think.