<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/fs/fuse, branch v5.0</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>fuse: decrement NR_WRITEBACK_TEMP on the right page</title>
<updated>2019-01-16T09:27:59+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2019-01-16T09:27:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a2ebba824106dabe79937a9f29a875f837e1b6d4'/>
<id>a2ebba824106dabe79937a9f29a875f837e1b6d4</id>
<content type='text'>
NR_WRITEBACK_TEMP is accounted on the temporary page in the request, not
the page cache page.

Fixes: 8b284dc47291 ("fuse: writepages: handle same page rewrites")
Cc: &lt;stable@vger.kernel.org&gt; # v3.13
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
NR_WRITEBACK_TEMP is accounted on the temporary page in the request, not
the page cache page.

Fixes: 8b284dc47291 ("fuse: writepages: handle same page rewrites")
Cc: &lt;stable@vger.kernel.org&gt; # v3.13
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: call pipe_buf_release() under pipe lock</title>
<updated>2019-01-16T09:27:59+00:00</updated>
<author>
<name>Jann Horn</name>
<email>jannh@google.com</email>
</author>
<published>2019-01-12T01:39:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9509941e9c534920ccc4771ae70bd6cbbe79df1c'/>
<id>9509941e9c534920ccc4771ae70bd6cbbe79df1c</id>
<content type='text'>
Some of the pipe_buf_release() handlers seem to assume that the pipe is
locked - in particular, anon_pipe_buf_release() accesses pipe-&gt;tmp_page
without taking any extra locks. From a glance through the callers of
pipe_buf_release(), it looks like FUSE is the only one that calls
pipe_buf_release() without having the pipe locked.

This bug should only lead to a memory leak, nothing terrible.

Fixes: dd3bb14f44a6 ("fuse: support splice() writing to fuse device")
Cc: stable@vger.kernel.org
Signed-off-by: Jann Horn &lt;jannh@google.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some of the pipe_buf_release() handlers seem to assume that the pipe is
locked - in particular, anon_pipe_buf_release() accesses pipe-&gt;tmp_page
without taking any extra locks. From a glance through the callers of
pipe_buf_release(), it looks like FUSE is the only one that calls
pipe_buf_release() without having the pipe locked.

This bug should only lead to a memory leak, nothing terrible.

Fixes: dd3bb14f44a6 ("fuse: support splice() writing to fuse device")
Cc: stable@vger.kernel.org
Signed-off-by: Jann Horn &lt;jannh@google.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cuse: fix ioctl</title>
<updated>2019-01-16T09:27:59+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2019-01-16T09:27:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8a3177db59cd644fde05ba9efee29392dfdec8aa'/>
<id>8a3177db59cd644fde05ba9efee29392dfdec8aa</id>
<content type='text'>
cuse_process_init_reply() doesn't initialize fc-&gt;max_pages and thus all
cuse bases ioctls fail with ENOMEM.

Reported-by: Andreas Steinmetz &lt;ast@domdv.de&gt;
Fixes: 5da784cce430 ("fuse: add max_pages to init_out")
Cc: &lt;stable@vger.kernel.org&gt; # v4.20
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
cuse_process_init_reply() doesn't initialize fc-&gt;max_pages and thus all
cuse bases ioctls fail with ENOMEM.

Reported-by: Andreas Steinmetz &lt;ast@domdv.de&gt;
Fixes: 5da784cce430 ("fuse: add max_pages to init_out")
Cc: &lt;stable@vger.kernel.org&gt; # v4.20
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: handle zero sized retrieve correctly</title>
<updated>2019-01-16T09:27:59+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2019-01-16T09:27:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=97e1532ef81acb31c30f9e75bf00306c33a77812'/>
<id>97e1532ef81acb31c30f9e75bf00306c33a77812</id>
<content type='text'>
Dereferencing req-&gt;page_descs[0] will Oops if req-&gt;max_pages is zero.

Reported-by: syzbot+c1e36d30ee3416289cc0@syzkaller.appspotmail.com
Tested-by: syzbot+c1e36d30ee3416289cc0@syzkaller.appspotmail.com
Fixes: b2430d7567a3 ("fuse: add per-page descriptor &lt;offset, length&gt; to fuse_req")
Cc: &lt;stable@vger.kernel.org&gt; # v3.9
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Dereferencing req-&gt;page_descs[0] will Oops if req-&gt;max_pages is zero.

Reported-by: syzbot+c1e36d30ee3416289cc0@syzkaller.appspotmail.com
Tested-by: syzbot+c1e36d30ee3416289cc0@syzkaller.appspotmail.com
Fixes: b2430d7567a3 ("fuse: add per-page descriptor &lt;offset, length&gt; to fuse_req")
Cc: &lt;stable@vger.kernel.org&gt; # v3.9
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mm: convert totalram_pages and totalhigh_pages variables to atomic</title>
<updated>2018-12-28T20:11:47+00:00</updated>
<author>
<name>Arun KS</name>
<email>arunks@codeaurora.org</email>
</author>
<published>2018-12-28T08:34:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ca79b0c211af63fa3276f0e3fd7dd9ada2439839'/>
<id>ca79b0c211af63fa3276f0e3fd7dd9ada2439839</id>
<content type='text'>
totalram_pages and totalhigh_pages are made static inline function.

Main motivation was that managed_page_count_lock handling was complicating
things.  It was discussed in length here,
https://lore.kernel.org/patchwork/patch/995739/#1181785 So it seemes
better to remove the lock and convert variables to atomic, with preventing
poteintial store-to-read tearing as a bonus.

[akpm@linux-foundation.org: coding style fixes]
Link: http://lkml.kernel.org/r/1542090790-21750-4-git-send-email-arunks@codeaurora.org
Signed-off-by: Arun KS &lt;arunks@codeaurora.org&gt;
Suggested-by: Michal Hocko &lt;mhocko@suse.com&gt;
Suggested-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Reviewed-by: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
Reviewed-by: Pavel Tatashin &lt;pasha.tatashin@soleen.com&gt;
Acked-by: Michal Hocko &lt;mhocko@suse.com&gt;
Acked-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: David Hildenbrand &lt;david@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
totalram_pages and totalhigh_pages are made static inline function.

Main motivation was that managed_page_count_lock handling was complicating
things.  It was discussed in length here,
https://lore.kernel.org/patchwork/patch/995739/#1181785 So it seemes
better to remove the lock and convert variables to atomic, with preventing
poteintial store-to-read tearing as a bonus.

[akpm@linux-foundation.org: coding style fixes]
Link: http://lkml.kernel.org/r/1542090790-21750-4-git-send-email-arunks@codeaurora.org
Signed-off-by: Arun KS &lt;arunks@codeaurora.org&gt;
Suggested-by: Michal Hocko &lt;mhocko@suse.com&gt;
Suggested-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Reviewed-by: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
Reviewed-by: Pavel Tatashin &lt;pasha.tatashin@soleen.com&gt;
Acked-by: Michal Hocko &lt;mhocko@suse.com&gt;
Acked-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: David Hildenbrand &lt;david@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: continue to send FUSE_RELEASEDIR when FUSE_OPEN returns ENOSYS</title>
<updated>2018-12-11T20:47:28+00:00</updated>
<author>
<name>Chad Austin</name>
<email>chadaustin@fb.com</email>
</author>
<published>2018-12-10T18:54:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2e64ff154ce6ce9a8dc0f9556463916efa6ff460'/>
<id>2e64ff154ce6ce9a8dc0f9556463916efa6ff460</id>
<content type='text'>
When FUSE_OPEN returns ENOSYS, the no_open bit is set on the connection.

Because the FUSE_RELEASE and FUSE_RELEASEDIR paths share code, this
incorrectly caused the FUSE_RELEASEDIR request to be dropped and never sent
to userspace.

Pass an isdir bool to distinguish between FUSE_RELEASE and FUSE_RELEASEDIR
inside of fuse_file_put.

Fixes: 7678ac50615d ("fuse: support clients that don't implement 'open'")
Cc: &lt;stable@vger.kernel.org&gt; # v3.14
Signed-off-by: Chad Austin &lt;chadaustin@fb.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When FUSE_OPEN returns ENOSYS, the no_open bit is set on the connection.

Because the FUSE_RELEASE and FUSE_RELEASEDIR paths share code, this
incorrectly caused the FUSE_RELEASEDIR request to be dropped and never sent
to userspace.

