<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mtd-utils.git/ubi-utils, 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>ubiattach: fix wording in usage example</title>
<updated>2026-04-13T05:32:41+00:00</updated>
<author>
<name>Mohammad Rahimi</name>
<email>rahimi.mhmmd@gmail.com</email>
</author>
<published>2026-02-12T01:35:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=eccab61f367d24f3fc79652cc89463999b418a8e'/>
<id>urn:sha1:eccab61f367d24f3fc79652cc89463999b418a8e</id>
<content type='text'>
The usage example 4 describing reserved eraseblocks had awkward and
slightly incorrect phrasing ("is total flash chip eraseblocks count").
Reword it for clarity and readability without changing the meaning.

Signed-off-by: Mohammad Rahimi &lt;rahimi.mhmmd@gmail.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>ubi-utils: ubirsvol: resize volume using all available free space</title>
<updated>2025-06-02T05:25:34+00:00</updated>
<author>
<name>Konstantin Menyaev</name>
<email>KAMenyaev@salutedevices.com</email>
</author>
<published>2025-05-24T17:26:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=2ff8105b3bb2d8eff682bbbfdca1a7843c7bd524'/>
<id>urn:sha1:2ff8105b3bb2d8eff682bbbfdca1a7843c7bd524</id>
<content type='text'>
useful in resizing last ubi volume,
some kind of auto-resize ubinize option.

Signed-off-by: Konstantin Menyaev &lt;KAMenyaev@salutedevices.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>ubi-utils: mtdinfo: Fix type truncation compiling warning for 'start' variable</title>
<updated>2025-01-30T17:30:16+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2025-01-26T06:41:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=53a16db8824ee93ab066e57744cb6f7ea5ba053d'/>
<id>urn:sha1:53a16db8824ee93ab066e57744cb6f7ea5ba053d</id>
<content type='text'>
Fix following compiling warning by using the right format:
 ubi-utils/mtdinfo.c:207:21: warning: format ‘%lx’ expects argument of
 type ‘long unsigned int’, but argument 4 has type ‘long long unsigned
 int’

Fixes: 78f4f38bd3de8 ("ubi-utils: Fix integer overflow in mtdinfo.c")
Signed-off-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>ubi-utils: FIX DIVISION BY ZERO in ubinize.c</title>
<updated>2024-12-28T10:37:45+00:00</updated>
<author>
<name>Anton Moryakov</name>
<email>ant.v.moryakov@gmail.com</email>
</author>
<published>2024-12-24T19:40:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=43b7c13c294d3aff771419ab9a924ee9a08725a8'/>
<id>urn:sha1:43b7c13c294d3aff771419ab9a924ee9a08725a8</id>
<content type='text'>
Report of the static analyzer:
Variable vi-&gt;alignment, whose possible value set allows a zero value at ubinize.c:375, is used as a denominator at ubinize.c:410.

If you look at the code more closely, it will be clear that the vi-&gt;alignment parameter is obtained from an external file passed as a command line argument.

A check was also performed if you pass a test.ini file of the following type to the input:

[jffs2-volume]
mode=ubi
image=../jffs2.img
vol_id=1
vol_size=30MiB
vol_type=dynamic
vol_name=jffs2_volume
vol_flags=autoresize
vol_alignment=0

and execute the command:

./ubinize -o ubi.img -p 16KiB -m 512 -s 256 test.ini

we will get the result:

Floating point exception (core dumped)

Corrections explained:
Updated the validation logic for vi-&gt;alignment:
- Replaced the check for negative alignment (`vi-&gt;id &lt; 0`) with a more comprehensive check for non-positive alignment (`vi-&gt;alignment &lt;= 0`).
- Updated the corresponding error message to reflect the requirement for a positive volume alignment.
This ensures more robust validation and improves error clarity when invalid alignment values are encountered.

Triggers found by static analyzer Svace.

