public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>, Edward Adam Davis <eadavis@qq.com>
Subject: [PATCH 0/3] Ioctl buffer name/path validation
Date: Wed, 14 Feb 2024 19:31:54 +0100	[thread overview]
Message-ID: <cover.1707935035.git.dsterba@suse.com> (raw)

This is inspired by a report and fix [1] where device replace buffers
were not properly validated (third patch). The other two are doing
proper validation of vol args path or name so that an unterminated
string is reported as an error rather than relying on later actions like
open that would catch an invalid path.

(I'm OK to replace the third patch in favor of Edward as he spent time
analyzing it but we did not agree on a fix and I did not get a reply
with the suggestion I implemented in the end.)

[1] https://lore.kernel.org/linux-btrfs/tencent_44CA0665C9836EF9EEC80CB9E7E206DF5206@qq.com/

David Sterba (3):
  btrfs: factor out validation of btrfs_ioctl_vol_args::name
  btrfs: factor out validation of btrfs_ioctl_vol_args_v2::name
  btrfs: dev-replace: properly validate device names

 fs/btrfs/dev-replace.c | 24 +++++++++++++++----
 fs/btrfs/fs.h          |  2 ++
 fs/btrfs/ioctl.c       | 54 +++++++++++++++++++++++++++++++++++-------
 fs/btrfs/super.c       |  5 +++-
 4 files changed, 72 insertions(+), 13 deletions(-)

-- 
2.42.1


             reply	other threads:[~2024-02-14 18:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14 18:31 David Sterba [this message]
2024-02-14 18:31 ` [PATCH 1/3] btrfs: factor out validation of btrfs_ioctl_vol_args::name David Sterba
2024-02-14 18:32 ` [PATCH 2/3] btrfs: factor out validation of btrfs_ioctl_vol_args_v2::name David Sterba
2024-02-14 18:32 ` [PATCH 3/3] btrfs: dev-replace: properly validate device names David Sterba
2024-02-14 21:22 ` [PATCH 0/3] Ioctl buffer name/path validation Boris Burkov
2024-02-15 15:13   ` David Sterba

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=cover.1707935035.git.dsterba@suse.com \
    --to=dsterba@suse.com \
    --cc=eadavis@qq.com \
    --cc=linux-btrfs@vger.kernel.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