Linus Torvalds writes: (Summary) It's meant for things like
CD-ROM devices, or for a floppy device when you notice that the
controller reports that the floppy itself is physically
write-protected.
write-protected.
THAT is what the new code checks for, and that is also why ignoring the check really shouldn't be a security issue.
the check really shouldn't be a security issue.
Because if it turns out that somebody wrote to it, and the write succeeded, then obviously the "set_disk_ro()" usage was simply wrong. If only exactly to emulate the "this is like a write-protected floppy or a cd-rom" behavior.
behavior.
So the DM_READONLY_FLAG makes conceptual sense.
So the DM_READONLY_FLAG makes conceptual sense.
But at the same time, if the DM_READONLY_FLAG was _wrong_, then it also makes a ton of sense to just say "oh, it was wrong, we'll ignore it".
it".
Exactly because it was never supposed to be about security, and it was about other things.
about other things.
See?
See?
write-protected.
THAT is what the new code checks for, and that is also why ignoring the check really shouldn't be a security issue.
the check really shouldn't be a security issue.
Because if it turns out that somebody wrote to it, and the write succeeded, then obviously the "set_disk_ro()" usage was simply wrong. If only exactly to emulate the "this is like a write-protected floppy or a cd-rom" behavior.
behavior.
So the DM_READONLY_FLAG makes conceptual sense.
So the DM_READONLY_FLAG makes conceptual sense.
But at the same time, if the DM_READONLY_FLAG was _wrong_, then it also makes a ton of sense to just say "oh, it was wrong, we'll ignore it".
it".
Exactly because it was never supposed to be about security, and it was about other things.
about other things.
See?
See?