Re: Modification of block device by R/O mount

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

 



Am 01.08.24 um 08:18 schrieb Johannes Bauer:

But my point is, that is what I am doing -- creating the losetup mapping R/O:

# losetup --read-only --show -f image.img
/dev/loop35

# echo foo >/dev/loop35
bash: echo: write error: Operation not permitted

I.e., the block device is write protected and *yet* it changes content. This is what I find so extremely puzzling, that the file system should not have the capability to change the underlying block device, yet it does.

To expand on this, it also happens when I create a dmsetup linear mapping that has been explicitly marked as read-only:

# dmsetup create --concise "linear,,2,ro,0 131072 linear /dev/loop28 0"

# md5sum image.img /dev/loop28 /dev/mapper/linear
56f56801923108d241947024926fea53  image.img
56f56801923108d241947024926fea53  /dev/loop28
56f56801923108d241947024926fea53  /dev/mapper/linear

# mount -o ro /dev/mapper/linear mnt

# md5sum image.img /dev/loop28 /dev/mapper/linear
56f56801923108d241947024926fea53  image.img
56f56801923108d241947024926fea53  /dev/loop28
d804867eab0106f9659c02a6add2f5da  /dev/mapper/linear

It is my understanding that while mounting (even -o ro) might modify the block device, a R/O block device should never be modifiable my anything. This does not seem to be the case?

Best regards,
Johannes

--
"A PC without Windows is like a chocolate cake without mustard."





[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux