<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/mtd/ubi/eba.c, branch linux-4.0.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2015-05-06T20:03:52Z</updated>
<entry>
<title>UBI: fix out of bounds write</title>
<updated>2015-05-06T20:03:52Z</updated>
<author>
<name>Brian Norris</name>
</author>
<published>2015-02-28T10:23:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=921b47c10b2b18b3562152aa0eacc1b2e56c6996'/>
<id>urn:sha1:921b47c10b2b18b3562152aa0eacc1b2e56c6996</id>
<content type='text'>
commit d74adbdb9abf0d2506a6c4afa534d894f28b763f upstream.

If aeb-&gt;len &gt;= vol-&gt;reserved_pebs, we should not be writing aeb into the
PEB-&gt;LEB mapping.

Caught by Coverity, CID #711212.

Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>UBI: fix missing brace control flow</title>
<updated>2015-02-23T21:17:24Z</updated>
<author>
<name>Brian Norris</name>
</author>
<published>2015-02-23T21:07:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b388e6a7a6ba988998ddd83919ae8d3debf1a13d'/>
<id>urn:sha1:b388e6a7a6ba988998ddd83919ae8d3debf1a13d</id>
<content type='text'>
commit 0e707ae79ba3 ("UBI: do propagate positive error codes up") seems
to have produced an unintended change in the control flow here.

Completely untested, but it looks obvious.

Caught by Coverity, which didn't like the indentation. CID 1271184.

Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Cc: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>UBI: do propagate positive error codes up</title>
<updated>2015-01-28T15:09:25Z</updated>
<author>
<name>Artem Bityutskiy</name>
</author>
<published>2014-11-25T09:34:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0e707ae79ba357d60b8a36025ec8968e5020d827'/>
<id>urn:sha1:0e707ae79ba357d60b8a36025ec8968e5020d827</id>
<content type='text'>
UBI uses positive function return codes internally, and should not propagate
them up, except in the place this path fixes. Here is the original bug report
from Dan Carpenter:

The problem is really in ubi_eba_read_leb().

drivers/mtd/ubi/eba.c
   412                  err = ubi_io_read_vid_hdr(ubi, pnum, vid_hdr, 1);
   413                  if (err &amp;&amp; err != UBI_IO_BITFLIPS) {
   414                          if (err &gt; 0) {
   415                                  /*
   416                                   * The header is either absent or corrupted.
   417                                   * The former case means there is a bug -
   418                                   * switch to read-only mode just in case.
   419                                   * The latter case means a real corruption - we
   420                                   * may try to recover data. FIXME: but this is
   421                                   * not implemented.
   422                                   */
   423                                  if (err == UBI_IO_BAD_HDR_EBADMSG ||
   424                                      err == UBI_IO_BAD_HDR) {
   425                                          ubi_warn("corrupted VID header at PEB %d, LEB %d:%d",
   426                                                   pnum, vol_id, lnum);
   427                                          err = -EBADMSG;
   428                                  } else
   429                                          ubi_ro_mode(ubi);

On this path we return UBI_IO_FF and UBI_IO_FF_BITFLIPS and it
eventually gets passed to ERR_PTR().  We probably dereference the bad
pointer and oops.  At that point we've gone read only so it was already
a bad situation...

   430                          }
   431                          goto out_free;
   432                  } else if (err == UBI_IO_BITFLIPS)
   433                          scrub = 1;
   434

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>UBI: Add initial support for scatter gather</title>
<updated>2015-01-28T15:04:26Z</updated>
<author>
<name>Richard Weinberger</name>
</author>
<published>2015-01-10T21:52:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9ff08979e17423f0f691c1d76f35dfec72a5e459'/>
<id>urn:sha1:9ff08979e17423f0f691c1d76f35dfec72a5e459</id>
<content type='text'>
Adds a new set of functions to deal with scatter gather.
ubi_eba_read_leb_sg() will read from a LEB into a scatter gather list.
The new data structure struct ubi_sgl will be used within UBI to
hold the scatter gather list itself and metadata to have a cursor
within the list.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Tested-by: Ezequiel Garcia &lt;ezequiel@vanguardiasur.com.ar&gt;
Reviewed-by: Ezequiel Garcia &lt;ezequiel@vanguardiasur.com.ar&gt;
</content>
</entry>
<entry>
<title>UBI: Extend UBI layer debug/messaging capabilities</title>
<updated>2014-11-07T10:08:51Z</updated>
<author>
<name>Tanya Brokhman</name>
</author>
<published>2014-10-20T16:57:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=326087033108e7806e24974f2c8271f95cddaf3a'/>
<id>urn:sha1:326087033108e7806e24974f2c8271f95cddaf3a</id>
<content type='text'>
If there is more then one UBI device mounted, there is no way to
distinguish between messages from different UBI devices.
Add device number to all ubi layer message types.

The R/O block driver messages were replaced by pr_* since
ubi_device structure is not used by it.

Amended a bit by Artem.

Signed-off-by: Tanya Brokhman &lt;tlinder@codeaurora.org&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>UBI: ubi_eba_read_leb: Remove in vain variable assignment</title>
<updated>2014-09-26T10:42:41Z</updated>
<author>
<name>Richard Weinberger</name>
</author>
<published>2014-09-22T08:45:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=170505f58f01d89dea2667d484cb5da18fb9ffd9'/>
<id>urn:sha1:170505f58f01d89dea2667d484cb5da18fb9ffd9</id>
<content type='text'>
There is no need to set err, it will be overwritten in any case
later at:
        if (scrub)
                err = ubi_wl_scrub_peb(ubi, pnum);

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>UBI: Wire-up -&gt;fm_sem</title>
<updated>2012-10-03T09:29:37Z</updated>
<author>
<name>Richard Weinberger</name>
</author>
<published>2012-09-26T15:51:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8974b15c6e84e686201d382c7d459aa9c8c96572'/>
<id>urn:sha1:8974b15c6e84e686201d382c7d459aa9c8c96572</id>
<content type='text'>
Fastmap uses -&gt;fm_sem to stop EBA changes while writing
a new fastmap.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>UBI: Add self_check_eba()</title>
<updated>2012-10-03T09:29:37Z</updated>
<author>
<name>Richard Weinberger</name>
</author>
<published>2012-09-26T15:51:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=00abf3041590da6ad7533bf592e8dd452820109f'/>
<id>urn:sha1:00abf3041590da6ad7533bf592e8dd452820109f</id>
<content type='text'>
self_check_eba() compares two ubi_attach_info objects.
Fastmap uses this function for self checks.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>UBI: Export next_sqnum()</title>
<updated>2012-10-03T09:29:37Z</updated>
<author>
<name>Richard Weinberger</name>
</author>
<published>2012-09-26T15:51:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a7306653705e456c8affeb4efe9542b9f6b757ad'/>
<id>urn:sha1:a7306653705e456c8affeb4efe9542b9f6b757ad</id>
<content type='text'>
Fastmap needs next_sqnum(), rename it to ubi_next_sqnum()
and make it non-static.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>UBI: comply with coding style</title>
<updated>2012-09-04T06:39:01Z</updated>
<author>
<name>Artem Bityutskiy</name>
</author>
<published>2012-08-27T11:43:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=049333cecbde11988c49ad4d7861eefbc3534422'/>
<id>urn:sha1:049333cecbde11988c49ad4d7861eefbc3534422</id>
<content type='text'>
Join all the split printk lines in order to stop checkpatch complaining.

Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
</feed>