Signed-off-by: Anton Moryakov &lt;ant.v.moryakov@gmail.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>ubi-utils: Fix integer overflow in mtdinfo.c</title>
<updated>2024-12-17T13:34:24+00:00</updated>
<author>
<name>Anton Moryakov</name>
<email>ant.v.moryakov@gmail.com</email>
</author>
<published>2024-12-14T12:31:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=78f4f38bd3de8b5c590cbc09ce43812306207d95'/>
<id>urn:sha1:78f4f38bd3de8b5c590cbc09ce43812306207d95</id>
<content type='text'>
Report of the static analyzer:
The value of an arithmetic expression 'reginfo-&gt;offset + i * reginfo-&gt;erasesize' is a subject to overflow
because its operands are not cast to a larger data type before performing arithmetic

Corrections explained:
Added casting i and start to unsigned long long

Triggers found by static analyzer Svace.

Signed-off-by: Anton Moryakov &lt;ant.v.moryakov@gmail.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>ubi-utils: ubirsvol: Fix integer overflow in ubirsvol.c</title>
<updated>2024-12-17T13:34:18+00:00</updated>
<author>
<name>Anton Moryakov</name>
<email>ant.v.moryakov@gmail.com</email>
</author>
<published>2024-12-10T00:07:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=36d1ba9ba75e45da5ff049f4a4bec4ea576a9689'/>
<id>urn:sha1:36d1ba9ba75e45da5ff049f4a4bec4ea576a9689</id>
<content type='text'>
Report of the static analyzer:
The value of an arithmetic expression 'vol_info.leb_size * args.lebs' is a subject to overflow because its operands are not cast to a larger data type before performing arithmetic

Corrections explained:
The fix ensures values ​​are checked before multiplication.
Added casting vol_info.leb_size to long long

Triggers found by static analyzer Svace.

Signed-off-by: Anton Moryakov &lt;ant.v.moryakov@gmail.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>Unify handling of configure switches</title>
<updated>2024-02-19T08:04:00+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-02-28T14:34:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=edc83b61745e6ee7fa9c9502eb520493832b1e9c'/>
<id>urn:sha1:edc83b61745e6ee7fa9c9502eb520493832b1e9c</id>
<content type='text'>
Remove the strict check of the with or enable value and use the
generated variable instead of our own.

Also, don't use WITH_GETRANDOM as an implicit WITH_UBIHEALTHD, split
the two autoconf/automake variables and handle them separately.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>ubiattach: introduce need_resv_pool in UBI_IOCATT</title>
<updated>2023-11-20T06:43:34+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2023-11-13T09:48:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=2425614638a798e55e79e1b1f9b8d84567769311'/>
<id>urn:sha1:2425614638a798e55e79e1b1f9b8d84567769311</id>
<content type='text'>
The ioctl UBI_IOCATT has been extended with need_resv_pool parameter in
[1].

This parameter is used for deciding whether to reserve PEBs for filling
pool/wl_pool for target ubi device. This parameter will be effective
when fastmap is enabled, which will slow down the frequency of updating
fastmap by filling more free PEBs in pool/wl_pool. See details in [2].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ac085cfe57df2cc1d7a5c4c5e64b8780c8ad452f
[2] https://bugzilla.kernel.org/show_bug.cgi?id=217787

Signed-off-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>ubiattach: introduce disable_fm in UBI_IOCATT</title>
<updated>2023-11-20T06:43:30+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2023-11-13T09:48:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=b4b45994a9ba02d575625e3b1076c337be7d4861'/>
<id>urn:sha1:b4b45994a9ba02d575625e3b1076c337be7d4861</id>
<content type='text'>
The ioctl UBI_IOCATT has been extended with disable_fm parameter after
[1].

This parameter is used for disabling fastmap for target ubi device.
If 'disable_fm' is set, ubi doesn't create new fastmap even the module
param 'fm_autoconvert' is set, and existed old fastmap will be destroyed
after attaching process.

A simple test case in [2].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=669d204469c46e91d99da24914130f78277a71d3
[2] https://bugzilla.kernel.org/show_bug.cgi?id=216278

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