]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dm crypt: use bio_add_page
authorMilan Broz <mbroz@redhat.com>
Thu, 13 Dec 2007 14:44:18 +0000 (14:44 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 8 Feb 2008 20:01:09 +0000 (12:01 -0800)
commitb8d5ff3a2fc7f7d212a3edcf1d169e5be77ccaf4
tree0051e9bf2386fd93883812c728039964915d67b0
parent7a22cdb2f5ca86983f433d26a3aa9449c0671a2d
dm crypt: use bio_add_page

patch 91e106259214b40e992a58fb9417da46868e19b2 in mainline.

Fix possible max_phys_segments violation in cloned dm-crypt bio.

In write operation dm-crypt needs to allocate new bio request
and run crypto operation on this clone. Cloned request has always
the same size, but number of physical segments can be increased
and violate max_phys_segments restriction.

This can lead to data corruption and serious hardware malfunction.
This was observed when using XFS over dm-crypt and at least
two HBA controller drivers (arcmsr, cciss) recently.

Fix it by using bio_add_page() call (which tests for other
restrictions too) instead of constructing own biovec.

All versions of dm-crypt are affected by this bug.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/dm-crypt.c