<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mtd-utils.git, branch master</title>
<subtitle>A mirror of http://git.infradead.org/mtd-utils.git</subtitle>
<id>https://git.infraroot.at/mtd-utils.git/atom?h=master</id>
<link rel='self' href='https://git.infraroot.at/mtd-utils.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/'/>
<updated>2026-08-03T05:42:07+00:00</updated>
<entry>
<title>ubi-utils: add wear-leveling threshold parameter to ubiattach</title>
<updated>2026-08-03T05:42:07+00:00</updated>
<author>
<name>Ran Hongyun</name>
<email>ranhongyun1@huawei.com</email>
</author>
<published>2026-07-23T02:37:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=76641773be73141652c6be5c45f53c91efd144e4'/>
<id>urn:sha1:76641773be73141652c6be5c45f53c91efd144e4</id>
<content type='text'>
Add wl_threshold support end-to-end: expose the kernel's wear-leveling
threshold via a new --wl-threshold / -w option in ubiattach, plumb it
through libubi, and define it by replacing 4 bytes of padding in
struct ubi_attach_req.

Valid range is 2-65536; 0 means use the kernel default.

Signed-off-by: Ran Hongyun &lt;ranhongyun1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>lib: libmtd: fix sign extension of ioctl request in mtd_xlock</title>
<updated>2026-08-03T05:42:05+00:00</updated>
<author>
<name>Bastian Germann</name>
<email>bage@debian.org</email>
</author>
<published>2026-04-27T11:24:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=d1f2d1270c15e373c4e4b5bfbe0a83c7bcf6e793'/>
<id>urn:sha1:d1f2d1270c15e373c4e4b5bfbe0a83c7bcf6e793</id>
<content type='text'>
The req parameter of mtd_xlock() was declared as int.  On 64-bit
big-endian architectures such as ppc64el, _IOW()-derived ioctl numbers
have bit 31 set (because _IOC_WRITE=4 is placed at bit 29).  Storing
such a value in a signed int and then passing it to ioctl(), whose
second argument is unsigned long, causes implicit sign extension:
0x80084d05 becomes 0xffffffff80084d05, which does not match the
expected constant and fails the cmocka check_expected() assertion in
the unit tests for mtd_lock and mtd_unlock.

Fix by declaring req as unsigned long, matching the type used by the
ioctl() syscall interface.

Fixes: test_mtd_lock / test_mtd_unlock failures on ppc64el
Signed-off-by: Bastian Germann &lt;bage@debian.org&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>mtd-utils: don't include features.h</title>
<updated>2026-08-03T05:42:02+00:00</updated>
<author>
<name>Rosen Penev</name>
<email>rosenp@gmail.com</email>
</author>
<published>2026-04-21T01:14:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=73b8c2e23412c9dc306ac251c6bf9ab6b8aaffeb'/>
<id>urn:sha1:73b8c2e23412c9dc306ac251c6bf9ab6b8aaffeb</id>
<content type='text'>
This is an internal header that's already included with others.

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Release mtd-utils-2.3.1</title>
<updated>2026-04-13T07:07:48+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2026-04-13T07:07:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=053ee1038e5dedae61a88cadfb7bdfe9894d8bb6'/>
<id>urn:sha1:053ee1038e5dedae61a88cadfb7bdfe9894d8bb6</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Update CHANGELOG.md</title>
<updated>2026-04-13T07:04:38+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2025-11-28T20:50:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=a51d2bc50bbfcb93b91eb2d2d60f6402f732c9d2'/>
<id>urn:sha1:a51d2bc50bbfcb93b91eb2d2d60f6402f732c9d2</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>mtd-utils: tests: jittertest: reject overlong file names</title>
<updated>2026-04-13T06:42:56+00:00</updated>
<author>
<name>Aviv Daum</name>
<email>aviv.daum@gmail.com</email>
</author>
<published>2026-03-18T22:53:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=514063a6d7a628e358894b6a6a6cb089c264fc09'/>
<id>urn:sha1:514063a6d7a628e358894b6a6a6cb089c264fc09</id>
<content type='text'>
plotJittervsFill copies the -f argument into a 250-byte buffer with
strncpy(..., sizeof(LogFile)). A 250-byte file name leaves the buffer
unterminated, and the subsequent fopen() reads past the end of LogFile.

JitterTest uses the same fixed-size file name pattern for -r, while -c
still silently truncates overlong names and -f already rejects them.

Validate jittertest file name arguments before copying them so these
options all reject overlong input instead of truncating it or reading
past the end of fixed-size buffers.

Add a shell regression test that exercises the accepted and rejected
boundary lengths for plotJittervsFill and JitterTest during make check.

Signed-off-by: Aviv Daum &lt;aviv.daum@gmail.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>misc-utils: docfdisk.c: validate partition size to prevent arithmetic overflow</title>
<updated>2026-04-13T06:42:56+00:00</updated>
<author>
<name>Anton Moryakov</name>
<email>ant.v.moryakov@gmail.com</email>
</author>
<published>2025-10-28T10:48:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=5f7dd327a813c83f97f4a6128bb82c021ed870d8'/>
<id>urn:sha1:5f7dd327a813c83f97f4a6128bb82c021ed870d8</id>
<content type='text'>
report of the static analyzer:
Possible integer overflow: right operand is tainted.
An integer overflow may occur due to arithmetic operation (addition)
between variable 'block' and value { [1, 4294967295] } of 'nblocks[i]',
when 'block' is equal to '1'

correct explained:
Added bounds check before incrementing block counter to ensure that
adding nblocks[i] does not exceed totblocks. This prevents potential
integer overflow when user-specified partition sizes are too large,
which could lead to incorrect partition table layout and device corruption.
The validation ensures safe arithmetic by checking block + nblocks[i] &lt;= totblocks
using unsigned comparison.

Signed-off-by: Anton Moryakov &lt;ant.v.moryakov@gmail.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>misc-utils: docfdisk.c: fix potential integer underflow in partition size calculation</title>
<updated>2026-04-13T06:42:56+00:00</updated>
<author>
<name>Anton Moryakov</name>
<email>ant.v.moryakov@gmail.com</email>
</author>
<published>2025-10-27T22:50:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=3528028a687820eebe2a94013d6ec3a052b4c20e'/>
<id>urn:sha1:3528028a687820eebe2a94013d6ec3a052b4c20e</id>
<content type='text'>
report of the static analyzer:
Possible integer underflow: right operand is tainted.
An integer underflow may occur due to arithmetic
operation (unsigned subtraction) between
variables 'totblocks' and 'block', where 'totblocks'
is in range { [0, 4294967295] }, and 'block' is tainted { [0, 4294967295] }

correct explained:
Added validation check before calculating remaining
space for partition. The issue occurred when setting
the last partition size to 0, which triggers calculation
'totblocks - block'. Without validation, if block &gt;= totblocks,
this would result in integer underflow due to unsigned
arithmetic, potentially creating a partition with enormous
size and leading to device corruption.

Signed-off-by: Anton Moryakov &lt;ant.v.moryakov@gmail.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>fsck.ubifs: fix platform dependant ino_t and loff_t formatting</title>
<updated>2026-04-13T05:32:41+00:00</updated>
<author>
<name>Yuta Hayama</name>
<email>hayama@lineo.co.jp</email>
</author>
<published>2026-02-13T13:55:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=a505a2cc56acf493607fdf24cbf129393a0873fa'/>
<id>urn:sha1:a505a2cc56acf493607fdf24cbf129393a0873fa</id>
<content type='text'>
On architectures such as armv7-a, ino_t and loff_t are unsigned long long rather than
unsigned long. In such cases, the printf format specifier "%lu" is not
appropriate and causes an incorrect address offset.

  mtd-utils/ubifs-utils/fsck.ubifs/problem.c:224
  		log_out(c, "problem: %s, ino %lu, unreachable dentry %s, type %s%s",
  			problem-&gt;desc, ifp-&gt;file-&gt;inum,
  			c-&gt;encrypted &amp;&amp; !ifp-&gt;file-&gt;ino.is_xattr ? "&lt;encrypted&gt;" : dent_node-&gt;name,
  			ubifs_get_type_name(dent_node-&gt;type),
  			key_type(c, &amp;dent_node-&gt;key) == UBIFS_XENT_KEY ? "(xattr)" : "");

  fsck.ubifs[484] (/dev/ubi0_0,danger mode): problem: Dentry is unreachable, ino 917, unreachable dentry (null), type checksum_typefile

Furthermore, running fsck.ubifs with the --debug=4 option will almost
certainly cause a SEGV at the following point.

  mtd-utils/ubifs-utils/fsck.ubifs/check_files.c:103
  	dbg_fsck("construct file(%lu) for %s node, TNC location %d:%d, in %s",
  		 inum, ubifs_get_key_name(key_type(c, key)), sn-&gt;lnum, sn-&gt;offs,
  		 c-&gt;dev_name);

To ensure functionality regardless of environment, cast ino_t to unsigned
long, since it will never be more than 4 bytes.

For loff_t, use %lld and cast accordingly.

Signed-off-by: Yuta Hayama &lt;hayama@lineo.co.jp&gt;
Signed-off-by: Tomas Alvarez Vanoli &lt;tomas.alvarez-vanoli@hitachienergy.com&gt;
Reviewed-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>fsck.ubifs: don't use pointers that reference out-of-scope variables</title>
<updated>2026-04-13T05:32:41+00:00</updated>
<author>
<name>Yuta Hayama</name>
<email>hayama@lineo.co.jp</email>
</author>
<published>2025-11-13T08:31:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=a75782ee97eb5940c865fd560d846b9a93ed9122'/>
<id>urn:sha1:a75782ee97eb5940c865fd560d846b9a93ed9122</id>
<content type='text'>
sn is a reference to either an ino_node, dent_node, or data_node. When sn
is actually used in calls to dbg_fsck() or insert_or_update_file(), these
variables must not be out of scope.

Signed-off-by: Yuta Hayama &lt;hayama@lineo.co.jp&gt;
Reviewed-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
</feed>
