tech-userlevel archive

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

disklabel(8) allows addressing non-existent space


I just played a bit around with disklabel(8), trying to copy checks for
batch-mode, but then I found out: There are virtually no checks checking the
disklabel for consistency.

I wonder: Are you aware of that, do you want this happening?
Mainly, there were two things I wondered about (examples are intuitive):
 * you can edit the number of sectors to make the disklabel extend the
   disk it is on, resulting in I/O errors when you try to address that
 * you can edit partitions that extend the space that is in use by the slice
   the disklabel is placed in, thus you could easily create partitions
   overwriting other mbr partitions than the one you're in.
 * you can create overlapping partitions if you set their fs type to unused.

Of course you could say that a conscious administrator would see that, and he
has to use a calculator for editing partitions anyway, but I still consider
it strange. I cannot imagine a use case for creating invalid disklabels.

Plus, one thing I wondered about: Is there a clean way to determine the
"mother" partition (i.e. c or d)? disklabel(8) simply checks for fs type
unused, but that collides with the third thing I pointed out.

Regards, Julian

Attachment: signature.asc
Description: PGP signature

Home | Main Index | Thread Index | Old Index