Home | History | Annotate | Download | only in misc
History log of /src/common/lib/libc/misc/ubsan.c
RevisionDateAuthorComments
 1.12  07-Dec-2023  andvar s/miltiple/multiple/ in comment.
 1.11  19-Sep-2021  andvar fix various typos in comments, messages and documentation.
 1.10  08-Mar-2020  kamil Add support for alignment_assumptions in uubsan

Cherry-pick from FreeBSD:

From 7c1bc5ffc2fa68ddc76e5ea8a3a1a6fdfeee57f0 Mon Sep 17 00:00:00 2001
From: andrew <andrew@FreeBSD.org>
Date: Tue, 28 May 2019 09:12:15 +0000
Subject: [PATCH] Teach the kernel KUBSAN runtime about alignment_assumption

This checks the alignment of a given pointer is sufficient for the
requested alignment asked for. This fixes the build with a recent
llvm/clang.

Sponsored by: DARPA, AFRL
 1.9  01-Nov-2019  kamil uubsan: Implement function_type_mismatch_v1

RTTI is not supported by micro-UBSan (by design) and this is now a stub
handler.
 1.8  30-Oct-2019  kamil uubsan: Handle implicit_conversion
 1.7  04-Oct-2019  mrg workaround a GCC 8 warning:

- code that will be unreachable on platforms with
sizeof(double) != sizeof(unsigned long) triggered an valid out
of bounds warning. avoid the error by using sizeof ul.
- also assert that the sizes are the same if entering here.

both from kamil@.
 1.6  17-Jun-2019  kamil Introduce UBSAN_ALWAYS_FATAL in micro-UBSan

UBSAN_ALWAYS_FATAL is a CPP option to mark all reports fatal always.
 1.5  13-Feb-2019  kamil branches: 1.5.2;
Fix kUBSan build with GCC7

Add missing __unreachable() and FALLTHROUGH keywords.

Reported by <Akul Pillai>
 1.4  04-Feb-2019  mrg - use __unreachable() and move 'break's around to increase consistency
and correctness

ok kamil@
 1.3  03-Aug-2018  kamil branches: 1.3.2;
Try to fix the evbppc-powerpc64 build

Avoid "comparison between signed and unsigned integer expressions" on
Big-Endian hosts.
 1.2  03-Aug-2018  kamil Tidy up the comment in ubsan.c

As noted, style has no impact on the comparison of a similar code.
This version is a reimplementation from scratch with no code and no
algirithm (whenever possible) reuse.

Public symbols and struct layout must be kept in sync with the code
generation part. It casues violation of the style like with long filenames.

My previous comment was 'too perfect' and could trigger some unnecessary
attention.
 1.1  03-Aug-2018  kamil Import micro-UBSan (ubsan.c)

This is a reimplementation of the Undefined Behavior Sanitizer with the
following properties:
- pure and clean-room C implementation,
- no -fsanitize=vpts support, as it requires RTTI support and C++
low-level routies to validate whether C++ objects are compatible
- designed to be used inside libc and known as uUBSan or user-UBSan
- designed to be shared with kernel and known as kUBSan or kernel-UBSan
- designed to be usable with ATF tests as a standalone runtime,
reachable without any MK* switches
- designed to be safer for hardening as it does not have side effects on
executables like writing to a selected location on demand
- controllable with environment variable LIBC_UBSAN with options:
* a - abort on report
* A - do not abort on a report (unless a failure is unrecoverable)
* e - output report to stderr
* E - do not output report on stderr
* l - output report on syslog (LOG_DEBUG | LOG_USER)
* L - do not output report on syslog
* o - output report on stdout
* O - do not output report on stdout
The default options are: "AeLO".
- compatible with Clang (3.8, 7.x) and GCC (6.x) code generation
- all handlers (except =vptr) from Clang/LLVM up to 7svn are supported

Tested with Clang amd64+i386 and GCC amd64+i386.
 1.3.2.2  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.3.2.1  03-Aug-2018  pgoyette file ubsan.c was added on branch pgoyette-compat on 2018-09-06 06:51:32 +0000
 1.5.2.5  21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.5.2.4  21-Apr-2020  martin Sync with HEAD
 1.5.2.3  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5.2.2  10-Jun-2019  christos Sync with HEAD
 1.5.2.1  13-Feb-2019  christos file ubsan.c was added on branch phil-wifi on 2019-06-10 21:41:07 +0000

RSS XML Feed