<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mtd-utils.git/ubifs-utils, branch v2.2.1</title>
<subtitle>A mirror of http://git.infradead.org/mtd-utils.git</subtitle>
<id>https://git.infraroot.at/mtd-utils.git/atom?h=v2.2.1</id>
<link rel='self' href='https://git.infraroot.at/mtd-utils.git/atom?h=v2.2.1'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/'/>
<updated>2024-09-25T07:08:41+00:00</updated>
<entry>
<title>mkfs.ubifs: Fix memleak for 'output' in error paths</title>
<updated>2024-09-25T07:08:41+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2024-02-22T12:37:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=6ff8739a6bf5fce30e9d99ee4b35322313300dcb'/>
<id>urn:sha1:6ff8739a6bf5fce30e9d99ee4b35322313300dcb</id>
<content type='text'>
The 'output' is allocated in get_options(), don't forget to free it
in error paths, move 'output' freeing out of close_target(), which
simplifies the logic of close_target().

Fixes: 36ec51948e0ec ("Add mkfs.ubifs")
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>mkfs.ubifs: Fix missed closing out_fd</title>
<updated>2024-09-25T07:08:41+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2024-02-22T12:27:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=8999ef158d26d9e7fe01c3d4989340342f9c69aa'/>
<id>urn:sha1:8999ef158d26d9e7fe01c3d4989340342f9c69aa</id>
<content type='text'>
Closing 'out_fd' is missed in handling paths in open_target(), fix it
by adding closing operations before returning.

Fixes: a48340c335dab ("mkfs.ubifs: use libubi to format UBI volume")
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>mkfs.ubifs: Close libubi in error handling paths</title>
<updated>2024-09-25T07:08:41+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2024-02-22T12:10:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=5d3902383683c997b5cb3f19f07184ed0be6d764'/>
<id>urn:sha1:5d3902383683c997b5cb3f19f07184ed0be6d764</id>
<content type='text'>
The libubi could be opened in get_options(), don't forget to close it
in error handling paths in main(). Also close libubi in error handling
paths in open_ubi(). To implement that, extract libubi_close() into a
new helper function close_ubi().
Besides, invoke crypto_cleanup() in error handling paths in main().

Fixes: a48340c335dab ("mkfs.ubifs: use libubi to format UBI volume")
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>mkfs.ubifs: Fix incorrect dir size calculation in encryption scenario</title>
<updated>2024-09-25T07:08:41+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2024-05-09T12:30:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=21b1a69625263ec08a0272240988ab8f685fba92'/>
<id>urn:sha1:21b1a69625263ec08a0272240988ab8f685fba92</id>
<content type='text'>
The size of directory should be the total length of encrypted entry name,
otherwise it could trigger errors while checking filesystem:
 dbg_check_filesystem [ubifs]: directory inode 89 size is 352, but
 calculated size is 400

Fixes: 4c55918dd747d ("Implement filename encryption")
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>mkfs.ubifs: Fix wrong xattr entry type</title>
<updated>2024-09-25T07:08:41+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2024-05-09T11:41:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=d17b14d953b2ab56c938d6c7829b70b91c736efe'/>
<id>urn:sha1:d17b14d953b2ab56c938d6c7829b70b91c736efe</id>
<content type='text'>
The type of xattr entry should be regular file, otherwise xattr entry
and xattr inode have inconsistent types.

Fixes: 50044efbd6e713 ("mkfs.ubifs: Add extended attribute support")
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>mkfs.ubifs: Initialize 'cipher_name' as NULL</title>
<updated>2024-09-25T07:08:41+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2024-02-04T02:21:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=8ade2c1776dc5e9c37cd1172031a02bfbdd07601'/>
<id>urn:sha1:8ade2c1776dc5e9c37cd1172031a02bfbdd07601</id>
<content type='text'>
Variable 'cipher_name' is defined on stack without initialization, when
an user invokes mkfs with '--key' and without '-C', 'cipher_name' is a
random value, which could cause init_fscrypt_context() failed to find a
valid cipher.
Fix it by initializing 'cipher_name' as NULL when it is declared.

Fixes: cc4c5e295f546 ("mkfs.ubifs: Enable support for building without crypto")
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>mkfs.ubifs: Clear direct_write property when closing target</title>
<updated>2024-09-25T07:08:41+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2024-02-07T01:29:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=1ffb962afe2239ac02e3890df29653d84f07b104'/>
<id>urn:sha1:1ffb962afe2239ac02e3890df29653d84f07b104</id>
<content type='text'>
Direct writing is not allowd on an UBI volume, unless the volume is set
with direct_write property. The open_target sets direct_write property,
don't forget to clear direct_write property for UBI volume when closing
target.

Fixes: a48340c335dab ("mkfs.ubifs: use libubi to format UBI volume")
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>Make it possible to compile mkfs.ubifs without zlib</title>
<updated>2024-02-18T13:22:08+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2024-02-18T13:22:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=2bca2a9dea4c3debc2565b58b3a7f095be2f7b75'/>
<id>urn:sha1:2bca2a9dea4c3debc2565b58b3a7f095be2f7b75</id>
<content type='text'>
This one is a bit trickier than adding WITH_ZLIB ifdefs. Some parts
of the code assume that zlib is always present and have complicated
fallback behavior. Particularly the "favor_lzo" compression method
that uses either zlib or lzo, whichever produces the better result.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Cleanup handling of optional dependencies</title>
<updated>2024-02-15T14:07:17+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-02-28T12:50:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=6fcdc552ffdca93334ffe2d044745c83de0722fa'/>
<id>urn:sha1:6fcdc552ffdca93334ffe2d044745c83de0722fa</id>
<content type='text'>
Don't use super pedantic parsing of the argument and work with the
generated variable instead of assigning it to our own and set it
to "check" if not value is assigned. Then search for a dependency
if the with variable is anything other than "no" and fail if it
was set to "yes".

In addition, the WITHOUT_xxx defines are replaced with WITH_xxx defines.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>mkfs.ubifs: fix xattr scanning for builds with selinux support</title>
<updated>2023-12-19T09:23:59+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>goliath@infraroot.at</email>
</author>
<published>2023-12-15T11:42:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=9471c13faf76ff05f58d636b988bb066ad6d05fa'/>
<id>urn:sha1:9471c13faf76ff05f58d636b988bb066ad6d05fa</id>
<content type='text'>
mkfs.uibfs can add Selinux xattrs from a labeling file using
libselinux to parse it. The commit that added this feature simply
introduced a separate function, inode_add_selinux_xattr, which is
called instead of inode_add_xattr. If no --selinux argument is
specified for mkfs.ubifs, this is a no-op.

The problem is, that this breaks xattr scanning for any build with
Selinux enabled. The Selinux version is always called and it does
not scan for xattrs on the filesystem, or dispatch to the original.

This commit fixes the xattr scanning behavior. We unconditionally call
both functions (they each have no-op implementations if the feature
is missing) and in the regular xattr scanning code, we skip selinux
attributes, if the --selinux option was given.

Fixes: f1feccec5ad8 ("mkfs.ubifs: Implement selinux labelling support")

Reviewed-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;goliath@infraroot.at&gt;
</content>
</entry>
</feed>
