<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/fs/jffs2, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/fs/jffs2?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/fs/jffs2?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-09-21T08:38:07Z</updated>
<entry>
<title>mtd: always initialize 'stats' in struct mtd_oob_ops</title>
<updated>2022-09-21T08:38:07Z</updated>
<author>
<name>Michał Kępień</name>
<email>kernel@kempniu.pl</email>
</author>
<published>2022-06-29T12:57:35Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=745df17906029cc683b8b5ac8bcb08f82860baff'/>
<id>urn:sha1:745df17906029cc683b8b5ac8bcb08f82860baff</id>
<content type='text'>
As the 'stats' field in struct mtd_oob_ops is used in conditional
expressions, ensure it is always zero-initialized in all such structures
to prevent random stack garbage from being interpreted as a pointer.

Strictly speaking, this problem currently only needs to be fixed for
struct mtd_oob_ops structures subsequently passed to mtd_read_oob().
However, this commit goes a step further and makes all instances of
struct mtd_oob_ops in the tree zero-initialized, in hope of preventing
future problems, e.g. if struct mtd_req_stats gets extended with write
statistics at some point.

Signed-off-by: Michał Kępień &lt;kernel@kempniu.pl&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-3-kernel@kempniu.pl
</content>
</entry>
<entry>
<title>Merge tag 'for-linus-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs</title>
<updated>2022-06-03T21:42:24Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-06-03T21:42:24Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=744983d8784214c4f184be7448efb216315b48ae'/>
<id>urn:sha1:744983d8784214c4f184be7448efb216315b48ae</id>
<content type='text'>
Pull JFFS2, UBI and UBIFS updates from Richard Weinberger:
 "JFFS2:
   - Fixes for a memory leak

  UBI:
   - Fixes for fastmap (UAF, high CPU usage)

  UBIFS:
   - Minor cleanups"

* tag 'for-linus-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
  ubi: ubi_create_volume: Fix use-after-free when volume creation failed
  ubi: fastmap: Check wl_pool for free peb before wear leveling
  ubi: fastmap: Fix high cpu usage of ubi_bgt by making sure wl_pool not empty
  ubifs: Use NULL instead of using plain integer as pointer
  ubifs: Simplify the return expression of run_gc()
  jffs2: fix memory leak in jffs2_do_fill_super
  jffs2: Use kzalloc instead of kmalloc/memset
</content>
</entry>
<entry>
<title>jffs2: fix memory leak in jffs2_do_fill_super</title>
<updated>2022-05-27T14:17:11Z</updated>
<author>
<name>Baokun Li</name>
<email>libaokun1@huawei.com</email>
</author>
<published>2022-04-12T09:38:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c14adb1cf70a984ed081c67e9d27bc3caad9537c'/>
<id>urn:sha1:c14adb1cf70a984ed081c67e9d27bc3caad9537c</id>
<content type='text'>
If jffs2_iget() or d_make_root() in jffs2_do_fill_super() returns
an error, we can observe the following kmemleak report:

--------------------------------------------
unreferenced object 0xffff888105a65340 (size 64):
  comm "mount", pid 710, jiffies 4302851558 (age 58.239s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff859c45e5&gt;] kmem_cache_alloc_trace+0x475/0x8a0
    [&lt;ffffffff86160146&gt;] jffs2_sum_init+0x96/0x1a0
    [&lt;ffffffff86140e25&gt;] jffs2_do_mount_fs+0x745/0x2120
    [&lt;ffffffff86149fec&gt;] jffs2_do_fill_super+0x35c/0x810
    [&lt;ffffffff8614aae9&gt;] jffs2_fill_super+0x2b9/0x3b0
    [...]
unreferenced object 0xffff8881bd7f0000 (size 65536):
  comm "mount", pid 710, jiffies 4302851558 (age 58.239s)
  hex dump (first 32 bytes):
    bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb  ................
    bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb  ................
  backtrace:
    [&lt;ffffffff858579ba&gt;] kmalloc_order+0xda/0x110
    [&lt;ffffffff85857a11&gt;] kmalloc_order_trace+0x21/0x130
    [&lt;ffffffff859c2ed1&gt;] __kmalloc+0x711/0x8a0
    [&lt;ffffffff86160189&gt;] jffs2_sum_init+0xd9/0x1a0
    [&lt;ffffffff86140e25&gt;] jffs2_do_mount_fs+0x745/0x2120
    [&lt;ffffffff86149fec&gt;] jffs2_do_fill_super+0x35c/0x810
    [&lt;ffffffff8614aae9&gt;] jffs2_fill_super+0x2b9/0x3b0
    [...]
--------------------------------------------

This is because the resources allocated in jffs2_sum_init() are not
released. Call jffs2_sum_exit() to release these resources to solve
the problem.

