linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] handle attacking device with devid=0
@ 2020-10-29 22:53 Anand Jain
  2020-10-29 22:53 ` [PATCH RESEND v2] btrfs: fix devid 0 without a replace item by failing the mount Anand Jain
  0 siblings, 1 reply; 4+ messages in thread
From: Anand Jain @ 2020-10-29 22:53 UTC (permalink / raw)
  To: linux-btrfs; +Cc: dsterba, Anand Jain

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
-- 
2.25.1


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

end of thread, other threads:[~2020-11-04  0:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-29 22:53 [PATCH 0/1] handle attacking device with devid=0 Anand Jain
2020-10-29 22:53 ` [PATCH RESEND v2] btrfs: fix devid 0 without a replace item by failing the mount Anand Jain
2020-11-03 18:36   ` David Sterba
2020-11-04  0:55     ` Anand Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).