Re: Data corruption when using dm-crypt over RAID5

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

 



<posted & mailed>

Christophe Saout wrote:

Hi Christophe:

I'm wondering about trying out your patch with dm-crypt on 2.6.12. The code
in drivers/md/dm-crypt.c`crypt_endio() appears to be the same.

Is there a reson that this isn't necessary or would be a bad idea.
Looks like the existing code isn't checking the BIO_UPTODATE flag
before doing the bio_put(). Looks the the second part of not calling
kcryptd_queue_io(io) and forwarding the processing to the cryptd is
effectively the same. The 1st change will set error if BIO_UPTODATE
isn't set and that will cause the 2nd change to skip calling 
kcryptd_queue_io().

I'm not sure about the change in the arg to bio_data_dir() 
changing from bio to io->bio. Perhaps they are equivalent;
care to comment on that.

-piet

> Hello,
> 
> *sigh*
> 
> I found the problem. It's rather stupid. Cancelled readaheads were
> getting through as successfully completed. BIO_UPTODATE wasn't set, but
> no error was reported either. I gradually removed every feature from
> dm-crypt until I was basically down to dm-linear, but with my own endio
> handling. dm.c was already correctly catching this one, dm-crypt didn't.
> Also noticed a stupid use-after-free case.
> 
> Both bugs are, by the way, fixed in 2.6.19 by the guy that rewrote the
> functions in order to handle the dm/md-stacking-stack-reduction stuff.
> 
> So, the following patch is for the < 2.6.19 stable trees.



---------------------------------------------------------------------
dm-crypt mailing list - http://www.saout.de/misc/dm-crypt/
To unsubscribe, e-mail: dm-crypt-unsubscribe@xxxxxxxx
For additional commands, e-mail: dm-crypt-help@xxxxxxxx


[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux