linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: Omar Sandoval <osandov@osandov.com>,
	linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org,
	Al Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@infradead.org>
Cc: Dave Chinner <david@fromorbit.com>, Jann Horn <jannh@google.com>,
	Amir Goldstein <amir73il@gmail.com>,
	Aleksa Sarai <cyphar@cyphar.com>,
	linux-api@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH v7 02/10] fs: add O_ALLOW_ENCODED open flag
Date: Mon, 25 Jan 2021 15:57:10 -0500	[thread overview]
Message-ID: <53d9bf65-7076-c136-b464-f5c35de37790@toxicpanda.com> (raw)
In-Reply-To: <09988d880282a6ef0dd04d1fce7db1dbbd2d335c.1611346706.git.osandov@fb.com>

On 1/22/21 3:46 PM, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
> 
> The upcoming RWF_ENCODED operation introduces some security concerns:
> 
> 1. Compressed writes will pass arbitrary data to decompression
>     algorithms in the kernel.
> 2. Compressed reads can leak truncated/hole punched data.
> 
> Therefore, we need to require privilege for RWF_ENCODED. It's not
> possible to do the permissions checks at the time of the read or write
> because, e.g., io_uring submits IO from a worker thread. So, add an open
> flag which requires CAP_SYS_ADMIN. It can also be set and cleared with
> fcntl(). The flag is not cleared in any way on fork or exec.
> 
> Note that the usual issue that unknown open flags are ignored doesn't
> really matter for O_ALLOW_ENCODED; if the kernel doesn't support
> O_ALLOW_ENCODED, then it doesn't support RWF_ENCODED, either.
> 
> Signed-off-by: Omar Sandoval <osandov@fb.com>

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef

  reply	other threads:[~2021-01-25 20:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 20:46 [PATCH v7 00/10] fs: interface for directly reading/writing compressed data Omar Sandoval
2021-01-22 20:46 ` [PATCH man-pages v7] Document encoded I/O Omar Sandoval
2021-01-22 20:46 ` [PATCH v7 01/10] iov_iter: add copy_struct_from_iter() Omar Sandoval
2021-01-22 20:46 ` [PATCH v7 02/10] fs: add O_ALLOW_ENCODED open flag Omar Sandoval
2021-01-25 20:57   ` Josef Bacik [this message]
2021-01-22 20:46 ` [PATCH v7 03/10] fs: add RWF_ENCODED for reading/writing compressed data Omar Sandoval
2021-01-22 20:46 ` [PATCH v7 04/10] btrfs: fix check_data_csum() error message for direct I/O Omar Sandoval
2021-01-25 20:59   ` Josef Bacik
2021-01-22 20:46 ` [PATCH v7 05/10] btrfs: don't advance offset for compressed bios in btrfs_csum_one_bio() Omar Sandoval
2021-01-22 20:46 ` [PATCH v7 06/10] btrfs: add ram_bytes and offset to btrfs_ordered_extent Omar Sandoval
2021-01-22 20:46 ` [PATCH v7 07/10] btrfs: support different disk extent size for delalloc Omar Sandoval
2021-01-22 20:46 ` [PATCH v7 08/10] btrfs: optionally extend i_size in cow_file_range_inline() Omar Sandoval
2021-01-22 20:46 ` [PATCH v7 09/10] btrfs: implement RWF_ENCODED reads Omar Sandoval
2021-01-22 20:46 ` [PATCH v7 10/10] btrfs: implement RWF_ENCODED writes Omar Sandoval
2021-01-29 16:32 ` [PATCH v7 00/10] fs: interface for directly reading/writing compressed data Josef Bacik
2021-02-03 16:03   ` Omar Sandoval

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=53d9bf65-7076-c136-b464-f5c35de37790@toxicpanda.com \
    --to=josef@toxicpanda.com \
    --cc=amir73il@gmail.com \
    --cc=cyphar@cyphar.com \
    --cc=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=jannh@google.com \
    --cc=kernel-team@fb.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=osandov@osandov.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).