Re: [PATCH] Documentation: Document the kernel flag bdev_allow_write_mounted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 20, 2024 at 03:42:53PM -0300, Guilherme G. Piccoli wrote:
> On 20/08/2024 13:23, Darrick J. Wong wrote:
> > [...]
> >> +	bdev_allow_write_mounted=
> >> +			Format: <bool>
> >> +			Control the ability of directly writing to mounted block
> >> +			devices' page cache, i.e., allow / disallow writes that
> >> +			bypasses the FS. This was implemented as a means to
> >> +			prevent fuzzers to crash the kernel by breaking the
> >> +			filesystem without its awareness, through direct block
> >> +			device writes. Default is Y and can be changed through
> >> +			the Kconfig option CONFIG_BLK_DEV_WRITE_MOUNTED.
> > 
> > Can we mention that this also solves the problem of naïve storage
> > management tools (aka the ones that don't use O_EXCL) writing over a
> > mounted filesystem and trashing it?
> > 
> > --D
> 
> 
> Sure! At least from my side, fine with that.
> How about the following string ?
> 
> + Control the ability of directly writing to mounted block
> + devices' page cache, i.e., allow / disallow writes that
> + bypasses the FS. This was implemented as a means to
> + prevent fuzzers to crash the kernel by breaking the

                "...from crashing the kernel by overwriting
the metadata underneath a mounted filesystem without its awareness."

> + filesystem without its awareness, through direct block
> + device writes. Also prevents issues from direct writes

You can do it with buffered writes to the block device pagecache too.

"This also prevents destructive formatting of mounted filesystems by
naïve storage tooling that don't use O_EXCL."

--D

> + of silly storage tooling (that doesn't use O_EXCL). The
> + default is Y and can be changed through the Kconfig
> + option CONFIG_BLK_DEV_WRITE_MOUNTED.
> 
> 
> But feel free to improve / change it. I'll wait more feedback and
> resubmit with a refined text.
> Cheers,
> 
> 
> Guilherme




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux