Printk fixup for 5.2

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEESH4wyp42V4tXvYsjUqAMR0iAlPIFAlzVjNEACgkQUqAMR0iA
 lPIq1xAAjgROavrbysfBGXtlAqeNCuwdg6KXA5JuIFKqp/6YdIByweaHomZvncTv
 b0yqh4L3oj8tJ47QCN3pUXMQo1XTkcrnJbd2fKtvJO96/gbHhYVv1u/+sg/AwEYd
 tIwjUMFTzHh9uHNVu3PtEYrg1dkBtvtpFvwRsMYbneErdImN4v1jwXC9A7sBnY0X
 8BHXT3ioT6C5Bs4z6LYcapvSHm/ypBXrAgqn+wEqTU1IZCVRM6PqaGr8u385oA2Q
 5Wp0Mgsrd2emxrGzXwnMnLY54MuVwcNWNXK3YM/ejFmz+1vAVTVu+daUe1lHAIUd
 SiludveFTokyrdKBZ55dCLEV5wtyQ5uF0BrKPehA+tlMJbwx7Q3Mlolcz6cxY73K
 QFMx0Ja2hnP3HELT2tMmZB9oNMQErHeRgbvj9gQqiLIdCQArs9o9jUE01AzOI3wz
 kCqcwMO4Rc49QpkUFVSY7kJ3afWZPhRsuGtUCqRU17tvEaW1G/gGzfNd4SSecNeX
 QZ8UCzkKth+CjCVd6hUhq4wzJ0aOGcZWG0N8+xXRbMFHkJLIrrTxgkey0+7x7Cx1
 TxNO3E4slyk0Jr3kGyalZ63C6OlkoFksIfuisir3nULQEookODnG7tMRF5spPdEM
 X0tyESsEU0RnVV1gE2Y0Ebtu3eDj1Cw4WpN7YBosODqXgWKENHg=
 =lg6O
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2019-05-10 13:14:07 -04:00
commit e290e6af1d
1 changed files with 4 additions and 7 deletions

View File

@ -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
* due to a bad pointer, not one that crosses into bad memory. Just test
* the address to make sure it doesn't fault due to a poorly added printk
* during debugging.
* Do not call any complex external code here. Nested printk()/vsprintf()
* might cause infinite loops. Failures might break printk() and would
* be hard to debug.
*/
static const char *check_pointer_msg(const void *ptr)
{
char byte;
if (!ptr)
return "(null)";
if (probe_kernel_address(ptr, byte))
if ((unsigned long)ptr < PAGE_SIZE || IS_ERR_VALUE(ptr))
return "(efault)";
return NULL;