Commit 8b8f803
dm-crypt: track tag_offset in convert_context
dm-crypt uses tag_offset to index the integrity metadata for each crypt
sector. When the initial crypt_convert() returns BLK_STS_DEV_RESOURCE,
dm-crypt will try to continue the crypt/decrypt procedure in a kworker.
However, it resets tag_offset as zero instead of using the tag_offset
related with current sector. It may return unexpected data when using
random IV or return unexpected integrity related error.
Fix the problem by tracking tag_offset in per-IO convert_context.
Therefore, when the crypt/decrypt procedure continues in a kworker, it
could use the next tag_offset saved in convert_context.
Fixes: 8abec36 ("dm crypt: do not wait for backlogged crypto request completion in softirq")
Cc: [email protected]
Signed-off-by: Hou Tao <[email protected]>
Signed-off-by: Mikulas Patocka <[email protected]>1 parent 996c451 commit 8b8f803
1 file changed
+7
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
1256 | 1257 | | |
1257 | 1258 | | |
1258 | 1259 | | |
| 1260 | + | |
1259 | 1261 | | |
1260 | 1262 | | |
1261 | 1263 | | |
| |||
1588 | 1590 | | |
1589 | 1591 | | |
1590 | 1592 | | |
1591 | | - | |
1592 | 1593 | | |
1593 | 1594 | | |
1594 | 1595 | | |
| |||
1611 | 1612 | | |
1612 | 1613 | | |
1613 | 1614 | | |
1614 | | - | |
| 1615 | + | |
1615 | 1616 | | |
1616 | | - | |
| 1617 | + | |
1617 | 1618 | | |
1618 | 1619 | | |
1619 | 1620 | | |
| |||
1633 | 1634 | | |
1634 | 1635 | | |
1635 | 1636 | | |
| 1637 | + | |
1636 | 1638 | | |
1637 | | - | |
1638 | 1639 | | |
1639 | 1640 | | |
1640 | 1641 | | |
| |||
1648 | 1649 | | |
1649 | 1650 | | |
1650 | 1651 | | |
| 1652 | + | |
1651 | 1653 | | |
1652 | | - | |
1653 | 1654 | | |
1654 | 1655 | | |
1655 | 1656 | | |
1656 | 1657 | | |
1657 | 1658 | | |
1658 | 1659 | | |
1659 | 1660 | | |
1660 | | - | |
| 1661 | + | |
1661 | 1662 | | |
1662 | 1663 | | |
1663 | 1664 | | |
| |||
0 commit comments