<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/md/dm-integrity.c, branch linux-5.14.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.14.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.14.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-05-13T18:53:49Z</updated>
<entry>
<title>dm integrity: fix sparse warnings</title>
<updated>2021-05-13T18:53:49Z</updated>
<author>
<name>Mikulas Patocka</name>
</author>
<published>2021-05-11T15:41:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bc8f3d4647a99468d7733039b6bc9234b6e91df4'/>
<id>urn:sha1:bc8f3d4647a99468d7733039b6bc9234b6e91df4</id>
<content type='text'>
Use the types __le* instead of __u* to fix sparse warnings.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm integrity: revert to not using discard filler when recalulating</title>
<updated>2021-05-13T18:53:48Z</updated>
<author>
<name>Mikulas Patocka</name>
</author>
<published>2021-05-12T12:28:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dbae70d452a0858d62915166d93650c98fe6639c'/>
<id>urn:sha1:dbae70d452a0858d62915166d93650c98fe6639c</id>
<content type='text'>
Revert the commit 7a5b96b4784454ba258e83dc7469ddbacd3aaac3 ("dm integrity:
use discard support when recalculating").

There's a bug that when we write some data beyond the current recalculate
boundary, the checksum will be rewritten with the discard filler later.
And the data will no longer have integrity protection. There's no easy
fix for this case.

Also, another problematic case is if dm-integrity is used to detect
bitrot (random device errors, bit flips, etc); dm-integrity should
detect that even for unused sectors. With commit 7a5b96b4784 it can
happen that such change is undetected (because discard filler is not a
valid checksum).

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Acked-by: Milan Broz &lt;gmazyland@gmail.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm integrity: use discard support when recalculating</title>
<updated>2021-04-30T18:02:06Z</updated>
<author>
<name>Mikulas Patocka</name>
</author>
<published>2021-04-28T21:00:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7a5b96b4784454ba258e83dc7469ddbacd3aaac3'/>
<id>urn:sha1:7a5b96b4784454ba258e83dc7469ddbacd3aaac3</id>
<content type='text'>
If we have discard support we don't have to recalculate hash - we can
just fill the metadata with the discard pattern.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm integrity: increase RECALC_SECTORS to improve recalculate speed</title>
<updated>2021-04-30T18:02:05Z</updated>
<author>
<name>Mikulas Patocka</name>
</author>
<published>2021-04-27T15:57:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b1a2b9332050c7ae32a22c2c74bc443e39f37b23'/>
<id>urn:sha1:b1a2b9332050c7ae32a22c2c74bc443e39f37b23</id>
<content type='text'>
Increase RECALC_SECTORS because it improves recalculate speed slightly
(from 390kiB/s to 410kiB/s).

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm integrity: don't re-write metadata if discarding same blocks</title>
<updated>2021-04-30T18:01:39Z</updated>
<author>
<name>Mikulas Patocka</name>
</author>
<published>2021-04-27T15:57:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a9c0fda4c08292399e08db0a4b70bc161cd247b9'/>
<id>urn:sha1:a9c0fda4c08292399e08db0a4b70bc161cd247b9</id>
<content type='text'>
If we discard already discarded blocks we do not need to write discard
pattern to the metadata, because it is already there.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm integrity: fix missing goto in bitmap_flush_interval error handling</title>
<updated>2021-04-19T17:17:10Z</updated>
<author>
<name>Tian Tao</name>
</author>
<published>2021-04-14T01:43:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=17e9e134a8efabbbf689a0904eee92bb5a868172'/>
<id>urn:sha1:17e9e134a8efabbbf689a0904eee92bb5a868172</id>
<content type='text'>
Fixes: 468dfca38b1a ("dm integrity: add a bitmap mode")
Cc: stable@vger.kernel.org
Signed-off-by: Tian Tao &lt;tiantao6@hisilicon.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm integrity: add the "reset_recalculate" feature flag</title>
<updated>2021-03-26T18:53:42Z</updated>
<author>
<name>Mikulas Patocka</name>
</author>
<published>2021-03-23T14:59:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=db7b93e38106e58ac2ea24eaaea7ed760a319120'/>
<id>urn:sha1:db7b93e38106e58ac2ea24eaaea7ed760a319120</id>
<content type='text'>
Add a new flag "reset_recalculate" that will restart recalculating
from the beginning of the device. It can be used if we want to change
the hash function. Example:

dmsetup remove_all
rmmod brd
set -e
modprobe brd rd_size=1048576
dmsetup create in --table '0 2000000 integrity /dev/ram0 0 16 J 2 internal_hash:sha256 recalculate'
sleep 10
dmsetup status
dmsetup remove in
dmsetup create in --table '0 2000000 integrity /dev/ram0 0 16 J 2 internal_hash:sha3-256 reset_recalculate'

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm integrity: introduce the "fix_hmac" argument</title>
<updated>2021-02-03T15:10:05Z</updated>
<author>
<name>Mikulas Patocka</name>
</author>
<published>2021-01-21T15:09:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=09d85f8d8909ec8baa07479ba5777bbca24961f3'/>
<id>urn:sha1:09d85f8d8909ec8baa07479ba5777bbca24961f3</id>
<content type='text'>
The "fix_hmac" argument improves security of internal_hash and
journal_mac:
- the section number is mixed to the mac, so that an attacker can't
  copy sectors from one journal section to another journal section
- the superblock is protected by journal_mac
- a 16-byte salt stored in the superblock is mixed to the mac, so
  that the attacker can't detect that two disks have the same hmac
  key and also to disallow the attacker to move sectors from one
  disk to another

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Reported-by: Daniel Glockner &lt;dg@emlix.com&gt;
Signed-off-by: Lukas Bulwahn &lt;lukas.bulwahn@gmail.com&gt; # ReST fix
Tested-by: Milan Broz &lt;gmazyland@gmail.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm integrity: fix spelling mistake "flusing" -&gt; "flushing"</title>
<updated>2021-02-03T15:10:05Z</updated>
<author>
<name>Colin Ian King</name>
</author>
<published>2021-01-11T09:25:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=23c4ecbc3e6af3e2c5d7ce2134a39b73b81947d0'/>
<id>urn:sha1:23c4ecbc3e6af3e2c5d7ce2134a39b73b81947d0</id>
<content type='text'>
There is a spelling mistake in a dm_integrity_io_error error
message. Fix it.

Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm integrity: conditionally disable "recalculate" feature</title>
<updated>2021-01-21T20:05:21Z</updated>
<author>
<name>Mikulas Patocka</name>
</author>
<published>2021-01-20T18:59:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5c02406428d5219c367c5f53457698c58bc5f917'/>
<id>urn:sha1:5c02406428d5219c367c5f53457698c58bc5f917</id>
<content type='text'>
Otherwise a malicious user could (ab)use the "recalculate" feature
that makes dm-integrity calculate the checksums in the background
while the device is already usable. When the system restarts before all
checksums have been calculated, the calculation continues where it was
interrupted even if the recalculate feature is not requested the next
time the dm device is set up.

Disable recalculating if we use internal_hash or journal_hash with a
key (e.g. HMAC) and we don't have the "legacy_recalculate" flag.

This may break activation of a volume, created by an older kernel,
that is not yet fully recalculated -- if this happens, the user should
add the "legacy_recalculate" flag to constructor parameters.

Cc: stable@vger.kernel.org
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Reported-by: Daniel Glockner &lt;dg@emlix.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
</feed>
