linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [GIT PULL] tracing: Prevent trace_marker being bigger than unsigned short
Date: Sat, 2 Mar 2024 12:33:01 -0800	[thread overview]
Message-ID: <CAHk-=wgjhdRj1V847NTF4veMN_tCbrySiEHXO8RO3n05cNeXeA@mail.gmail.com> (raw)
In-Reply-To: <20240302145958.05aabdd2@rorschach.local.home>

On Sat, 2 Mar 2024 at 12:00, Steven Rostedt <rostedt@goodmis.org> wrote:
>
> The error isn't printk, it's vsnprintf() that is writing to a seq_file
> to user space. There's no stack or printk involved here.

Look again. The code uses 'struct printf_spec' and we literally have a

   static_assert(sizeof(struct printf_spec) == 8);

because we want the compiler to generate sane calling conventions and
not waste space and code with arguments on the stack. That's literally
why we do all those limits in a bitfield - because the code in
question is written to say "unreasonable people can go screw
themselves".

I'm not interested in arguing this. We're not doing some completely
idiotic "let's edge up to the physical limit of what our printk code
is willing to do".

I'm perfectly happy having that WARN_ON() to continue to tell people
they are doing stupid things that won't work.

And if you ever decide that a sane limit is ok, you can send that in.

            Linus

  parent reply	other threads:[~2024-03-02 20:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-02 16:12 [GIT PULL] tracing: Prevent trace_marker being bigger than unsigned short Steven Rostedt
2024-03-02 17:24 ` Linus Torvalds
2024-03-02 19:59   ` Steven Rostedt
2024-03-02 20:25     ` Linus Torvalds
2024-03-02 20:33     ` Linus Torvalds [this message]
2024-03-02 20:47       ` Steven Rostedt
2024-03-02 20:55         ` Linus Torvalds
2024-03-03 12:59           ` Steven Rostedt
2024-03-03 13:02             ` Steven Rostedt
2024-03-03 17:38             ` Linus Torvalds
2024-03-03 19:07               ` Steven Rostedt
2024-03-03 20:09                 ` Linus Torvalds
2024-03-03 21:00                   ` Steven Rostedt
2024-03-04 21:42                     ` Steven Rostedt
2024-03-04 21:50                       ` Linus Torvalds
2024-03-04 22:10                         ` Steven Rostedt
2024-03-04 23:20                           ` Linus Torvalds
2024-03-04 23:47                             ` Steven Rostedt
2024-03-04 23:52                               ` Steven Rostedt
2024-03-05  0:17                                 ` Linus Torvalds
2024-03-05  0:43                                   ` Steven Rostedt
2024-03-05  1:20                                     ` Mathieu Desnoyers
2024-03-02 20:26   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHk-=wgjhdRj1V847NTF4veMN_tCbrySiEHXO8RO3n05cNeXeA@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).