Fixes: e631ddba5887 ("[JFFS2] Add erase block summary support (mount time improvement)")
Signed-off-by: Baokun Li &lt;libaokun1@huawei.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>jffs2: Use kzalloc instead of kmalloc/memset</title>
<updated>2022-05-27T14:12:55Z</updated>
<author>
<name>Haowen Bai</name>
<email>baihaowen@meizu.com</email>
</author>
<published>2022-04-18T10:18:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=22abf318c35bcf642625e4eff56cfec1df361f3b'/>
<id>urn:sha1:22abf318c35bcf642625e4eff56cfec1df361f3b</id>
<content type='text'>
Use kzalloc rather than duplicating its implementation, which
makes code simple and easy to understand.

Signed-off-by: Haowen Bai &lt;baihaowen@meizu.com&gt;
[rw: Fixed printk string]
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>fs: Change the type of filler_t</title>
<updated>2022-05-09T20:36:48Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2022-05-02T01:39:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e9b5b23e957ef9260fec811d8d8081125889308a'/>
<id>urn:sha1:e9b5b23e957ef9260fec811d8d8081125889308a</id>
<content type='text'>
By making filler_t the same as read_folio, we can use the same function
for both in gfs2.  We can push the use of folios down one more level
in jffs2 and nfs.  We also increase type safety for future users of the
various read_cache_page() family of functions by forcing the parameter
to be a pointer to struct file (or NULL).

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
<entry>
<title>jffs2: Pass the file pointer to jffs2_do_readpage_unlock()</title>
<updated>2022-05-09T20:28:41Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2022-05-01T23:39:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2294f9b8793d02b265423207e55ce5b26d8960cd'/>
<id>urn:sha1:2294f9b8793d02b265423207e55ce5b26d8960cd</id>
<content type='text'>
In preparation for unifying the read_cache_page() and read_folio()
implementations, make jffs2_do_readpage_unlock() get the inode
from the page instead of passing it in from read_cache_page().

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>jffs2: Convert jffs2 to read_folio</title>
<updated>2022-05-09T20:21:45Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2022-04-29T15:12:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=75a47803b8e118a2af4f9498acd40d9b4d4b0dff'/>
<id>urn:sha1:75a47803b8e118a2af4f9498acd40d9b4d4b0dff</id>
<content type='text'>
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>fs: Remove flags parameter from aops-&gt;write_begin</title>
<updated>2022-05-08T18:28:19Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2022-02-22T19:31:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9d6b0cd7579844761ed68926eb3073bab1dca87b'/>
<id>urn:sha1:9d6b0cd7579844761ed68926eb3073bab1dca87b</id>
<content type='text'>
There are no more aop flags left, so remove the parameter.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>fs: Remove aop flags parameter from grab_cache_page_write_begin()</title>
<updated>2022-05-08T18:28:19Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2022-02-22T16:25:12Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b7446e7cf15f0926866c8e5de90ab278998bf8c8'/>
<id>urn:sha1:b7446e7cf15f0926866c8e5de90ab278998bf8c8</id>
<content type='text'>
There are no more aop flags left, so remove the parameter.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>Merge tag 'for-linus-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs</title>
<updated>2022-03-31T23:09:41Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-03-31T23:09:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a87a08e3bf2decaed29c4dfde3916676f9b966a8'/>
<id>urn:sha1:a87a08e3bf2decaed29c4dfde3916676f9b966a8</id>
<content type='text'>
Pull JFFS2, UBI and UBIFS updates from Richard Weinberger:
 "JFFS2:
   - Fixes for various memory issues

  UBI:
   - Fix for a race condition in cdev ioctl handler

  UBIFS:
   - Fixes for O_TMPFILE and whiteout handling

   - Fixes for various memory issues"

* tag 'for-linus-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
  ubifs: rename_whiteout: correct old_dir size computing
  jffs2: fix memory leak in jffs2_scan_medium
  jffs2: fix memory leak in jffs2_do_mount_fs
  jffs2: fix use-after-free in jffs2_clear_xattr_subsystem
  fs/jffs2: fix comments mentioning i_mutex
  ubi: fastmap: Return error code if memory allocation fails in add_aeb()
  ubifs: Fix to add refcount once page is set private
  ubifs: Fix read out-of-bounds in ubifs_wbuf_write_nolock()
  ubifs: setflags: Make dirtied_ino_d 8 bytes aligned
  ubifs: Rectify space amount budget for mkdir/tmpfile operations
  ubifs: Fix 'ui-&gt;dirty' race between do_tmpfile() and writeback work
  ubifs: Rename whiteout atomically
  ubifs: Add missing iput if do_tmpfile() failed in rename whiteout
  ubifs: Fix wrong number of inodes locked by ui_mutex in ubifs_inode comment
  ubifs: Fix deadlock in concurrent rename whiteout and inode writeback
  ubifs: rename_whiteout: Fix double free for whiteout_ui-&gt;data
  ubi: Fix race condition between ctrl_cdev_ioctl and ubi_cdev_ioctl
</content>
</entry>
</feed>
