Thread (39 messages) flat view 39 messages, 11 authors, 2019-05-15

RE: [PATCH] vsprintf: Do not break early boot with probing addresses

From: David Laight <hidden>
Date: 2019-05-13 08:52:46
Also in: linux-arch, linux-s390, lkml

From: christophe leroy
Sent: 10 May 2019 18:35
Le 10/05/2019 à 18:24, Steven Rostedt a écrit :
quoted
On Fri, 10 May 2019 10:42:13 +0200
Petr Mladek [off-list ref] wrote:
quoted
  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)";
"efault" looks a bit like a spellling mistake for "default".
quoted
	< PAGE_SIZE ?

do you mean: < TASK_SIZE ?
I guess not.

Usually, < PAGE_SIZE means NULL pointer dereference (via the member of a
struct)
Maybe the caller should pass in a short buffer so that you can return
"(err-%d)" or "(null+%#x)" ?

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help