Re: [GIT PULL] tracing: Prevent trace_marker being bigger than unsigned short

From: Linus Torvalds
Date: Sat Mar 02 2024 - 15:25:33 EST


On Sat, 2 Mar 2024 at 12:00, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> I don't have control over the strings. Anyone can do in user space:
>
> fd = open("/sys/kernel/tracing/trace_marker", O_WRONLY);
> r = write(fd, huge_string, 10000000);

So?

Stop the stupidity.

You already limit the string.

Just limit it to a sane value. if somebody uses a 10kB trace marker,
return an error, or just truncate it to 100 bytes.

You already were willing to truncate it to 32kB. Use your brain, and
realize that 32kB is a ridiculous limit.

Why do I even need to tell you this? I'm getting really tired of
having these idiotic arguments with you.

Linus