Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Silent UB alignment issues in acpica under kUBSan



details:   https://anonhg.NetBSD.org/src/rev/4e824e634805
branches:  trunk
changeset: 448916:4e824e634805
user:      kamil <kamil%NetBSD.org@localhost>
date:      Wed Feb 13 18:04:35 2019 +0000

description:
Silent UB alignment issues in acpica under kUBSan

Pass -DACPI_MISALIGNMENT_NOT_SUPPORTED under kUBSan enabled. This option
is dedicated for alignment sensitive CPUs in acpica. It was originally
designed for Itanium CPUs, but nowadays it's wanted for aarch64 as well.

Define it in acpica code under kUBSan in order to pacify Undefined Behavior
reports on all ports (in particular x86). The number of reports is now
halved with this patch applied. The remaining alignment alarms in acpica
will be addressed in future.

Patch contributed by <Akul Pillai>

diffstat:

 sys/kern/files.kern |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (14 lines):

diff -r ae803daaa11c -r 4e824e634805 sys/kern/files.kern
--- a/sys/kern/files.kern       Wed Feb 13 17:17:02 2019 +0000
+++ b/sys/kern/files.kern       Wed Feb 13 18:04:35 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.kern,v 1.31 2019/01/27 02:08:43 pgoyette Exp $
+#      $NetBSD: files.kern,v 1.32 2019/02/13 18:04:35 kamil Exp $
 
 #
 # kernel sources
@@ -228,3 +228,4 @@
 file   ubsan.c                         kubsan
 prefix
 makeoptions    kubsan  CFLAGS+="-fsanitize=undefined"
+makeoptions    kubsan  CPPFLAGS+="-DACPI_MISALIGNMENT_NOT_SUPPORTED"



Home | Main Index | Thread Index | Old Index