提交 e290e6af 编写于 作者: L Linus Torvalds

Merge tag 'printk-for-5.2-fixes' of...

Merge tag 'printk-for-5.2-fixes' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/pmladek/printk

Pull printk fixup from Petr Mladek:
 "Replace the problematic probe_kernel_read() with original simple
  pointer checks in vsprintf()"

* tag 'printk-for-5.2-fixes' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/pmladek/printk:
  vsprintf: Do not break early boot with probing addresses
...@@ -628,19 +628,16 @@ static char *error_string(char *buf, char *end, const char *s, ...@@ -628,19 +628,16 @@ static char *error_string(char *buf, char *end, const char *s,
} }
/* /*
* This is not a fool-proof test. 99% of the time that this will fault is * Do not call any complex external code here. Nested printk()/vsprintf()
* due to a bad pointer, not one that crosses into bad memory. Just test * might cause infinite loops. Failures might break printk() and would
* the address to make sure it doesn't fault due to a poorly added printk * be hard to debug.
* during debugging.
*/ */
static const char *check_pointer_msg(const void *ptr) static const char *check_pointer_msg(const void *ptr)
{ {
char byte;
if (!ptr) if (!ptr)
return "(null)"; return "(null)";
if (probe_kernel_address(ptr, byte)) if ((unsigned long)ptr < PAGE_SIZE || IS_ERR_VALUE(ptr))
return "(efault)"; return "(efault)";
return NULL; return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册