[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: announce: linux-int-2.4.3.1-hvr3
hello! :-)
On Tue, 10 Apr 2001, Jari Ruusu wrote:
> Herbert Valerio Riedel wrote:
> > On Mon, 9 Apr 2001, Jari Ruusu wrote:
> > > +static inline unsigned long loop_get_iv(struct loop_device *lo,
> > > + unsigned long sector)
> > > +{
> > > + return sector - (lo->lo_offset >> IV_SECTOR_BITS);
> > > ^^^^^^ LINE 348 - CORRUPTION ?
> > > +}
> > > +
> > sorry, I don't see your point...
> > the return value is supposed to be the sector address minus the offset
> > expressed in sectors...
> So, you anchor the IV beginning to "lo->lo_offset". But, what happens when
> someone losetups a hard drive partition with a different offset than what
> was used before? Unreadable data, that what. I'm not saying that is a normal
> thing to do. If IV beginning is anchored to the beginning of a partition or
> file, data would be readable no matter what offset is used.
mmmh... ok, that's the way it was calculated in the past... it has its
merits... but it has it's faults too...
as a sidenote, you have to use an offset being a multiple of the the
media blocksize, since otherwise your argument isn't valid, due to
unreadable data...
then, if I created some partitions on my harddisk, and losetup those
partitions... then I happen do something, which I would say either, that
it was a normal thing to do ;), and I backed up the whole device,...
say, to a cdrw, or something like that, or just any device where
partitions aren't supported,
then I could just use the starting partition offset as the offset argument
and have completely readable data... as opposed to your case...
so, tell me, which way of interpreting an offset is the 'right' one? :-)
(since this new IV calculation breaks everything, we can take the
opportunity to change the offset semantics too... just in case your
argument was, to stick with the old way of doing things, assuming they
were done right.. :-)
greetings,
--
Herbert Valerio Riedel / Finger hvr@gnu.org for GnuPG Public Key
GnuPG Key Fingerprint: AC2A CD57 A5C8 A1CB 0A18 DA95 CB0B DB23 60B6 16F5
Linux-crypto: cryptography in and on the Linux system
Archive: http://mail.nl.linux.org/linux-crypto/