From: Andrey Ryabinin Date: Fri, 6 Nov 2015 02:51:26 +0000 (-0800) Subject: kasan: always taint kernel on report X-Git-Tag: v4.4-rc1~99^2~5 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=eb06f43f1c94d502b7867b0998e92cdabbc060bc;p=linux.git 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 Cc: Alexander Potapenko Reviewed-by: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/kasan/report.c b/mm/kasan/report.c index f5e068afb58e..12f222d0224b 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(); }