<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/next/linux-next.git/drivers/md/dm-ioctl.c, branch master</title>
<subtitle>The linux-next integration testing tree</subtitle>
<id>https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/atom?h=master</id>
<link rel='self' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/'/>
<updated>2026-07-16T14:00:51+00:00</updated>
<entry>
<title>dm: lookup_ioctl(): Use designated array initialers</title>
<updated>2026-07-16T14:00:51+00:00</updated>
<author>
<name>David Laight</name>
<email>david.laight.linux@gmail.com</email>
</author>
<published>2026-06-24T14:52:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=cd516571e975b2d2ed4aeac47c87a3064e2b2633'/>
<id>urn:sha1:cd516571e975b2d2ed4aeac47c87a3064e2b2633</id>
<content type='text'>
Use designated initialisers for the _ioctls[] array and delete the
unused field that contained the array index.

Makes the code more robust against the order of the initialers.
Any uninitialised entries would be processed corretly.

Signed-off-by: David Laight &lt;david.laight.linux@gmail.com&gt;
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm: list_devices(): Only process devices once</title>
<updated>2026-07-16T14:00:41+00:00</updated>
<author>
<name>David Laight</name>
<email>david.laight.linux@gmail.com</email>
</author>
<published>2026-06-24T14:52:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=96979634af39a3f176f3c213fdaee274e869057c'/>
<id>urn:sha1:96979634af39a3f176f3c213fdaee274e869057c</id>
<content type='text'>
Instead of doing a prescan to determine the length of buffer required,
checking the supplied buffer is big enough, and then doing a second
scan to fill the output buffer just do a single scan and detect when
the buffer is too short.

For additional safety only call strlen() once and use the
returned length for everything (incuding the copy).
Ensure than all the pad bytes between the entries are zero.

Signed-off-by: David Laight &lt;david.laight.linux@gmail.com&gt;
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm: __list_versions(): Only process targets once</title>
<updated>2026-07-16T14:00:31+00:00</updated>
<author>
<name>David Laight</name>
<email>david.laight.linux@gmail.com</email>
</author>
<published>2026-06-24T14:52:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=78726ba0ffe3aa16848e86c4571ab647ff7b1b4e'/>
<id>urn:sha1:78726ba0ffe3aa16848e86c4571ab647ff7b1b4e</id>
<content type='text'>
Instead of doing a prescan to determine the length of buffer required,
checking the supplied buffer is big enough, and then doing a second
scan to fill the output buffer just do a single scan and detect when
the buffer is too short.

This removes any problems that might occur if a 'target' is added
between the scans.

For additional safety only call strlen(tt-&gt;name) once and use the
returned length for everything (incuding the copy).
Ensure than all the pad bytes between the entries are zero.

Set param-&gt;data_size to the actual size of the data.
It was slightly large because ALIGN_MASK was added in instead of the size
being rounded up.

Signed-off-by: David Laight &lt;david.laight.linux@gmail.com&gt;
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm: drop redundant nonseekable_open() return check</title>
<updated>2026-07-15T13:55:25+00:00</updated>
<author>
<name>bui duc phuc</name>
<email>phucduc.bui@gmail.com</email>
</author>
<published>2026-07-03T02:09:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=0729a9b4ee5a4c30e4c3641bc8fc6d164e8617b4'/>
<id>urn:sha1:0729a9b4ee5a4c30e4c3641bc8fc6d164e8617b4</id>
<content type='text'>
nonseekable_open() never fails, so the error check is unnecessary.
Remove the dead error handling path.

Signed-off-by: Bui Duc Phuc &lt;phucduc.bui@gmail.com&gt;
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm-ioctl: delete a useless condition</title>
<updated>2026-07-13T19:32:48+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2026-07-13T19:25:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=a02d51919b05a5b5b237012b3e6ea738bc533b08'/>
<id>urn:sha1:a02d51919b05a5b5b237012b3e6ea738bc533b08</id>
<content type='text'>
The condition "remaining &lt;= 0" can never be true. The variable remaining
has type size_t, thus it can't be negative. It can't be zero because we
made sure earlier that "remaining &gt; sizeof(struct dm_target_spec)" and
then we added "sizeof(struct dm_target_spec)" to "outptr" (this means
that we subtraceted "sizeof(struct dm_target_spec)" from "remaining").

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4.6
</content>
</entry>
<entry>
<title>dm-ioctl: fix a possible overflow in list_version_get_info</title>
<updated>2026-07-10T12:40:51+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2026-07-09T19:31:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=76c6f845dc0c614304a6e6ee619b552f97cf24b3'/>
<id>urn:sha1:76c6f845dc0c614304a6e6ee619b552f97cf24b3</id>
<content type='text'>
sizeof(tt-&gt;version) is 12 bytes, but the code writes 16 bytes into the
output buffer - info-&gt;vers-&gt;version[0], info-&gt;vers-&gt;version[1],
info-&gt;vers-&gt;version[2] and info-&gt;vers-&gt;next. This can cause buffer
overflow.

Fix this buffer overflow by replacing "sizeof(tt-&gt;version)" with
"sizeof(struct dm_target_versions)".

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4.6
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>dm_early_create: fix freeing used table on dm_resume failure</title>
<updated>2026-07-10T12:40:24+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2026-07-09T19:29:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=366665416f20527ff7cad548a32d1ddf23195740'/>
<id>urn:sha1:366665416f20527ff7cad548a32d1ddf23195740</id>
<content type='text'>
If dm_resume fails, the kernel attempts to free table with
dm_table_destroy, but the table was already instantiated with
dm_swap_table. This commit skips the call to dm_table_destroy in this
case.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4.6
Fixes: 6bbc923dfcf5 ("dm: add support to directly boot to a mapped device")
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>dm-ioctl: report an error if a device has no table</title>
<updated>2026-05-18T12:27:11+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2026-05-11T11:04:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=457e32348d606a77f9b20e25e989734189834c07'/>
<id>urn:sha1:457e32348d606a77f9b20e25e989734189834c07</id>
<content type='text'>
When we send a message to a device that has no table, the return code was
not set. The code would return "2", which is not considered a valid return value.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Cc: stable@vger.kernel.org
Reviewed-by: Benjamin Marzinski &lt;bmarzins@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm-ima: remove new_map from dm_ima_measure_on_device_clear</title>
<updated>2026-05-04T12:53:19+00:00</updated>
<author>
<name>Benjamin Marzinski</name>
<email>bmarzins@redhat.com</email>
</author>
<published>2026-04-29T20:21:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=c90decb190bcae6a20b3aa8575f69eef543930e5'/>
<id>urn:sha1:c90decb190bcae6a20b3aa8575f69eef543930e5</id>
<content type='text'>
Now that two processes can't modify md-&gt;ima in
dm_ima_measure_on_device_clear() at the same time, there's no need to
track if an inactive table was actually removed. We might as well
clean it up unconditionally, on the off chance that a previous
ima measurement failed and left md-&gt;ima.inactive_table behind.

Signed-off-by: Benjamin Marzinski &lt;bmarzins@redhat.com&gt;
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm-ima: Fix UAF errors and measuring incorrect context</title>
<updated>2026-05-04T12:53:09+00:00</updated>
<author>
<name>Benjamin Marzinski</name>
<email>bmarzins@redhat.com</email>
</author>
<published>2026-04-29T20:21:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=5534cac9b56d8f51343718f71737a69d40cb2bb9'/>
<id>urn:sha1:5534cac9b56d8f51343718f71737a69d40cb2bb9</id>
<content type='text'>
the dm-ima code did not keep the dm_ima_measure_on_* functions from
running at the same time. This could lead to various errors. If two
processes were updating the device state, one could update the state
first, but the other could measure the state first, causing the the
current device state to appear incorrect. If a table load happened while
a device was resuming, the IMA measurement could report the wrong table
being active. And if two dm_ima_measure_on_* functions ran at the same
time, one of them could free data that the other was accessing, causing
a crash.

All the core dm functions that call a dm_ima_measure_on_* function
update the device state they want to measure under the _hash_lock,
except for do_resume(). But holding the _hash_lock is not a good way to
synchronize these functions. It's a global mutex, that is needed in many
dm operations, and the dm_ima_measure_* functions can sleep, blocking
any dm operation on any device that needs the _hash_lock.

To serialize and order the IMA measurement functions, the
dm_ima_measurements now has two counters, update_idx and measure_idx.
update_idx is incremented while holding the _hash_lock and saved, along
with the device name and uuid, in a dm_ima_context struct. Once the
_hash_lock is dropped, the dm_ima_measure_* function is called. It waits
until measure_idx matches the saved value of update_idx, ensuring that
the updates and measurements happen in the same order if there are
multiple processes changing the device at the same time. Then it
measures the device, updates measure_idx, and wakes up any other
process waiting to do a measurement. This makes sure that the
measurements are serialized and done in the order that the _hash_lock
was acquired in. But they only block other measurements for the same
device, which are unlikely to happen at the same time.

do_resume() is trickier, because it removes the inactive table while
holding the _hash_lock, but doesn't hold it while updating md-&gt;map. To
make sure it is also ordered, the IMA code grabs the _hash_lock after
md-&gt;map is updated. Then it makes sure that the device isn't being
removed and that another do_resume() hasn't already changed the active
table again, and serializes like the other functions do.

Signed-off-by: Benjamin Marzinski &lt;bmarzins@redhat.com&gt;
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
</content>
</entry>
</feed>
