<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/md, branch v7.2-rc3</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>dm thin metadata: fix superblock refcount leak on snapshot shadow failure</title>
<updated>2026-07-11T13:18:51+00:00</updated>
<author>
<name>Genjian Zhang</name>
<email>zhanggenjian@kylinos.cn</email>
</author>
<published>2026-07-11T10:05:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4b22d0801fadfcae2e106e6ba32e49439c7c7ebf'/>
<id>4b22d0801fadfcae2e106e6ba32e49439c7c7ebf</id>
<content type='text'>
__reserve_metadata_snap() increments THIN_SUPERBLOCK_LOCATION in the
metadata space map before shadowing it. When dm_tm_shadow_block()
fails, a reference is leaked in the metadata space map.

Fix by adding the missing dm_sm_dec_block().

Signed-off-by: Genjian Zhang &lt;zhanggenjian@kylinos.cn&gt;
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Fixes: cc8394d86f04 ("dm thin: provide userspace access to pool metadata")
Cc: stable@vger.kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
__reserve_metadata_snap() increments THIN_SUPERBLOCK_LOCATION in the
metadata space map before shadowing it. When dm_tm_shadow_block()
fails, a reference is leaked in the metadata space map.

Fix by adding the missing dm_sm_dec_block().

Signed-off-by: Genjian Zhang &lt;zhanggenjian@kylinos.cn&gt;
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Fixes: cc8394d86f04 ("dm thin: provide userspace access to pool metadata")
Cc: stable@vger.kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>dm-stats: fix dm_jiffies_to_msec64</title>
<updated>2026-07-10T16:40:27+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2026-07-10T16:37:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=386df1a57b631c456d14f857cb0c0c2e11c16bef'/>
<id>386df1a57b631c456d14f857cb0c0c2e11c16bef</id>
<content type='text'>
There were wrong calculations in dm_jiffies_to_msec64 that produced
incorrect output when HZ was different from 1000. This commit fixes them.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4-6
Fixes: fd2ed4d25270 ("dm: add statistics support")
Cc: stable@vger.kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There were wrong calculations in dm_jiffies_to_msec64 that produced
incorrect output when HZ was different from 1000. This commit fixes them.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4-6
Fixes: fd2ed4d25270 ("dm: add statistics support")
Cc: stable@vger.kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>dm-stats: fix merge accounting</title>
<updated>2026-07-10T16:40:00+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2026-07-10T16:35:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1917eb2db750ecbdf710f79a8042eaa545a063c7'/>
<id>1917eb2db750ecbdf710f79a8042eaa545a063c7</id>
<content type='text'>
There were wrong parentheses when setting stats_aux-&gt;merged, so that
merging was never properly accounted. This commit fixes it.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4-6
Fixes: fd2ed4d25270 ("dm: add statistics support")
Cc: stable@vger.kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There were wrong parentheses when setting stats_aux-&gt;merged, so that
merging was never properly accounted. This commit fixes it.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4-6
Fixes: fd2ed4d25270 ("dm: add statistics support")
Cc: stable@vger.kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>dm-bufio: fix wrong count calculation in dm_bufio_issue_discard</title>
<updated>2026-07-10T16:39:17+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2026-07-10T16:32:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=422f1d4f141eaa3a6e4199ceec86cc6b9bf26570'/>
<id>422f1d4f141eaa3a6e4199ceec86cc6b9bf26570</id>
<content type='text'>
block_to_sector converts a block number to a sector number and adds
c-&gt;start to the result. It is inappropriate to use this function for
converting the number of blocks to a number to sectors because c-&gt;start
would be incorrectly added to the result.

Luckily, the only target that uses dm_bufio_issue_discard is dm-ebs,
which sets c-&gt;start to 0, so this bug is latent.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4-6
Fixes: 6fbeb0048e6b ("dm bufio: implement discard")
Cc: stable@vger.kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
block_to_sector converts a block number to a sector number and adds
c-&gt;start to the result. It is inappropriate to use this function for
converting the number of blocks to a number to sectors because c-&gt;start
would be incorrectly added to the result.

Luckily, the only target that uses dm_bufio_issue_discard is dm-ebs,
which sets c-&gt;start to 0, so this bug is latent.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4-6
Fixes: 6fbeb0048e6b ("dm bufio: implement discard")
Cc: stable@vger.kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>dm-verity: make error counter atomic</title>
<updated>2026-07-10T12:42:33+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2026-07-09T19:37:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=8ec4d9c5a5cf4b61fc087f871465b1f79b393325'/>
<id>8ec4d9c5a5cf4b61fc087f871465b1f79b393325</id>
<content type='text'>
The error counter "v-&gt;corrupted_errs" was not atomic, thus it could be
subject to race conditions. The call to
dm_audit_log_target("max-corrupted-errors") may be skipped due to the
races.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4.6
Fixes: 65ff5b7ddf05 ("dm verity: add error handling modes for corrupted blocks")
Cc: stable@vger.kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The error counter "v-&gt;corrupted_errs" was not atomic, thus it could be
subject to race conditions. The call to
dm_audit_log_target("max-corrupted-errors") may be skipped due to the
races.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4.6
Fixes: 65ff5b7ddf05 ("dm verity: add error handling modes for corrupted blocks")
Cc: stable@vger.kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>dm-verity: increase sprintf buffer size</title>
<updated>2026-07-10T12:42:05+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2026-07-09T19:36:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=88dd117c92a142253fb7a17e791773902b3babc6'/>
<id>88dd117c92a142253fb7a17e791773902b3babc6</id>
<content type='text'>
The prefix "DM_VERITY_ERR_BLOCK_NR" is 22 chars. Add '=', one digit for
type, ',', up to 20 digits for a u64 block number, and a NUL terminator:
that's 46 bytes. The buffer is 42 bytes. For block numbers &gt;= 16 decimal
digits (devices larger than ~16 EB with 4K blocks), snprintf silently
truncates the uevent environment variable.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4.6
Fixes: 65ff5b7ddf05 ("dm verity: add error handling modes for corrupted blocks")
Cc: stable@vger.kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The prefix "DM_VERITY_ERR_BLOCK_NR" is 22 chars. Add '=', one digit for
type, ',', up to 20 digits for a u64 block number, and a NUL terminator:
that's 46 bytes. The buffer is 42 bytes. For block numbers &gt;= 16 decimal
digits (devices larger than ~16 EB with 4K blocks), snprintf silently
truncates the uevent environment variable.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4.6
Fixes: 65ff5b7ddf05 ("dm verity: add error handling modes for corrupted blocks")
Cc: stable@vger.kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>dm-verity: fix a possible NULL pointer dereference</title>
<updated>2026-07-10T12:41:43+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2026-07-09T19:35:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e72b793ae440f6900fb17a4b8518c707b5cd3e17'/>
<id>e72b793ae440f6900fb17a4b8518c707b5cd3e17</id>
<content type='text'>
Fix a possible NULL pointer dereference dm_verity_loadpin_is_bdev_trusted
if the device has no table.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4-6
Fixes: b6c1c5745ccc ("dm: Add verity helpers for LoadPin")
Cc: stable@vger.kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a possible NULL pointer dereference dm_verity_loadpin_is_bdev_trusted
if the device has no table.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4-6
Fixes: b6c1c5745ccc ("dm: Add verity helpers for LoadPin")
Cc: stable@vger.kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>dm-verity: avoid double increment of &amp;use_bh_wq_enabled</title>
<updated>2026-07-10T12:41:17+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2026-07-09T19:33:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=72e9ec2fe32b00994f41719cf77423fca67d48b2'/>
<id>72e9ec2fe32b00994f41719cf77423fca67d48b2</id>
<content type='text'>
verity_parse_opt_args is called twice, first with the only_modifier_opts,
first with only_modifier_opts == true and then with only_modifier_opts ==
false. Thus, the static branch &amp;use_bh_wq_enabled was incremented twice
and the destructor verity_dtr would only decrement it once.

Fix tihs bug by only incrementing it on the first call, on the second
call, when v-&gt;use_bh_wq is true, do nothing.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4-6
Cc: stable@vger.kernel.org
Fixes: df326e7a0699 ("dm verity: allow optional args to alter primary args handling")
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
verity_parse_opt_args is called twice, first with the only_modifier_opts,
first with only_modifier_opts == true and then with only_modifier_opts ==
false. Thus, the static branch &amp;use_bh_wq_enabled was incremented twice
and the destructor verity_dtr would only decrement it once.

Fix tihs bug by only incrementing it on the first call, on the second
call, when v-&gt;use_bh_wq is true, do nothing.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Assisted-by: Claude:claude-opus-4-6
Cc: stable@vger.kernel.org
Fixes: df326e7a0699 ("dm verity: allow optional args to alter primary args handling")
</pre>
</div>
</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.tavy.me/linux.git/commit/?id=76c6f845dc0c614304a6e6ee619b552f97cf24b3'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</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.tavy.me/linux.git/commit/?id=366665416f20527ff7cad548a32d1ddf23195740'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
</feed>
