[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wgR7NrXTk8rJbWEv0PBN5z8kbyWaWqKO_UDnK1DXoSbqg@mail.gmail.com>
Date: Mon, 4 Mar 2024 16:17:15 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Masami Hiramatsu <mhiramat@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, Sachin Sant <sachinp@...ux.ibm.com>
Subject: Re: [GIT PULL] tracing: Prevent trace_marker being bigger than
unsigned short
On Mon, 4 Mar 2024 at 15:50, Steven Rostedt <rostedt@...dmis.org> wrote:
>
> But this still isn't fixing anything. It's just adding a limit.
Limiting things to a common maximum size is a good thing. The kernel
limits much more important things for very good reasons.
The kernel really shouldn't have big strings. EVER. And it literally
shows in our kernel infrastructure. It showed in that vsnprintf
precision thing. It shows in our implementation choices, where we tend
to have simplistic implementations because doing things a byte at a
time is simple and cheap when the strings are limited in size (and we
don't want fancy and can't use vector state anyway).
If something as core as a pathname can be limited to 4kB, then
something as unimportant as a trace string had better be limited too.
Because we simply DO NOT WANT to have to deal with longer strings in
the kernel.
Linus
Powered by blists - more mailing lists