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: <Pine.LNX.4.58.0809141223300.16805@be10.lrz>
Date:	Sun, 14 Sep 2008 14:36:30 +0200 (CEST)
From:	Bodo Eggert <7eggert@....de>
To:	Herton Ronaldo Krzesinski <herton@...driva.com.br>
cc:	7eggert@....de, Alan Stern <stern@...land.harvard.edu>,
	linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
	bogdano@...driva.com.br,
	"Luiz Fernando N. Capitulino" <lcapitulino@...driva.com.br>,
	Abdel Benamrouche <draconux@...il.com>,
	Damien Lallement <dlallement@...driva.com>,
	"pterjan@...driva.com" <pterjan@...driva.com>,
	Jens Axboe <axboe@...nel.dk>
Subject: Re: Partition check considered as error is breaking mounting in
 2.6.27

On Sat, 13 Sep 2008, Herton Ronaldo Krzesinski wrote:
> On Saturday 13 September 2008 06:24:27 Bodo Eggert wrote:
> > Herton Ronaldo Krzesinski <herton@...driva.com.br> wrote:

> > > +++ b/fs/partitions/check.c
> > > @@ -499,9 +499,9 @@ int rescan_partitions(struct gendisk *disk, struct
> > > block_device *bdev)
> > >  if (!size)
> > >  continue;
> > >  if (from + size > get_capacity(disk)) {
> > > -                     printk(KERN_ERR " %s: p%d exceeds device capacity\n",
> > > +                     printk(KERN_WARNING
> > > +                             " %s: p%d exceeds device capacity"
> >                                 ", trimmed\n",
> > >  disk->disk_name, p);
> > 
> > Add "size = get_capacity(disk) - from" here?
> > (Possibly using a cached value for get_capacity(disk)?)
> 
> Trim was already proposed here before (not accepted):
> http://lkml.org/lkml/2006/10/12/364

Because of - as far as I read - possible special-case-forensic-situations 
and possible meddling-with-the-jumper.

IMO:

a) If you need fancy partition handling, you can do it in userspace.
Copying a few MB to a completely different machine, expecting it to work
correctly while depending on the partition numbering to stay the same is
just stupid, and it won't work if you mount by path, anyway. It won't work 
for extended partitions, too, if they don't start in the copied area, 
because they are a chain of partition tables.

Ordinary users need a correctly-working, non-logspewing ("Access beyond
end of disk") system, including the possibility to correctly create
filesystems or to use md on the disks. Having an IO-error-area at the end
of the partition won't exactly help, but maybe destroy the 
HAL-automounted-using-the-wrong-options* filesystem.

Advanced users like me can set up a system in qemu, transfer it to a 
temporary directory, start the old system into /bin/sh, make some bind 
mounts and start the new system.

I might also copy one disk onto two disks, planning to concatenate the
split partition using dmsetup.

Even more advanced users do forensics. Do they really need us to prevent
partition renumbering, as long as there ia a hex editor to trim the
partitions? Can't they just write a small program to fix these partitions
and run it after dd finished? Or create an intrd doing what they want?
Or wouldn't they be be better of with something like "hda.size=0815"?

(*BTW: Is there any documentation for the pile-of-HAL-DBUS-KDE-and-stuff,
which would allow me to actually configure it, and possibly unmount the
devices without sudo?)


b) If there is a soft-clipped disk, find out the unclipped size (and 
unclip it on finding a large partition, if possible and if the partition 
is not "hidden").

If you need to enter a password, the partial partitions should be
read-only and be switched to read-write after entering the password.
Having a corrupted fs because of entering a wrong password is not a good
start for a day. (Yes, my suggestion to just clip it was not enough.)

If you should ever need to access a partition exceeding the true disk
size, you can always use dmsetup or losetup. And don't write to it until
you've copied all the data you want. And especially dont complain about
resulting corruptions.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