<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/fs/fuse, branch v4.20</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<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.tavy.me/linux-stable.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.tavy.me/linux-stable.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.tavy.me/linux-stable.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.tavy.me/linux-stable.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.tavy.me/linux-stable.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>
<entry>
<title>fuse: fix use-after-free in fuse_direct_IO()</title>
<updated>2018-11-09T14:52:17+00:00</updated>
<author>
<name>Lukas Czerner</name>
<email>lczerner@redhat.com</email>
</author>
<published>2018-11-09T13:51:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ebacb81273599555a7a19f7754a1451206a5fc4f'/>
<id>ebacb81273599555a7a19f7754a1451206a5fc4f</id>
<content type='text'>
In async IO blocking case the additional reference to the io is taken for
it to survive fuse_aio_complete(). In non blocking case this additional
reference is not needed, however we still reference io to figure out
whether to wait for completion or not. This is wrong and will lead to
use-after-free. Fix it by storing blocking information in separate
variable.

This was spotted by KASAN when running generic/208 fstest.

Signed-off-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Reported-by: Zorro Lang &lt;zlang@redhat.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: 744742d692e3 ("fuse: Add reference counting for fuse_io_priv")
Cc: &lt;stable@vger.kernel.org&gt; # v4.6
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In async IO blocking case the additional reference to the io is taken for
it to survive fuse_aio_complete(). In non blocking case this additional
reference is not needed, however we still reference io to figure out
whether to wait for completion or not. This is wrong and will lead to
use-after-free. Fix it by storing blocking information in separate
variable.

This was spotted by KASAN when running generic/208 fstest.

Signed-off-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Reported-by: Zorro Lang &lt;zlang@redhat.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: 744742d692e3 ("fuse: Add reference counting for fuse_io_priv")
Cc: &lt;stable@vger.kernel.org&gt; # v4.6
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: fix possibly missed wake-up after abort</title>
<updated>2018-11-09T14:52:16+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2018-11-09T14:52:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2d84a2d19b6150c6dbac1e6ebad9c82e4c123772'/>
<id>2d84a2d19b6150c6dbac1e6ebad9c82e4c123772</id>
<content type='text'>
In current fuse_drop_waiting() implementation it's possible that
fuse_wait_aborted() will not be woken up in the unlikely case that
fuse_abort_conn() + fuse_wait_aborted() runs in between checking
fc-&gt;connected and calling atomic_dec(&amp;fc-&gt;num_waiting).

Do the atomic_dec_and_test() unconditionally, which also provides the
necessary barrier against reordering with the fc-&gt;connected check.

The explicit smp_mb() in fuse_wait_aborted() is not actually needed, since
the spin_unlock() in fuse_abort_conn() provides the necessary RELEASE
barrier after resetting fc-&gt;connected.  However, this is not a performance
sensitive path, and adding the explicit barrier makes it easier to
document.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: b8f95e5d13f5 ("fuse: umount should wait for all requests")
Cc: &lt;stable@vger.kernel.org&gt; #v4.19
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In current fuse_drop_waiting() implementation it's possible that
fuse_wait_aborted() will not be woken up in the unlikely case that
fuse_abort_conn() + fuse_wait_aborted() runs in between checking
fc-&gt;connected and calling atomic_dec(&amp;fc-&gt;num_waiting).

Do the atomic_dec_and_test() unconditionally, which also provides the
necessary barrier against reordering with the fc-&gt;connected check.

The explicit smp_mb() in fuse_wait_aborted() is not actually needed, since
the spin_unlock() in fuse_abort_conn() provides the necessary RELEASE
barrier after resetting fc-&gt;connected.  However, this is not a performance
sensitive path, and adding the explicit barrier makes it easier to
document.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: b8f95e5d13f5 ("fuse: umount should wait for all requests")
Cc: &lt;stable@vger.kernel.org&gt; #v4.19
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: fix leaked notify reply</title>
<updated>2018-11-09T14:52:16+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2018-11-09T14:52:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7fabaf303458fcabb694999d6fa772cc13d4e217'/>
<id>7fabaf303458fcabb694999d6fa772cc13d4e217</id>
<content type='text'>
fuse_request_send_notify_reply() may fail if the connection was reset for
some reason (e.g. fs was unmounted).  Don't leak request reference in this
case.  Besides leaking memory, this resulted in fc-&gt;num_waiting not being
decremented and hence fuse_wait_aborted() left in a hanging and unkillable
state.

Fixes: 2d45ba381a74 ("fuse: add retrieve request")
Fixes: b8f95e5d13f5 ("fuse: umount should wait for all requests")
Reported-and-tested-by: syzbot+6339eda9cb4ebbc4c37b@syzkaller.appspotmail.com
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; #v2.6.36
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fuse_request_send_notify_reply() may fail if the connection was reset for
some reason (e.g. fs was unmounted).  Don't leak request reference in this
case.  Besides leaking memory, this resulted in fc-&gt;num_waiting not being
decremented and hence fuse_wait_aborted() left in a hanging and unkillable
state.

Fixes: 2d45ba381a74 ("fuse: add retrieve request")
Fixes: b8f95e5d13f5 ("fuse: umount should wait for all requests")
Reported-and-tested-by: syzbot+6339eda9cb4ebbc4c37b@syzkaller.appspotmail.com
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; #v2.6.36
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'work.afs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs</title>
<updated>2018-11-02T02:58:52+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2018-11-02T02:58:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9931a07d518e86eb58a75e508ed9626f86359303'/>
<id>9931a07d518e86eb58a75e508ed9626f86359303</id>
<content type='text'>
Pull AFS updates from Al Viro:
 "AFS series, with some iov_iter bits included"

* 'work.afs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (26 commits)
  missing bits of "iov_iter: Separate type from direction and use accessor functions"
  afs: Probe multiple fileservers simultaneously
  afs: Fix callback handling
  afs: Eliminate the address pointer from the address list cursor
  afs: Allow dumping of server cursor on operation failure
  afs: Implement YFS support in the fs client
  afs: Expand data structure fields to support YFS
  afs: Get the target vnode in afs_rmdir() and get a callback on it
  afs: Calc callback expiry in op reply delivery
  afs: Fix FS.FetchStatus delivery from updating wrong vnode
  afs: Implement the YFS cache manager service
  afs: Remove callback details from afs_callback_break struct
  afs: Commit the status on a new file/dir/symlink
  afs: Increase to 64-bit volume ID and 96-bit vnode ID for YFS
  afs: Don't invoke the server to read data beyond EOF
  afs: Add a couple of tracepoints to log I/O errors
  afs: Handle EIO from delivery function
  afs: Fix TTL on VL server and address lists
  afs: Implement VL server rotation
  afs: Improve FS server rotation error handling
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull AFS updates from Al Viro:
 "AFS series, with some iov_iter bits included"

* 'work.afs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (26 commits)
  missing bits of "iov_iter: Separate type from direction and use accessor functions"
  afs: Probe multiple fileservers simultaneously
  afs: Fix callback handling
  afs: Eliminate the address pointer from the address list cursor
  afs: Allow dumping of server cursor on operation failure
  afs: Implement YFS support in the fs client
  afs: Expand data structure fields to support YFS
  afs: Get the target vnode in afs_rmdir() and get a callback on it
  afs: Calc callback expiry in op reply delivery
  afs: Fix FS.FetchStatus delivery from updating wrong vnode
  afs: Implement the YFS cache manager service
  afs: Remove callback details from afs_callback_break struct
  afs: Commit the status on a new file/dir/symlink
  afs: Increase to 64-bit volume ID and 96-bit vnode ID for YFS
  afs: Don't invoke the server to read data beyond EOF
  afs: Add a couple of tracepoints to log I/O errors
  afs: Handle EIO from delivery function
  afs: Fix TTL on VL server and address lists
  afs: Implement VL server rotation
  afs: Improve FS server rotation error handling
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>iov_iter: Use accessor function</title>
<updated>2018-10-23T23:40:44+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2018-10-22T12:07:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=00e23707442a75b404392cef1405ab4fd498de6b'/>
<id>00e23707442a75b404392cef1405ab4fd498de6b</id>
<content type='text'>
Use accessor functions to access an iterator's type and direction.  This
allows for the possibility of using some other method of determining the
type of iterator than if-chains with bitwise-AND conditions.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use accessor functions to access an iterator's type and direction.  This
allows for the possibility of using some other method of determining the
type of iterator than if-chains with bitwise-AND conditions.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;

</pre>
</div>
</content>
</entry>
</feed>
