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

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

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2019-05-14 19:35:07
Also in: linux-arch, linux-s390, lkml

On Tue, 14 May 2019 21:13:06 +0200
Geert Uytterhoeven [off-list ref] wrote:
quoted
quoted
Do we care about the value? "(-E%u)"?  
That too could be confusing. What would (-E22) be considered by a user
doing an sprintf() on some string. I know that would confuse me, or I
would think that it was what the %pX displayed, and wonder why it
displayed it that way. Whereas "(fault)" is quite obvious for any %p
use case.  
I would immediately understand there's a missing IS_ERR() check in a
function that can return  -EINVAL, without having to add a new printk()
to find out what kind of bogus value has been received, and without
having to reboot, and trying to reproduce...
Hi Geert,

I have to ask. Has there actually been a case that you used a %pX and
it faulted, and you had to go back to find what the value of the
failure was?

IMO, sprintf() should not be a tool to do this, because then people
will not add their IS_ERR() and just let sprintf() do the job for them.
I don't think that would be wise to allow.

-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help