From: Petr Mladek <pmladek@suse.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
Steven Rostedt <rostedt@goodmis.org>,
coverity-bot <keescook@chromium.org>,
"Gustavo A . R . Silva" <gustavo@embeddedor.com>,
linux-next@vger.kernel.org, linux-hardening@vger.kernel.org,
linux-kernel@vger.kernel.org,
coverity-bot <keescook+coverity-bot@chromium.org>
Subject: Re: [PATCH] printk: Use scnprintf() to print the message about the dropped messages on a console
Date: Wed, 18 Jan 2023 10:31:16 +0100 [thread overview]
Message-ID: <Y8e8ZCTdEWU0iUqJ@alley> (raw)
In-Reply-To: <20230117161031.15499-1-pmladek@suse.com>
On Tue 2023-01-17 17:10:31, Petr Mladek wrote:
> Use scnprintf() for printing the message about dropped messages on
> a console. It returns the really written length of the message.
> It prevents potential buffer overflow when the returned length is
> later used to copy the buffer content.
>
> Note that the previous code was safe because the scratch buffer was
> big enough and the message always fit in. But scnprintf() makes
> it more safe, definitely.
>
> Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
> Addresses-Coverity-ID: 1530570 ("Memory - corruptions")
> Fixes: c4fcc617e148 ("printk: introduce console_prepend_dropped() for dropped messages")
> Link: https://lore.kernel.org/r/202301131544.D9E804CCD@keescook
> Signed-off-by: Petr Mladek <pmladek@suse.com>
JFYI, the patch has been comitted into printk/linux.git,
branch rework/buffers-cleanup.
Best Regards,
Petr
prev parent reply other threads:[~2023-01-18 10:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-17 16:10 [PATCH] printk: Use scnprintf() to print the message about the dropped messages on a console Petr Mladek
2023-01-17 21:48 ` John Ogness
2023-01-18 0:33 ` Sergey Senozhatsky
2023-01-18 9:31 ` Petr Mladek [this message]
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=Y8e8ZCTdEWU0iUqJ@alley \
--to=pmladek@suse.com \
--cc=gustavo@embeddedor.com \
--cc=john.ogness@linutronix.de \
--cc=keescook+coverity-bot@chromium.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.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