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

[dm-devel] [PATCH 0/3] Fix SMP races in dm-crypt

I investigated kernel Bug 5948 (Oops when accessing SATA with device mapper on
AMD 64 X2) to help cut down on the number of open bugs.

The problem reported in that bug seems to be caused by memory pressure
when writing - crypt_alloc_buffer can return less than the full number of
pages required. In that case, the bio is split, but we're keeping a pointer
to the first chunk of the request around in first_clone, and copy it. If the
first clone completes I/O while we're cloning it, we oops on garbage in
the bvec.

I was able to reproduce this on 2.6.20 - and the following patches
seem to fix it for me.

	We need to call clone_init early on, before we can conceivably
	ever call bio_put on the clone

	Do no access bios after generic_make_request

	Drop the first_clone business, and always allocate a fresh bio.

Olaf Kirch  |  --- o --- Nous sommes du soleil we love when we play
okir lst de |    / | \   sol.dhoop.naytheet.ah kin.ir.samse.qurax

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