linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kasan: always taint kernel on report.
@ 2015-10-21 16:28 Andrey Ryabinin
  2015-10-22 10:15 ` Dmitry Vyukov
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Ryabinin @ 2015-10-21 16:28 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, Alexander Potapenko, Dmitriy Vyukov, Andrey Ryabinin

Currently we already taint the kernel in some cases.
E.g. if we hit some bug in slub memory we call object_err()
which will taint the kernel with TAINT_BAD_PAGE flag.
But for other kind of bugs kernel left untainted.

Always taint with TAINT_BAD_PAGE if kasan found some bug.
This is useful for automated testing.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 mm/kasan/report.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/kasan/report.c b/mm/kasan/report.c
index f5e068a..12f222d 100644
--- a/mm/kasan/report.c
+++ b/mm/kasan/report.c
@@ -238,6 +238,7 @@ static void kasan_report_error(struct kasan_access_info *info)
 	}
 	pr_err("================================="
 		"=================================\n");
+	add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
 	spin_unlock_irqrestore(&report_lock, flags);
 	kasan_enable_current();
 }
-- 
2.4.10

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-22 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-21 16:28 [PATCH] kasan: always taint kernel on report Andrey Ryabinin
2015-10-22 10:15 ` Dmitry Vyukov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox