<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/md/dm-ioctl.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-13T18:03:03Z</updated>
<entry>
<title>dm ioctl: prevent potential spectre v1 gadget</title>
<updated>2022-04-13T18:03:03Z</updated>
<author>
<name>Jordy Zomer</name>
</author>
<published>2022-01-29T14:58:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=44e6cb3ab177faae840bb2c1ebda9a2539876184'/>
<id>urn:sha1:44e6cb3ab177faae840bb2c1ebda9a2539876184</id>
<content type='text'>
[ Upstream commit cd9c88da171a62c4b0f1c70e50c75845969fbc18 ]

It appears like cmd could be a Spectre v1 gadget as it's supplied by a
user and used as an array index. Prevent the contents of kernel memory
from being leaked to userspace via speculative execution by using
array_index_nospec.

Signed-off-by: Jordy Zomer &lt;jordy@pwning.systems&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>dm ima: measure data on device rename</title>
<updated>2021-08-10T17:34:23Z</updated>
<author>
<name>Tushar Sugandhi</name>
</author>
<published>2021-07-13T00:49:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7d1d1df8ce31491edda5effb216450aad8f05c0d'/>
<id>urn:sha1:7d1d1df8ce31491edda5effb216450aad8f05c0d</id>
<content type='text'>
A given block device is identified by it's name and UUID.  However, both
these parameters can be renamed.  For an external attestation service to
correctly attest a given device, it needs to keep track of these rename
events.

Update the device data with the new values for IMA measurements.  Measure
both old and new device name/UUID parameters in the same IMA measurement
event, so that the old and the new values can be connected later.

Signed-off-by: Tushar Sugandhi &lt;tusharsu@linux.microsoft.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm ima: measure data on table clear</title>
<updated>2021-08-10T17:34:23Z</updated>
<author>
<name>Tushar Sugandhi</name>
</author>
<published>2021-07-13T00:49:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=99169b93838aa4b45dfed7163bd3302f1b375238'/>
<id>urn:sha1:99169b93838aa4b45dfed7163bd3302f1b375238</id>
<content type='text'>
For a given block device, an inactive table slot contains the parameters
to configure the device with.  The inactive table can be cleared
multiple times, accidentally or maliciously, which may impact the
functionality of the device, and compromise the system.  Therefore it is
important to measure and log the event when a table is cleared.

Measure device parameters, and table hashes when the inactive table slot
is cleared.

Signed-off-by: Tushar Sugandhi &lt;tusharsu@linux.microsoft.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm ima: measure data on device remove</title>
<updated>2021-08-10T17:34:22Z</updated>
<author>
<name>Tushar Sugandhi</name>
</author>
<published>2021-07-13T00:49:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=84010e519f95c863728e4b1d73cf93cda41ac00e'/>
<id>urn:sha1:84010e519f95c863728e4b1d73cf93cda41ac00e</id>
<content type='text'>
Presence of an active block-device, configured with expected parameters,
is important for an external attestation service to determine if a system
meets the attestation requirements.  Therefore it is important for DM to
measure the device remove events.

Measure device parameters and table hashes when the device is removed,
using either remove or remove_all.

Signed-off-by: Tushar Sugandhi &lt;tusharsu@linux.microsoft.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm ima: measure data on device resume</title>
<updated>2021-08-10T17:34:22Z</updated>
<author>
<name>Tushar Sugandhi</name>
</author>
<published>2021-07-13T00:48:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8eb6fab402e23ae5de216c327fcd0dd6b54e135d'/>
<id>urn:sha1:8eb6fab402e23ae5de216c327fcd0dd6b54e135d</id>
<content type='text'>
A given block device can load a table multiple times, with different
input parameters, before eventually resuming it.  Further, a device may
be suspended and then resumed.  The device may never resume after a
table-load.  Because of the above valid scenarios for a given device,
it is important to measure and log the device resume event using IMA.

Also, if the table is large, measuring it in clear-text each time the
device changes state, will unnecessarily increase the size of IMA log.
Since the table clear-text is already measured during table-load event,
measuring the hash during resume should be sufficient to validate the
table contents.

Measure the device parameters, and hash of the active table, when the
device is resumed.

Signed-off-by: Tushar Sugandhi &lt;tusharsu@linux.microsoft.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm ima: measure data on table load</title>
<updated>2021-08-10T17:32:40Z</updated>
<author>
<name>Tushar Sugandhi</name>
</author>
<published>2021-07-13T00:48:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=91ccbbac1747eea155632a1c6bb100052309b215'/>
<id>urn:sha1:91ccbbac1747eea155632a1c6bb100052309b215</id>
<content type='text'>
DM configures a block device with various target specific attributes
passed to it as a table.  DM loads the table, and calls each target’s
respective constructors with the attributes as input parameters.
Some of these attributes are critical to ensure the device meets
certain security bar.  Thus, IMA should measure these attributes, to
ensure they are not tampered with, during the lifetime of the device.
So that the external services can have high confidence in the
configuration of the block-devices on a given system.

Some devices may have large tables.  And a given device may change its
state (table-load, suspend, resume, rename, remove, table-clear etc.)
many times.  Measuring these attributes each time when the device
changes its state will significantly increase the size of the IMA logs.
Further, once configured, these attributes are not expected to change
unless a new table is loaded, or a device is removed and recreated.
Therefore the clear-text of the attributes should only be measured
during table load, and the hash of the active/inactive table should be
measured for the remaining device state changes.

Export IMA function ima_measure_critical_data() to allow measurement
of DM device parameters, as well as target specific attributes, during
table load.  Compute the hash of the inactive table and store it for
measurements during future state change.  If a load is called multiple
times, update the inactive table hash with the hash of the latest
populated table.  So that the correct inactive table hash is measured
when the device transitions to different states like resume, remove,
rename, etc.

Signed-off-by: Tushar Sugandhi &lt;tusharsu@linux.microsoft.com&gt;
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt; # leak fix
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm: move setting md-&gt;type into dm_setup_md_queue</title>
<updated>2021-08-09T17:50:43Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2021-08-04T09:41:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ba30585936b0b88f0fb2b19be279b346a6cc87eb'/>
<id>urn:sha1:ba30585936b0b88f0fb2b19be279b346a6cc87eb</id>
<content type='text'>
Move setting md-&gt;type from both callers into dm_setup_md_queue.
This ensures that md-&gt;type is only set to a valid value after the queue
has been fully setup, something we'll rely on future changes.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Link: https://lore.kernel.org/r/20210804094147.459763-7-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>dm ioctl: filter the returned values according to name or uuid prefix</title>
<updated>2021-03-26T18:53:41Z</updated>
<author>
<name>Mikulas Patocka</name>
</author>
<published>2021-03-11T18:27:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c909085bb319c97b7eccbce4dcbd47a32016e0f7'/>
<id>urn:sha1:c909085bb319c97b7eccbce4dcbd47a32016e0f7</id>
<content type='text'>
If we set non-empty param-&gt;name or param-&gt;uuid on the DM_LIST_DEVICES_CMD
ioctl, the set values are considered filter prefixes. The ioctl will only
return entries with matching name or uuid prefix.

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 ioctl: return UUID in DM_LIST_DEVICES_CMD result</title>
<updated>2021-03-26T18:53:41Z</updated>
<author>
<name>Mikulas Patocka</name>
</author>
<published>2021-03-12T14:07:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8b638081bd4520f63db1defc660666ec5f65bc15'/>
<id>urn:sha1:8b638081bd4520f63db1defc660666ec5f65bc15</id>
<content type='text'>
When LVM needs to find a device with a particular UUID it needs to ask for
UUID for each device. This patch returns UUID directly in the list of
devices, so that LVM doesn't have to query all the devices with an ioctl.
The UUID is returned if the flag DM_UUID_FLAG is set in the parameters.

Returning UUID is done in backward-compatible way. There's one unused
32-bit word value after the event number. This patch sets the bit
DM_NAME_LIST_FLAG_HAS_UUID if UUID is present and
DM_NAME_LIST_FLAG_DOESNT_HAVE_UUID if it isn't (if none of these bits is
set, then we have an old kernel that doesn't support returning UUIDs). The
UUID is stored after this word. The 'next' value is updated to point after
the UUID, so that old version of libdevmapper will skip the UUID without
attempting to interpret it.

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 ioctl: replace device hash with red-black tree</title>
<updated>2021-03-26T18:53:41Z</updated>
<author>
<name>Mikulas Patocka</name>
</author>
<published>2021-03-10T10:18:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b82096afc8afdc55408efb54ede2ec55c1f3f8c8'/>
<id>urn:sha1:b82096afc8afdc55408efb54ede2ec55c1f3f8c8</id>
<content type='text'>
For high numbers of DM devices the 64-entry hash table has non-trivial
overhead. Fix this by replacing the hash table with a red-black tree.

Reported-by: Zdenek Kabelac &lt;zkabelac@redhat.com&gt;
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
</feed>
