<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mtd-utils.git/nand-utils, branch v2.3.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.3.1</id>
<link rel='self' href='https://git.infraroot.at/mtd-utils.git/atom?h=v2.3.1'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/'/>
<updated>2025-01-30T17:30:16+00:00</updated>
<entry>
<title>nand-utils: nanddump: Fix unexpected type compiling warning for argument 'dumpfile'</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:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=9d755ba03f6947ed0f77df8a2bcdb1b6585dabf9'/>
<id>urn:sha1:9d755ba03f6947ed0f77df8a2bcdb1b6585dabf9</id>
<content type='text'>
The const pointer argument cannot be passed into libc function 'free()',
otherwise the compiler will complain following message:
 nand-utils/nanddump.c:168:10: warning: passing argument 1 of ‘free’
 discards ‘const’ qualifier from pointer target type

Fixes: c89009463888 ("nanddump: don't leak copied command line arguments")
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>nand-utils: Fix integer overflow in nandflipbits.c</title>
<updated>2024-12-17T13:34:23+00:00</updated>
<author>
<name>Anton Moryakov</name>
<email>ant.v.moryakov@gmail.com</email>
</author>
<published>2024-12-14T12:18:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=d4710ca5b5105d998e042a77cb66a2a5ac7bafb5'/>
<id>urn:sha1:d4710ca5b5105d998e042a77cb66a2a5ac7bafb5</id>
<content type='text'>
Report of the static analyzer:
The value of an arithmetic expression 'bit_to_flip-&gt;block * mtd.eb_size + blkoffs' is a subject to overflow because its operands are not cast to a larger data type before performing arith$

Corrections explained:
Prevent arithmetic overflow in OOB read operation
Resolved an issue where the calculation of the offset in the OOB read operation could overflow due to operands not being cast to a larger data type. Specifically, the multiplication of bi$

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>nand-utils: nanddump: Add support for testing continuous reads</title>
<updated>2024-10-08T06:14:36+00:00</updated>
<author>
<name>Miquel Raynal</name>
<email>miquel.raynal@bootlin.com</email>
</author>
<published>2024-08-26T09:46:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=7bf7d98cc094f4b0c6e535a7231ce310a9c6e23c'/>
<id>urn:sha1:7bf7d98cc094f4b0c6e535a7231ce310a9c6e23c</id>
<content type='text'>
In order to trigger a continuous read, the user needs to request more
than one data page. So far the tool would split the length into page
chunks. This is no longer the case when the -C option is passed (-c is
already used for the canonical output style).

Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>nand-utils: nanddump: Explicitely use the page size when relevant</title>
<updated>2024-10-08T06:14:33+00:00</updated>
<author>
<name>Miquel Raynal</name>
<email>miquel.raynal@bootlin.com</email>
</author>
<published>2024-08-26T09:46:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=bc6f5df46460fe00b953fb81706770b49bd36e77'/>
<id>urn:sha1:bc6f5df46460fe00b953fb81706770b49bd36e77</id>
<content type='text'>
Using bs when skipping the bad sector is abusive as what we want is
using the size of a block and the size of a page. The fact that bs
currently is the size of a page is misleading here, has I intend to make
this amount grow.

Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>nand-utils: nanddump: Use a specific variable for the buffer size</title>
<updated>2024-10-08T06:14:30+00:00</updated>
<author>
<name>Miquel Raynal</name>
<email>miquel.raynal@bootlin.com</email>
</author>
<published>2024-08-26T09:46:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=11c30d73d3927373a114e9ed274f627a124d9ad7'/>
<id>urn:sha1:11c30d73d3927373a114e9ed274f627a124d9ad7</id>
<content type='text'>
The read buffer size happen to be as big as the bs variable, but this is
going to change. When accessing the buffer size, use a specific variable
instead.

Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Fix printf format specifiers for 64 bit integer types</title>
<updated>2023-08-24T08:30:28+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2023-08-24T08:28:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=dfaf6e455621077f78d301f95de2e5dbab0f8512'/>
<id>urn:sha1:dfaf6e455621077f78d301f95de2e5dbab0f8512</id>
<content type='text'>
In nandflipbits, nandtest and ubiscan, uint64_t integers are printed
to stdout using "%llu" as a format specifier, but on platforms like
x86_64, uint64_t is actually typedef'd as `unsigned long` only.

For compatibillity across platforms, simply use the C99 printfs
macros instead.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>mtd-utils: nandtest: handle large nand devices</title>
<updated>2023-08-23T11:09:28+00:00</updated>
<author>
<name>Christian Wendt he/him</name>
<email>cw@brainaid.de</email>
</author>
<published>2023-08-23T11:09:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=4c98b0f7091a37dd79b45b6ee0af96971d454d27'/>
<id>urn:sha1:4c98b0f7091a37dd79b45b6ee0af96971d454d27</id>
<content type='text'>
Running nandtest on devices with sizes of 4Gb or more does not work, as
the size returned in mtd_info_user is reported as 0 for 4Gb devices for
example.

The patch uses sysfs to figure out the size of the nand device (as
recommended in a comment in include/mtd/mtd-abi.h) and changes sizes
and offsets to 64 bit values.

[From: Christian Wendt &lt;cw@brainaid.de&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>nandflipbits: fix corrupted oob</title>
<updated>2022-06-27T05:58:48+00:00</updated>
<author>
<name>Christophe Kerello</name>
<email>christophe.kerello@foss.st.com</email>
</author>
<published>2022-06-16T07:39:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=a315011bd3c237660436e0c796743d61acf4a7b6'/>
<id>urn:sha1:a315011bd3c237660436e0c796743d61acf4a7b6</id>
<content type='text'>
If a bit is flipped in block 1 or higher, the OOB is corrupted with the
OOB of block 0. Mtd_read_oob API has to take into account the block number
to be able to calculate the right offset.

Fixes: 9fc8db29cf62 ("mtd-utils: Add nandflipbits tool")
Signed-off-by: Christophe Kerello &lt;christophe.kerello@foss.st.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>mtd-utils: nanddump: fix writing big images on 32bit machines</title>
<updated>2022-06-08T07:53:51+00:00</updated>
<author>
<name>Sascha Hauer</name>
<email>s.hauer@pengutronix.de</email>
</author>
<published>2022-06-08T07:51:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=f79d2b21614f11ea9f99dc5a3155d23439cec773'/>
<id>urn:sha1:f79d2b21614f11ea9f99dc5a3155d23439cec773</id>
<content type='text'>
When writing a full 4GiB NAND to a file end_addr becomes 0x100000000.
With that writing out the first page to the file doesn't happen
because size_left is calculated to 0x100000000 - 0 = 0x100000000
which is then truncated to 32bit and becomes zero. Fix this by
using an appropriate 64bit type for size_left.

Signed-off-by: Sascha Hauer &lt;s.hauer@pengutronix.de&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>nandwrite: warn about writing 0xff blocks</title>
<updated>2022-03-28T06:49:40+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>rafal@milecki.pl</email>
</author>
<published>2022-03-25T12:00:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=e62ea740c5e4edb37065193c400a3a82d5479c15'/>
<id>urn:sha1:e62ea740c5e4edb37065193c400a3a82d5479c15</id>
<content type='text'>
Such blocks may be incorrectly treated as empty (even though they may
have non-erase OOB). Warn about it so people may start useing
--skip-all-ffs .

Signed-off-by: Rafał Miłecki &lt;rafal@milecki.pl&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
</feed>
