From: Christian Brauner <brauner@kernel.org>
To: Max Kellermann <max.kellermann@ionos.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH] pipe_fs_i.h: add pipe_buf_init()
Date: Tue, 19 Sep 2023 16:16:07 +0200 [thread overview]
Message-ID: <20230919-deeskalation-hinsehen-3b6765180d71@brauner> (raw)
In-Reply-To: <CAKPOu+_ehctokCKHFZgqs2NksE=Kva80Y5xjA705dNCbtcDxgA@mail.gmail.com>
On Tue, Sep 19, 2023 at 03:55:36PM +0200, Max Kellermann wrote:
> On Tue, Sep 19, 2023 at 3:45 PM Christian Brauner <brauner@kernel.org> wrote:
> > So pipe_buf->private may now contain garbage.
>
> NULL is just as garbage as the other 2^64-1 possible pointer values.
> NULL isn't special here, nobody checks the field for NULL. This field
You're changing how the code currently works which is written in a way
that ensures all fields are initialized to zero. The fact that currently
nothing looks at private is irrelevant.
Following your argument below this might very easily be the cause for
another CVE when something starts looking at this.
Wouldn't it make more sense to have the pipe_buf_init() initialize the
whole thing and for the place where it leaves buf->private untouched you
can just do:
unsigned long private = buf->private
pipe_buf_init(buf, page, 0, 0, &anon_pipe_buf_ops,
PIPE_BUF_FLAG_CAN_MERGE, private)
So just use a compound initializer in pipe_buf_init() just like we do in
copy_clone_args_from_user()?
next prev parent reply other threads:[~2023-09-19 14:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-19 8:07 Max Kellermann
2023-09-19 13:45 ` Christian Brauner
2023-09-19 13:55 ` Max Kellermann
2023-09-19 14:16 ` Christian Brauner [this message]
2023-09-19 22:39 ` Max Kellermann
2023-09-19 21:40 ` Randy Dunlap
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=20230919-deeskalation-hinsehen-3b6765180d71@brauner \
--to=brauner@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=max.kellermann@ionos.com \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.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