Re: [PATCH 1/2] drm/panic: Fix kmsg screen hang on a long log line
From: Devin Wittmayer
Date: Fri Oct 16 2026 - 11:52:59 EST
On Fri, Oct 16, 2026 at 05:39:51AM +0000, sashiko-bot@xxxxxxxxxx wrote:
> Does this code underflow the pointer arithmetic if kmsg_len is 1?
Yes, when a chunk holds only an empty line. The pointer is then only
compared, never read, and nothing is drawn.
> Does the strict inequality prematurely terminate parsing? It appears it
> would silently drop 1-char lines.
Yes, when the one character line is the first in a chunk. Anywhere else
it is drawn.
> It also seems to skip the first log line of every kmsg dump chunk,
> because the loop stops before processing when start reaches kmsg_buf.
No, a normal first line is drawn.
Both real cases need printk timestamps off, and both also happen without
this patch. QEMU on drm-misc-fixes, timestamps off, 10 runs each, with
and without this patch:
normal line at a chunk start drawn
one character line at a chunk start not drawn
one character line mid chunk drawn
chunk of only an empty line pointer one before the buffer,
nothing drawn
With timestamps on, the one character line was drawn and no chunk held
only an empty line. Every run rebooted.
Devin