From: Dave Jones <davej@codemonkey.org.uk>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Subject: Re: UBSAN: run-time undefined behavior sanity checker
Date: Fri, 22 Jan 2016 00:15:39 -0500 [thread overview]
Message-ID: <20160122051539.GA1326@codemonkey.org.uk> (raw)
In-Reply-To: <20160121205717.AF61F661293@gitolite.kernel.org>
On Thu, Jan 21, 2016 at 08:57:17PM +0000, Linux Kernel wrote:
> Web: https://git.kernel.org/torvalds/c/c6d308534aef6c99904bf5862066360ae067abc4
> Commit: c6d308534aef6c99904bf5862066360ae067abc4
> Parent: 68920c973254c5b71a684645c5f6f82d6732c5d6
> Refname: refs/heads/master
> Author: Andrey Ryabinin <aryabinin@virtuozzo.com>
> AuthorDate: Wed Jan 20 15:00:55 2016 -0800
> Committer: Linus Torvalds <torvalds@linux-foundation.org>
> CommitDate: Wed Jan 20 17:09:18 2016 -0800
>
> UBSAN: run-time undefined behavior sanity checker
>
> UBSAN uses compile-time instrumentation to catch undefined behavior
> (UB). Compiler inserts code that perform certain kinds of checks before
> operations that could cause UB. If check fails (i.e. UB detected)
> __ubsan_handle_* function called to print error message.
>
> So the most of the work is done by compiler. This patch just implements
> ubsan handlers printing errors.
>
> GCC has this capability since 4.9.x [1] (see -fsanitize=undefined
> option and its suboptions).
> However GCC 5.x has more checkers implemented [2].
> Article [3] has a bit more details about UBSAN in the GCC.
If I enable this and CONFIG_UBSAN_ALIGNMENT, the kernel doesn't boot,
and hangs really early (pretty much as soon as I hit return in grub)
far too early for serial console or even tty output.
Compiler is debian unstable's 5.3.1 20160114
I don't know if this is worth chasing down, I chose to just disable it,
but figured I'd post in case other people stumble across the same issue.
That aside though, neat feature. I look forward to breaking kernels with it :)
Dave
next parent reply other threads:[~2016-01-22 5:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20160121205717.AF61F661293@gitolite.kernel.org>
2016-01-22 5:15 ` Dave Jones [this message]
2016-01-22 16:43 ` UBSAN: run-time undefined behavior sanity checker Andrey Ryabinin
2016-01-22 17:00 ` Dave Jones
2016-01-25 14:03 ` Andrey Ryabinin
[not found] ` <20160126165322.GA24364@codemonkey.org.uk>
2016-02-01 16:08 ` Andrey Ryabinin
2016-02-01 22:18 ` Dave Jones
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=20160122051539.GA1326@codemonkey.org.uk \
--to=davej@codemonkey.org.uk \
--cc=aryabinin@virtuozzo.com \
--cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).