lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1cd11635-4015-43e6-8c8c-db5e2f029536@spornkuller.de>
Date: Thu, 1 Aug 2024 08:32:18 +0200
From: Johannes Bauer <canjzymsaxyt@...rnkuller.de>
To: Dave Chinner <david@...morbit.com>
Cc: linux-ext4@...r.kernel.org
Subject: Re: Modification of block device by R/O mount

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."


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