Pass an isdir bool to distinguish between FUSE_RELEASE and FUSE_RELEASEDIR
inside of fuse_file_put.

Fixes: 7678ac50615d ("fuse: support clients that don't implement 'open'")
Cc: &lt;stable@vger.kernel.org&gt; # v3.14
Signed-off-by: Chad Austin &lt;chadaustin@fb.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: Fix memory leak in fuse_dev_free()</title>
<updated>2018-12-10T08:57:54+00:00</updated>
<author>
<name>Takeshi Misawa</name>
<email>jeliantsurux@gmail.com</email>
</author>
<published>2018-12-09T05:30:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d72f70da60de1af4bfd0f0a3d0ecbc28eea07679'/>
<id>d72f70da60de1af4bfd0f0a3d0ecbc28eea07679</id>
<content type='text'>
When ntfs is unmounted, the following leak is
reported by kmemleak.

kmemleak report:

unreferenced object 0xffff880052bf4400 (size 4096):
  comm "mount.ntfs", pid 16530, jiffies 4294861127 (age 3215.836s)
  hex dump (first 32 bytes):
    00 44 bf 52 00 88 ff ff 00 44 bf 52 00 88 ff ff  .D.R.....D.R....
    10 44 bf 52 00 88 ff ff 10 44 bf 52 00 88 ff ff  .D.R.....D.R....
  backtrace:
    [&lt;00000000bf4a2f8d&gt;] fuse_fill_super+0xb22/0x1da0 [fuse]
    [&lt;000000004dde0f0c&gt;] mount_bdev+0x263/0x320
    [&lt;0000000025aebc66&gt;] mount_fs+0x82/0x2bf
    [&lt;0000000042c5a6be&gt;] vfs_kern_mount.part.33+0xbf/0x480
    [&lt;00000000ed10cd5b&gt;] do_mount+0x3de/0x2ad0
    [&lt;00000000d59ff068&gt;] ksys_mount+0xba/0xd0
    [&lt;000000001bda1bcc&gt;] __x64_sys_mount+0xba/0x150
    [&lt;00000000ebe26304&gt;] do_syscall_64+0x151/0x490
    [&lt;00000000d25f2b42&gt;] entry_SYSCALL_64_after_hwframe+0x44/0xa9
    [&lt;000000002e0abd2c&gt;] 0xffffffffffffffff

fuse_dev_alloc() allocate fud-&gt;pq.processing.
But this hash table is not freed.

Fix this by freeing fud-&gt;pq.processing.

Signed-off-by: Takeshi Misawa &lt;jeliantsurux@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: be2ff42c5d6e ("fuse: Use hash table to link processing request")
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When ntfs is unmounted, the following leak is
reported by kmemleak.

kmemleak report:

unreferenced object 0xffff880052bf4400 (size 4096):
  comm "mount.ntfs", pid 16530, jiffies 4294861127 (age 3215.836s)
  hex dump (first 32 bytes):
    00 44 bf 52 00 88 ff ff 00 44 bf 52 00 88 ff ff  .D.R.....D.R....
    10 44 bf 52 00 88 ff ff 10 44 bf 52 00 88 ff ff  .D.R.....D.R....
  backtrace:
    [&lt;00000000bf4a2f8d&gt;] fuse_fill_super+0xb22/0x1da0 [fuse]
    [&lt;000000004dde0f0c&gt;] mount_bdev+0x263/0x320
    [&lt;0000000025aebc66&gt;] mount_fs+0x82/0x2bf
    [&lt;0000000042c5a6be&gt;] vfs_kern_mount.part.33+0xbf/0x480
    [&lt;00000000ed10cd5b&gt;] do_mount+0x3de/0x2ad0
    [&lt;00000000d59ff068&gt;] ksys_mount+0xba/0xd0
    [&lt;000000001bda1bcc&gt;] __x64_sys_mount+0xba/0x150
    [&lt;00000000ebe26304&gt;] do_syscall_64+0x151/0x490
    [&lt;00000000d25f2b42&gt;] entry_SYSCALL_64_after_hwframe+0x44/0xa9
    [&lt;000000002e0abd2c&gt;] 0xffffffffffffffff

fuse_dev_alloc() allocate fud-&gt;pq.processing.
But this hash table is not freed.

Fix this by freeing fud-&gt;pq.processing.

Signed-off-by: Takeshi Misawa &lt;jeliantsurux@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: be2ff42c5d6e ("fuse: Use hash table to link processing request")
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: fix revalidation of attributes for permission check</title>
<updated>2018-12-03T09:14:43+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2018-12-03T09:14:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d233c7dd1682437ba4b430b04766aa6eef9aef67'/>
<id>d233c7dd1682437ba4b430b04766aa6eef9aef67</id>
<content type='text'>
fuse_invalidate_attr() now sets fi-&gt;inval_mask instead of fi-&gt;i_time, hence
we need to check the inval mask in fuse_permission() as well.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: 2f1e81965fd0 ("fuse: allow fine grained attr cache invaldation")
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fuse_invalidate_attr() now sets fi-&gt;inval_mask instead of fi-&gt;i_time, hence
we need to check the inval mask in fuse_permission() as well.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: 2f1e81965fd0 ("fuse: allow fine grained attr cache invaldation")
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: fix fsync on directory</title>
<updated>2018-12-03T09:14:43+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2018-12-03T09:14:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a9c2d1e82fc2937baf43c0d400f0c9e87dcf035d'/>
<id>a9c2d1e82fc2937baf43c0d400f0c9e87dcf035d</id>
<content type='text'>
Commit ab2257e9941b ("fuse: reduce size of struct fuse_inode") moved parts
of fields related to writeback on regular file and to directory caching
into a union.  However fuse_fsync_common() called from fuse_dir_fsync()
touches some writeback related fields, resulting in a crash.

Move writeback related parts from fuse_fsync_common() to fuse_fysnc().

Reported-by: Brett Girton &lt;btgirton@gmail.com&gt;
Tested-by: Brett Girton &lt;btgirton@gmail.com&gt;
Fixes: ab2257e9941b ("fuse: reduce size of struct fuse_inode")
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit ab2257e9941b ("fuse: reduce size of struct fuse_inode") moved parts
of fields related to writeback on regular file and to directory caching
into a union.  However fuse_fsync_common() called from fuse_dir_fsync()
touches some writeback related fields, resulting in a crash.

Move writeback related parts from fuse_fsync_common() to fuse_fysnc().

Reported-by: Brett Girton &lt;btgirton@gmail.com&gt;
Tested-by: Brett Girton &lt;btgirton@gmail.com&gt;
Fixes: ab2257e9941b ("fuse: reduce size of struct fuse_inode")
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: Add bad inode check in fuse_destroy_inode()</title>
<updated>2018-11-22T09:20:19+00:00</updated>
<author>
<name>Myungho Jung</name>
<email>mhjungk@gmail.com</email>
</author>
<published>2018-11-21T23:18:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4fc4bb796b0c75067fd65292dfd874869ff7c9dc'/>
<id>4fc4bb796b0c75067fd65292dfd874869ff7c9dc</id>
<content type='text'>
make_bad_inode() sets inode-&gt;i_mode to S_IFREG if I/O error is detected
in fuse_do_getattr()/fuse_do_setattr(). If the inode is not a regular
file, write_files and queued_writes in fuse_inode are not initialized
and have NULL or invalid pointers written by other members in a union.
So, list_empty() returns false in fuse_destroy_inode(). Add
is_bad_inode() to check if make_bad_inode() was called.

Reported-by: syzbot+b9c89b84423073226299@syzkaller.appspotmail.com
Fixes: ab2257e9941b ("fuse: reduce size of struct fuse_inode")
Signed-off-by: Myungho Jung &lt;mhjungk@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
make_bad_inode() sets inode-&gt;i_mode to S_IFREG if I/O error is detected
in fuse_do_getattr()/fuse_do_setattr(). If the inode is not a regular
file, write_files and queued_writes in fuse_inode are not initialized
and have NULL or invalid pointers written by other members in a union.
So, list_empty() returns false in fuse_destroy_inode(). Add
is_bad_inode() to check if make_bad_inode() was called.

Reported-by: syzbot+b9c89b84423073226299@syzkaller.appspotmail.com
Fixes: ab2257e9941b ("fuse: reduce size of struct fuse_inode")
Signed-off-by: Myungho Jung &lt;mhjungk@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
