<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/md/dm-integrity.c, branch linux-5.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-04-08T12:05:28Z</updated>
<entry>
<title>dm integrity: set journal entry unused when shrinking device</title>
<updated>2022-04-08T12:05:28Z</updated>
<author>
<name>Mikulas Patocka</name>
</author>
<published>2022-03-26T14:24:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4d362a290f4b01a74ed0330f071a8fc1fe27ddd4'/>
<id>urn:sha1:4d362a290f4b01a74ed0330f071a8fc1fe27ddd4</id>
<content type='text'>
commit cc09e8a9dec4f0e8299e80a7a2a8e6f54164a10b upstream.

Commit f6f72f32c22c ("dm integrity: don't replay journal data past the
end of the device") skips journal replay if the target sector points
beyond the end of the device. Unfortunatelly, it doesn't set the
journal entry unused, which resulted in this BUG being triggered:
BUG_ON(!journal_entry_is_unused(je))

Fix this by calling journal_entry_set_unused() for this case.

Fixes: f6f72f32c22c ("dm integrity: don't replay journal data past the end of the device")
Cc: stable@vger.kernel.org # v5.7+
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Tested-by: Milan Broz &lt;gmazyland@gmail.com&gt;
[snitzer: revised header]
Signed-off-by: Mike Snitzer &lt;snitzer@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>dm integrity: fix data corruption due to improper use of bvec_kmap_local</title>
<updated>2021-12-15T19:16:35Z</updated>
<author>
<name>Mike Snitzer</name>
</author>
<published>2021-12-15T17:31:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1cef171abd39102dcc862c6bfbf7f954f4f1f66f'/>
<id>urn:sha1:1cef171abd39102dcc862c6bfbf7f954f4f1f66f</id>
<content type='text'>
Commit 25058d1c725c ("dm integrity: use bvec_kmap_local in
__journal_read_write") didn't account for __journal_read_write() later
adding the biovec's bv_offset. As such using bvec_kmap_local() caused
the start of the biovec to be skipped.

Trivial test that illustrates data corruption:

  # integritysetup format /dev/pmem0
  # integritysetup open /dev/pmem0 integrityroot
  # mkfs.xfs /dev/mapper/integrityroot
  ...
  bad magic number
  bad magic number
  Metadata corruption detected at xfs_sb block 0x0/0x1000
  libxfs_writebufr: write verifer failed on xfs_sb bno 0x0/0x1000
  releasing dirty buffer (bulk) to free list!

Fix this by using kmap_local_page() instead of bvec_kmap_local() in
__journal_read_write().

Fixes: 25058d1c725c ("dm integrity: use bvec_kmap_local in __journal_read_write")
Reported-by: Tony Asleson &lt;tasleson@redhat.com&gt;
Reviewed-by: Heinz Mauelshagen &lt;heinzm@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'for-5.16/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm</title>
<updated>2021-11-09T19:02:04Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2021-11-09T19:02:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c183e1707aba2c707837569b473d1e9fd48110c4'/>
<id>urn:sha1:c183e1707aba2c707837569b473d1e9fd48110c4</id>
<content type='text'>
Pull device mapper updates from Mike Snitzer:

 - Add DM core support for emitting audit events through the audit
   subsystem. Also enhance both the integrity and crypt targets to emit
   events to via dm-audit.

 - Various other simple code improvements and cleanups.

* tag 'for-5.16/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm table: log table creation error code
  dm: make workqueue names device-specific
  dm writecache: Make use of the helper macro kthread_run()
  dm crypt: Make use of the helper macro kthread_run()
  dm verity: use bvec_kmap_local in verity_for_bv_block
  dm log writes: use memcpy_from_bvec in log_writes_map
  dm integrity: use bvec_kmap_local in __journal_read_write
  dm integrity: use bvec_kmap_local in integrity_metadata
  dm: add add_disk() error handling
  dm: Remove redundant flush_workqueue() calls
  dm crypt: log aead integrity violations to audit subsystem
  dm integrity: log audit events for dm-integrity target
  dm: introduce audit event module for device mapper
</content>
</entry>
<entry>
<title>dm integrity: use bvec_kmap_local in __journal_read_write</title>
<updated>2021-11-01T17:28:46Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2021-10-19T13:44:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=25058d1c725c70e52c7750a3fafabb78cadefd9b'/>
<id>urn:sha1:25058d1c725c70e52c7750a3fafabb78cadefd9b</id>
<content type='text'>
Using local kmaps slightly reduces the chances to stray writes, and
the bvec interface cleans up the code a little bit.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm integrity: use bvec_kmap_local in integrity_metadata</title>
<updated>2021-11-01T17:28:45Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2021-10-19T13:44:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c12d205dae09da9623c6a4c35a9b17088a9b9a71'/>
<id>urn:sha1:c12d205dae09da9623c6a4c35a9b17088a9b9a71</id>
<content type='text'>
Using local kmaps slightly reduces the chances to stray writes, and
the bvec interface cleans up the code a little bit.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm integrity: log audit events for dm-integrity target</title>
<updated>2021-10-27T20:54:36Z</updated>
<author>
<name>Michael Weiß</name>
</author>
<published>2021-09-04T09:59:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=82bb85998cc9a3d26f6086c80fae7888db3b3fd9'/>
<id>urn:sha1:82bb85998cc9a3d26f6086c80fae7888db3b3fd9</id>
<content type='text'>
dm-integrity signals integrity violations by returning I/O errors
to user space. To identify integrity violations by a controlling
instance, the kernel audit subsystem can be used to emit audit
events to user space. We use the new dm-audit submodule allowing
to emit audit events on relevant I/O errors.

The construction and destruction of integrity device mappings are
also relevant for auditing a system. Thus, those events are also
logged as audit events.

Signed-off-by: Michael Weiß &lt;michael.weiss@aisec.fraunhofer.de&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm: use bdev_nr_sectors and bdev_nr_bytes instead of open coding them</title>
<updated>2021-10-18T20:43:22Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2021-10-18T10:11:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6dcbb52cddd9e50c8f6625b02a31f6dffc0d1a7b'/>
<id>urn:sha1:6dcbb52cddd9e50c8f6625b02a31f6dffc0d1a7b</id>
<content type='text'>
Use the proper helpers to read the block device size.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Acked-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Link: https://lore.kernel.org/r/20211018101130.1838532-6-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>Merge tag 'for-5.15/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm</title>
<updated>2021-08-31T21:55:09Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2021-08-31T21:55:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=efa916af13206eb15916e102c45c99a13ea78f33'/>
<id>urn:sha1:efa916af13206eb15916e102c45c99a13ea78f33</id>
<content type='text'>
Pull device mapper updates from Mike Snitzer:

 - Add DM infrastructure for IMA-based remote attestion. These changes
   are the basis for deploying DM-based storage in a "cloud" that must
   validate configurations end-users run to maintain trust. These DM
   changes allow supported DM targets' configurations to be measured via
   IMA. But the policy and enforcement (of which configurations are
   valid) is managed by something outside the kernel (e.g. Keylime).

 - Fix DM crypt scalability regression on systems with many cpus due to
   percpu_counter spinlock contention in crypt_page_alloc().

 - Use in_hardirq() instead of deprecated in_irq() in DM crypt.

 - Add event counters to DM writecache to allow users to further assess
   how the writecache is performing.

 - Various code cleanup in DM writecache's main IO mapping function.

* tag 'for-5.15/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm crypt: use in_hardirq() instead of deprecated in_irq()
  dm ima: update dm documentation for ima measurement support
  dm ima: update dm target attributes for ima measurements
  dm ima: add a warning in dm_init if duplicate ima events are not measured
  dm ima: prefix ima event name related to device mapper with dm_
  dm ima: add version info to dm related events in ima log
  dm ima: prefix dm table hashes in ima log with hash algorithm
  dm crypt: Avoid percpu_counter spinlock contention in crypt_page_alloc()
  dm: add documentation for IMA measurement support
  dm: update target status functions to support IMA measurement
  dm ima: measure data on device rename
  dm ima: measure data on table clear
  dm ima: measure data on device remove
  dm ima: measure data on device resume
  dm ima: measure data on table load
  dm writecache: add event counters
  dm writecache: report invalid return from writecache_map helpers
  dm writecache: further writecache_map() cleanup
  dm writecache: factor out writecache_map_remap_origin()
  dm writecache: split up writecache_map() to improve code readability
</content>
</entry>
<entry>
<title>dm ima: update dm target attributes for ima measurements</title>
<updated>2021-08-20T20:07:36Z</updated>
<author>
<name>Tushar Sugandhi</name>
</author>
<published>2021-08-13T21:38:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=33ace4ca125315d7f4f2b022bf6c83dfade8f9d8'/>
<id>urn:sha1:33ace4ca125315d7f4f2b022bf6c83dfade8f9d8</id>
<content type='text'>
Certain DM targets ('integrity', 'multipath', 'verity') need to update the
way their attributes are recorded in the ima log, so that the attestation
servers can interpret the data correctly and decide if the devices
meet the attestation requirements.  For instance, the "mode=%c" attribute
in the 'integrity' target is measured twice, the 'verity' target is
missing the attribute "root_hash_sig_key_desc=%s", and the 'multipath'
target needs to index the attributes properly.

Update 'integrity' target to remove the duplicate measurement of
the attribute "mode=%c".  Add "root_hash_sig_key_desc=%s" attribute
for the 'verity' target.  Index various attributes in 'multipath'
target.  Also, add "nr_priority_groups=%u" attribute to 'multipath'
target to record the number of priority groups.

Signed-off-by: Tushar Sugandhi &lt;tusharsu@linux.microsoft.com&gt;
Suggested-by: Thore Sommer &lt;public@thson.de&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm-integrity: use bvec_virt</title>
<updated>2021-08-16T16:50:32Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2021-08-04T09:56:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=964cacfdd34cd48e3b5b714c3cc33427001e843f'/>
<id>urn:sha1:964cacfdd34cd48e3b5b714c3cc33427001e843f</id>
<content type='text'>
Use bvec_virt instead of open coding it.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Link: https://lore.kernel.org/r/20210804095634.460779-6-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
</feed>
