Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/4] btrfs-progs: fix the filename sanitization of btrfs-image
@ 2024-07-08  5:14 Qu Wenruo
  2024-07-08  5:14 ` [PATCH 1/4] btrfs-progs: add warning for -s option " Qu Wenruo
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Qu Wenruo @ 2024-07-08  5:14 UTC (permalink / raw)
  To: linux-btrfs

There are several bugs in btrfs-image filename sanitization:

- Ensured kernel path resolution bug
  Since during path resolution btrfs uses hash to find the child inode,
  with garbage filled DIR_ITEMs, it's definitely unable to properly
  resolve the path.

  A warning is added to the man page by the first patch.

- Only the last item got properly sanitized
  All the remaining INODE_REF/DIR_INDEX/DIR_ITEM are not sanitized at
  all.

  This is fixed by the second patch.

- Sanitized filename contains non-ASCII chars
  This is fixed by the third patch.


Finally a new test case is introduced to verify the filename
sanitization behavior of btrfs-image.

Qu Wenruo (4):
  btrfs-progs: add warning for -s option of btrfs-image
  btrfs-progs: image: fix the bug that filename sanitization not working
  btrfs-progs: fix rand_range()
  btrfs-progs: misc-tests: add a test case for filename sanitization

 Documentation/btrfs-image.rst               | 17 ++++++-----
 common/utils.c                              | 10 +++----
 image/sanitize.c                            |  8 ++++-
 tests/misc-tests/065-image-filename/test.sh | 33 +++++++++++++++++++++
 4 files changed, 55 insertions(+), 13 deletions(-)
 create mode 100755 tests/misc-tests/065-image-filename/test.sh

--
2.45.2


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

end of thread, other threads:[~2024-07-19  0:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-08  5:14 [PATCH 0/4] btrfs-progs: fix the filename sanitization of btrfs-image Qu Wenruo
2024-07-08  5:14 ` [PATCH 1/4] btrfs-progs: add warning for -s option " Qu Wenruo
2024-07-08  5:14 ` [PATCH 2/4] btrfs-progs: image: fix the bug that filename sanitization not working Qu Wenruo
2024-07-08  5:14 ` [PATCH 3/4] btrfs-progs: fix rand_range() Qu Wenruo
2024-07-08  5:14 ` [PATCH 4/4] btrfs-progs: misc-tests: add a test case for filename sanitization Qu Wenruo
2024-07-14 22:09 ` [PATCH 0/4] btrfs-progs: fix the filename sanitization of btrfs-image Qu Wenruo
2024-07-18 15:47   ` David Sterba
2024-07-18 22:38     ` Qu Wenruo
2024-07-18 22:55       ` David Sterba
2024-07-19  0:46         ` Qu Wenruo

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