Skip to content

handle attacking device with devid=0

Anand Jain linux-btrfs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 1 patch 0 repliesNew

Patches in v1 No applies recorded yet

The patch the cover letter announces is not in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] handle attacking device with devid=0

This patch started as a fix to the Warning reported by the sysbot. More details about the warning in the changelog itself. But there is a more fundamental question on how we would want to handle the mount if we find an extra device during the mount.

There are two ways to handle

1. Just free the attacking device and keep them out of the mounted fs, and let the mount be successful. Originally we have been doing something like this. We free the extra devices in __btrfs_free_extra_devids() including the corrupted/attacking devid=0.

2. Fail the mount so that the user has a chance to review.

Both of these approaches which shall fix the warning reported by sysbot those fixes are in the patch 1 and 2. So either 1 or 2 must be integrated. They can be found in the ML.

1.
[patch] btrfs: fix rw_devices count in __btrfs_free_extra_devids
2.
[patch v2] btrfs: fix devid 0 without a replace item by failing the mount (This patch is threaded with this cover-letter).

If we follow the second method for most of the other similar attacks, I think at some point the __btrfs_free_extra_devids() shall be redundant.

Thanks.

Anand Jain (1):
btrfs: fix devid 0 without a replace item by failing the mount

 fs/btrfs/dev-replace.c | 26 ++++++++++++++++++++++++--
 fs/btrfs/volumes.c     | 26 +++++++-------------------
 2 files changed, 31 insertions(+), 21 deletions(-)

base-commit: 00b19effbd917546c9f7bb3adff425c05613675e
prerequisite-patch-id: 0d3416ab45d924135a9095c3d9c68646f7c5e476
prerequisite-patch-id: 51a2e9b4b78bf808279307d03436a33063d42130

Signature · 1 line
2.25.1