Re: [PATCHv2] kernel/panic: allocate taint string buffer dynamically

From: Rio

Date: Sun Feb 22 2026 - 10:24:41 EST


This follow-up provides some tradeoffs between v1 and v2

- v1 used a fixed-size static buffer, requiring manual updates whenever
new strings are added to taint_flags[].
- v2 uses a fixed-size static buffer only for initial boot. Once kmalloc
is available, it allocates a dynamically sized buffer based on the total
length of strings in taint_flags[].

- v1 needs an update every time taint_flags[] is updated.
- v2 relies on the initial buffer as a fallback mechanism in case kmalloc
fails. The initial buffer is currently large enough for all taint strings,
but future updates to taint_flags[] may require adjustments.

- v1 is more predictable, but requires more manual maintenance.
- v2 is more convenient, but introduces subtle edge cases and potential
allocation issues.