From: Thomas Meyer <thomas@m3y3r.de>
To: syzkaller@googlegroups.com, richard@nod.at,
user-mode-linux-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Cc: Thomas Meyer <thomas@m3y3r.de>
Subject: [PATCH] um: Fix kcov crash before kernel is started.
Date: Sat, 14 Oct 2017 00:00:25 +0200 [thread overview]
Message-ID: <20171013220025.3619-1-thomas@m3y3r.de> (raw)
In-Reply-To: <CACT4Y+Ye1Yw3SPCy80_JAqNGdqtSFTMVMc02-rbfJv1omT5Qhw@mail.gmail.com>
UMLs current_thread_info() unconditionally assumes that the top of the stack
contains the thread_info structure.
Prevent kcov from using invalid curent_thread_info() data by disable
instrumentation of early startup code.
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
arch/um/kernel/skas/Makefile | 2 ++
lib/Makefile | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/arch/um/kernel/skas/Makefile b/arch/um/kernel/skas/Makefile
index 0b76d8869c94..df3aedb974a2 100644
--- a/arch/um/kernel/skas/Makefile
+++ b/arch/um/kernel/skas/Makefile
@@ -3,6 +3,8 @@
# Licensed under the GPL
#
+KCOV_INSTRUMENT := n
+
obj-y := clone.o mmu.o process.o syscall.o uaccess.o
# clone.o is in the stub, so it can't be built with profiling
diff --git a/lib/Makefile b/lib/Makefile
index dafa79613fb4..18319ad5daab 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -16,6 +16,10 @@ KCOV_INSTRUMENT_list_debug.o := n
KCOV_INSTRUMENT_debugobjects.o := n
KCOV_INSTRUMENT_dynamic_debug.o := n
+ifdef CONFIG_UML
+KCOV_INSTRUMENT_cmdline.o := n
+endif
+
lib-y := ctype.o string.o vsprintf.o cmdline.o \
rbtree.o radix-tree.o dump_stack.o timerqueue.o\
idr.o int_sqrt.o extable.o \
--
2.11.0
next prev parent reply other threads:[~2017-10-13 22:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171009163710.o5z5xjnlvmo3mi52@olymp>
2017-10-09 18:10 ` [thomas@m3y3r.de: Re: [PATCH] um: Fix kcov crash before kernel is started.] Dmitry Vyukov
2017-10-09 19:16 ` Thomas Meyer
2017-10-10 8:59 ` Dmitry Vyukov
2017-10-10 10:14 ` Mark Rutland
2017-10-13 22:00 ` Thomas Meyer [this message]
2017-10-14 8:05 ` [PATCH] um: Fix kcov crash before kernel is started Richard Weinberger
2017-10-08 10:31 Thomas Meyer
2017-10-08 10:44 ` Richard Weinberger
2017-10-08 11:18 ` Thomas Meyer
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=20171013220025.3619-1-thomas@m3y3r.de \
--to=thomas@m3y3r.de \
--cc=linux-kernel@vger.kernel.org \
--cc=richard@nod.at \
--cc=syzkaller@googlegroups.com \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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
all inboxes | Powered by JetHome®