[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170626235122.GA25261@beast>
Date: Mon, 26 Jun 2017 16:51:22 -0700
From: Kees Cook <keescook@...omium.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Jonathan Corbet <corbet@....net>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Daniel Micay <danielmicay@...il.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] fortify: Avoid panic() in favor of BUG()
Since detection of a given fortify failure is sufficient to stop the
memory corruption from happening, it doesn't make sense to unconditionally
bring down the entire system. Instead, use BUG() which will stop the bad
thread of kernel execution (and only optionally panic the system).
Cc: Daniel Micay <danielmicay@...il.com>
Signed-off-by: Kees Cook <keescook@...omium.org>
---
lib/string.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/string.c b/lib/string.c
index a6ee1955a701..ebbb99c775bd 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -981,6 +981,7 @@ EXPORT_SYMBOL(strreplace);
void fortify_panic(const char *name)
{
- panic("detected buffer overflow in %s", name);
+ pr_emerg("detected buffer overflow in %s\n", name);
+ BUG();
}
EXPORT_SYMBOL(fortify_panic);
--
2.7.4
--
Kees Cook
Pixel Security
Powered by blists - more mailing lists