Re: [GIT PULL] more printk for 6.15

From: Kees Cook
Date: Thu Apr 03 2025 - 12:16:30 EST


On Wed, Apr 02, 2025 at 10:25:46PM +0300, Andy Shevchenko wrote:
> I actually don't know what the benefit of __printf() attribute from
> security (?) point of view is. I may speculate that this helps to
> validate the format string and arguments (when provided as ...) and
> helps with potential wrong argument sizes, etc. Kees, what do you
> think about Linus' proposal?

It's a bit low on the severity list since we long ago removed %n, but
it's effectively a form of type-checking for arguments to printf. I look
at it more as a robustness/correctness checker. If we can make it work,
it's good to have. And it looks like Nathan's suggestion will make it
feasible.

-Kees

--
Kees Cook