提交 eb06f43f 编写于 作者: A Andrey Ryabinin 提交者: Linus Torvalds

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: NAndrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Reviewed-by: NDmitry Vyukov <dvyukov@google.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 89d3c87e
...@@ -238,6 +238,7 @@ static void kasan_report_error(struct kasan_access_info *info) ...@@ -238,6 +238,7 @@ static void kasan_report_error(struct kasan_access_info *info)
} }
pr_err("=================================" pr_err("================================="
"=================================\n"); "=================================\n");
add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
spin_unlock_irqrestore(&report_lock, flags); spin_unlock_irqrestore(&report_lock, flags);
kasan_enable_current(); kasan_enable_current();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册