# Re: \[PATCH\] printk: Userspace format enumeration support

- From: Chris Down \<chris@chrisdown.name\>
- Date: 2021-02-07 16:54:24 
- List: linux-api
- Page: https://ratatoskr.run/linux-api/2021/02/6261685
- Thread: https://ratatoskr.run/linux-api/2021/02/6260047/t.md

```text
Chris Down writes:
>>>3. `KERN_SOH + level' can appear in other places than just printk strings
>>>
>>>KERN_SOH is just ASCII '\001' -- it's not distinctive or unique, even when
>>>paired with a check for something that looks like a level after it. For this
>>>reason, your proposed patch results in a non-trivial amount of non-printk
>>>related garbage in its output. For example:
>>>
>>>     % binutils/strings -k /tmp/vmlinux | head -5
>>>     3L)s
>>>     3L)s
>>>     c,[]A\
>>>     c(L)c
>>>     d$pL)d$`u4
>>>
>>>Fundamentally, one cannot use a tool which just determines whether something is
>>>printable to determine semantic intent.
>>
>>$ kernel_strings --kernel --section ".rodata" vmlinux
>>
>>I got exactly 0.
>
>"It works on my computer" is not a valid testing methodology, especially for something as complex as the Linux kernel. It's especially not a valid rebuttal to someone demonstrating that it clearly doesn't work on theirs.
>
>Even filtering to the .rodata section, there's plenty of garbage just in the first five cases:
>
>    % binutils/strings --kernel --section ".rodata" /tmp/vmlinux | head -5
>    3******* Your BIOS seems to not contain a fix for K8 errata #93
>    1>pBC)
>    dTRAC
>    6Run %s as init process
>    7calling  %pS @ %i
>
>Clearly there are cases that you are not considering. My kernel config is attached if you want to try and replicate, but regardless, it's really not valid to say "it works for me" in response to someone showing that it doesn't.

Attached.
```

## Attachments

- [config](https://ratatoskr.run/linux-api/2021/02/6261685/attachment/0) (text/plain, 68031 bytes)
