Skip to content

Ioctl buffer name/path validation

David Sterba linux-btrfs stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs: factor out validation of btrfs_ioctl_vol_args::namefs/btrfs/fs.h fs/btrfs/ioctl.c fs/btrfs/super.c+35 -60 replies
2/3btrfs: factor out validation of btrfs_ioctl_vol_args_v2::namefs/btrfs/ioctl.c+17 -30 replies
3/3btrfs: dev-replace: properly validate device namesfs/btrfs/dev-replace.c+20 -40 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

Patch[email protected]Boris Burkov
SeriesR-b
1/3
2/3
3/3Reported-and-tested-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] Ioctl buffer name/path validation

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/[email protected]/

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(-)
Signature · 1 line
2.42.1