Decode kernel panic from QR Code photo

44 pointsposted 4 days ago
by modinfo

22 Comments

jolmg

3 days ago

For context, kernel panics seem to sometimes be encoded as a URL in the QR code by distros. The panic text is encoded as a numeric parameter. For example:

  https://jexposit.fedorapeople.org/drm-panic/#?a=x86_64&v=6.17.0-rc2+&z=64016708045408584681305161836175901065787789727173061004041671633088591186286363786562987653814347942450168430510852681524688435157911241621365859153819732690406649525043247774110913752991389170560320455163781439079986337356710273501164645667555084821480237326301207073831710176482850121513079951455217310046422632328303510474264780788030301611164774573122018172510304672562667379831349924441560360997679573341401750485619388375493[... many more digits]
That's from the QR code image at:

https://discussion.fedoraproject.org/t/f45-change-proposal-d...

This script is to decode such kernel panics without needing to provide it to an external service.

In the particular URL example, the panic is not necessarily sent to a server, because it's in a URL fragment (`#`), but still.

userbinator

2 days ago

The panic text is encoded as a numeric parameter.

This script is to decode such kernel panics without needing to provide it to an external service.

WTF. A solution for an entirely self-inflicted problem.

jolmg

2 days ago

> self-inflicted

Distro developers and user are separate people. Also, a person viewing the QR code is not necessarily the owner of the panicked system.

userbinator

2 days ago

Distro developers and user are separate people.

No, they don't have to be. How did this user-hostile attitude infect Linux too?

Also, a person viewing the QR code is not necessarily the owner of the panicked system.

So what? Stop hiding things from users. If they don't care they don't have to read. If they do, don't make them jump through additional hoops.

jolmg

2 days ago

It being user-hostile is debatable. It's meant to be friendlier, as described in the Fedora link I shared. Coincidentally though, I got a panic yesterday and my phone wasn't able to scan the QR code, lol, so who knows what the panic was.

The non-QR/textual panics can be restored with a kernel/module parameter as described here:

https://wiki.archlinux.org/title/Kernel#QR_code_on_a_blue_sc...

The QR code can be made to provide the text itself (non-URL-encoded) by rebuilding the kernel with CONFIG_DRM_PANIC_SCREEN_QR_CODE_URL unset.

compsciphd

a day ago

its not user hostile. As demonstrated here it doesn't require it going to an external service (its just constructed as such to make it easy for users)

its meant to make it easy to extract the panic as unless one has a serial console attached, wont have it in a text form that one can use in any manner.

userbinator

2 days ago

I hope this is Windows-inspired satire. If I get a kernel panic I want something I can actually read.

kouosi

2 days ago

It's been there for like 2 years (6.12 iirc) so it is not satire it is real.

natas

3 days ago

I think that's a really good idea! Would love to see this upstream

bri3d

3 days ago

It is? This is drm-panic qr codes from Linux 6.12. It’s a neat feature but I’m not sure why this random implementation is particularly interesting.

theowaway213456

3 days ago

Can't a phone decode a QR code natively? I don't even get what it does

hamandcheese

3 days ago

If you decode it and open the link, you are potentially leaking data to whoever controls the domain of the URL.

creatonez

2 days ago

It's a possibility, but it's not how these kernel panic viewer websites are currently implemented. They do the decoding on the clientside, with the data stored in the URL fragment, which is not sent to the server by default.

Still good to have alternative implementations, though. The Javascript could be silently stealing the URL fragment on only specific requests, so there's no real way to audit it to be sure.

catlifeonmars

3 days ago

Link previews even! Just paste it into a group chat and everyone’s message clients will happily issue a GET request.

charcircuit

3 days ago

That's not how it works. The chat app requests the link preview and caches it.

catlifeonmars

2 days ago

That’s how link previews work on iOS (it was the cause of the zero click RCE a few years ago by executing row hammer through WebView), so I guess it depends on your software.

ranger_danger

2 days ago

This is why I like to use Binary Eye, it never acts on anything automatically when scanning a code, you have to tell it to.

user

3 days ago

[deleted]

catlifeonmars

3 days ago

You can decode a QR code by hand. It’s usually not worth your while but it’s understandable.

kzrdude

3 days ago

This is about a second step of decoding.

Qr -> URL -> Panic Log