public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Ioctl buffer name/path validation
@ 2024-02-14 18:31 David Sterba
  2024-02-14 18:31 ` [PATCH 1/3] btrfs: factor out validation of btrfs_ioctl_vol_args::name David Sterba
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: David Sterba @ 2024-02-14 18:31 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba, Edward Adam Davis

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-15 15:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-14 18:31 [PATCH 0/3] Ioctl buffer name/path validation David Sterba
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox