aboutsummaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorAndrey Ryabinin <aryabinin@virtuozzo.com>2015-11-05 18:51:26 -0800
committerAlex Shi <alex.shi@linaro.org>2016-04-11 22:59:46 +0800
commitf5fd52f2dc0b6d1a02bed15572a6c199515fc33d (patch)
tree3ef78b55c5896fe9fa993c1d985f0b212ca97b8d /mm
parent03fe9ea4782a51b932d58d181479d497d89ff016 (diff)
kasan: always taint kernel on report
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> Cc: Alexander Potapenko <glider@google.com> Reviewed-by: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> (cherry picked from commit eb06f43f1c94d502b7867b0998e92cdabbc060bc) Signed-off-by: Alex Shi <alex.shi@linaro.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/kasan/report.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/kasan/report.c b/mm/kasan/report.c
index c59fc0e16d17..e0b3e94ecdb5 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();
}