From: Petr Mladek <pmladek@suse.com>
To: Kees Cook <keescook@chromium.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
Steven Rostedt <rostedt@goodmis.org>,
John Ogness <john.ogness@linutronix.de>,
Vijay Balakrishna <vijayb@linux.microsoft.com>,
stable@vger.kernel.org, Tony Luck <tony.luck@intel.com>,
"Guilherme G. Piccoli" <gpiccoli@igalia.com>,
"Paul E. McKenney" <paulmck@kernel.org>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] printk: ringbuffer: Fix truncating buffer size min_t cast
Date: Mon, 14 Aug 2023 13:40:57 +0200 [thread overview]
Message-ID: <ZNoSyX0YtorbLy7V@alley> (raw)
In-Reply-To: <20230811054528.never.165-kees@kernel.org>
On Thu 2023-08-10 22:45:32, Kees Cook wrote:
> If an output buffer size exceeded U16_MAX, the min_t(u16, ...) cast in
> copy_data() was causing writes to truncate. This manifested as output
> bytes being skipped, seen as %NUL bytes in pstore dumps when the available
> record size was larger than 65536. Fix the cast to no longer truncate
> the calculation.
>
> Cc: Petr Mladek <pmladek@suse.com>
> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: John Ogness <john.ogness@linutronix.de>
> Reported-by: Vijay Balakrishna <vijayb@linux.microsoft.com>
> Closes: https://lore.kernel.org/lkml/d8bb1ec7-a4c5-43a2-9de0-9643a70b899f@linux.microsoft.com/
checkpatch.pl suggested that "Link:" should be used instead of "Closes:".
> Fixes: b6cf8b3f3312 ("printk: add lockless ringbuffer")
> Cc: stable@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Thanks a lot for tracking this down.
The patch has been comitted into printk/linux.git, branch for-6.6.
I though about pushing it for 5.5-rc7. But it is pretty old issue.
It does not break the system. I wanted to give it some spin in
linux-next. And I leave for vacation on Thursday. I will not
have internet connection until Aug 28.
Best Regards,
Petr
prev parent reply other threads:[~2023-08-14 11:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 5:45 [PATCH] printk: ringbuffer: Fix truncating buffer size min_t cast Kees Cook
2023-08-11 6:16 ` Vijay Balakrishna
2023-08-11 13:29 ` Guilherme G. Piccoli
2023-08-11 16:53 ` Tyler Hicks
2023-08-14 6:20 ` John Ogness
2023-08-14 7:40 ` Sergey Senozhatsky
2023-08-14 10:42 ` David Laight
2023-08-14 12:56 ` Petr Mladek
2023-08-14 13:33 ` David Laight
2023-08-14 11:40 ` 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=ZNoSyX0YtorbLy7V@alley \
--to=pmladek@suse.com \
--cc=gpiccoli@igalia.com \
--cc=john.ogness@linutronix.de \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=stable@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=vijayb@linux.microsoft.com \
/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