<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/fs/fuse, branch v4.4.166</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>fuse: fix leaked notify reply</title>
<updated>2018-11-21T08:27:44+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=6023d16fdb84e849d4aa60c2bc1ea294a217d6cb'/>
<id>6023d16fdb84e849d4aa60c2bc1ea294a217d6cb</id>
<content type='text'>
commit 7fabaf303458fcabb694999d6fa772cc13d4e217 upstream.

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
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 7fabaf303458fcabb694999d6fa772cc13d4e217 upstream.

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
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: set FR_SENT while locked</title>
<updated>2018-11-21T08:27:40+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2018-09-28T14:43:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f04651b97aed95cc82fc49997de1e5b1a6990e97'/>
<id>f04651b97aed95cc82fc49997de1e5b1a6990e97</id>
<content type='text'>
commit 4c316f2f3ff315cb48efb7435621e5bfb81df96d upstream.

Otherwise fuse_dev_do_write() could come in and finish off the request, and
the set_bit(FR_SENT, ...) could trigger the WARN_ON(test_bit(FR_SENT, ...))
in request_end().

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Reported-by: syzbot+ef054c4d3f64cd7f7cec@syzkaller.appspotmai
Fixes: 46c34a348b0a ("fuse: no fc-&gt;lock for pqueue parts")
Cc: &lt;stable@vger.kernel.org&gt; # v4.2
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 4c316f2f3ff315cb48efb7435621e5bfb81df96d upstream.

Otherwise fuse_dev_do_write() could come in and finish off the request, and
the set_bit(FR_SENT, ...) could trigger the WARN_ON(test_bit(FR_SENT, ...))
in request_end().

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Reported-by: syzbot+ef054c4d3f64cd7f7cec@syzkaller.appspotmai
Fixes: 46c34a348b0a ("fuse: no fc-&gt;lock for pqueue parts")
Cc: &lt;stable@vger.kernel.org&gt; # v4.2
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: fix blocked_waitq wakeup</title>
<updated>2018-11-21T08:27:40+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2018-09-28T14:43:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2fe23468dae467043183e301829827c17f65f45f'/>
<id>2fe23468dae467043183e301829827c17f65f45f</id>
<content type='text'>
commit 908a572b80f6e9577b45e81b3dfe2e22111286b8 upstream.

Using waitqueue_active() is racy.  Make sure we issue a wake_up()
unconditionally after storing into fc-&gt;blocked.  After that it's okay to
optimize with waitqueue_active() since the first wake up provides the
necessary barrier for all waiters, not the just the woken one.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: 3c18ef8117f0 ("fuse: optimize wake_up")
Cc: &lt;stable@vger.kernel.org&gt; # v3.10
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 908a572b80f6e9577b45e81b3dfe2e22111286b8 upstream.

Using waitqueue_active() is racy.  Make sure we issue a wake_up()
unconditionally after storing into fc-&gt;blocked.  After that it's okay to
optimize with waitqueue_active() since the first wake up provides the
necessary barrier for all waiters, not the just the woken one.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: 3c18ef8117f0 ("fuse: optimize wake_up")
Cc: &lt;stable@vger.kernel.org&gt; # v3.10
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: Fix use-after-free in fuse_dev_do_write()</title>
<updated>2018-11-21T08:27:39+00:00</updated>
<author>
<name>Kirill Tkhai</name>
<email>ktkhai@virtuozzo.com</email>
</author>
<published>2018-09-25T09:52:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8bb4354af373a8af395450acd298f25ddb79d93b'/>
<id>8bb4354af373a8af395450acd298f25ddb79d93b</id>
<content type='text'>
commit d2d2d4fb1f54eff0f3faa9762d84f6446a4bc5d0 upstream.

After we found req in request_find() and released the lock,
everything may happen with the req in parallel:

cpu0                              cpu1
fuse_dev_do_write()               fuse_dev_do_write()
  req = request_find(fpq, ...)    ...
  spin_unlock(&amp;fpq-&gt;lock)         ...
  ...                             req = request_find(fpq, oh.unique)
  ...                             spin_unlock(&amp;fpq-&gt;lock)
  queue_interrupt(&amp;fc-&gt;iq, req);   ...
  ...                              ...
  ...                              ...
  request_end(fc, req);
    fuse_put_request(fc, req);
  ...                              queue_interrupt(&amp;fc-&gt;iq, req);


Signed-off-by: Kirill Tkhai &lt;ktkhai@virtuozzo.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: 46c34a348b0a ("fuse: no fc-&gt;lock for pqueue parts")
Cc: &lt;stable@vger.kernel.org&gt; # v4.2
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit d2d2d4fb1f54eff0f3faa9762d84f6446a4bc5d0 upstream.

After we found req in request_find() and released the lock,
everything may happen with the req in parallel:

cpu0                              cpu1
fuse_dev_do_write()               fuse_dev_do_write()
  req = request_find(fpq, ...)    ...
  spin_unlock(&amp;fpq-&gt;lock)         ...
  ...                             req = request_find(fpq, oh.unique)
  ...                             spin_unlock(&amp;fpq-&gt;lock)
  queue_interrupt(&amp;fc-&gt;iq, req);   ...
  ...                              ...
  ...                              ...
  request_end(fc, req);
    fuse_put_request(fc, req);
  ...                              queue_interrupt(&amp;fc-&gt;iq, req);


Signed-off-by: Kirill Tkhai &lt;ktkhai@virtuozzo.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: 46c34a348b0a ("fuse: no fc-&gt;lock for pqueue parts")
Cc: &lt;stable@vger.kernel.org&gt; # v4.2
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: Fix use-after-free in fuse_dev_do_read()</title>
<updated>2018-11-21T08:27:39+00:00</updated>
<author>
<name>Kirill Tkhai</name>
<email>ktkhai@virtuozzo.com</email>
</author>
<published>2018-09-25T09:28:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7574afe0cfc0e103f309a721880d195f38b292e0'/>
<id>7574afe0cfc0e103f309a721880d195f38b292e0</id>
<content type='text'>
commit bc78abbd55dd28e2287ec6d6502b842321a17c87 upstream.

We may pick freed req in this way:

[cpu0]                                  [cpu1]
fuse_dev_do_read()                      fuse_dev_do_write()
   list_move_tail(&amp;req-&gt;list, ...);     ...
   spin_unlock(&amp;fpq-&gt;lock);             ...
   ...                                  request_end(fc, req);
   ...                                    fuse_put_request(fc, req);
   if (test_bit(FR_INTERRUPTED, ...))
         queue_interrupt(fiq, req);

Fix that by keeping req alive until we finish all manipulations.

Reported-by: syzbot+4e975615ca01f2277bdd@syzkaller.appspotmail.com
Signed-off-by: Kirill Tkhai &lt;ktkhai@virtuozzo.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: 46c34a348b0a ("fuse: no fc-&gt;lock for pqueue parts")
Cc: &lt;stable@vger.kernel.org&gt; # v4.2
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit bc78abbd55dd28e2287ec6d6502b842321a17c87 upstream.

We may pick freed req in this way:

[cpu0]                                  [cpu1]
fuse_dev_do_read()                      fuse_dev_do_write()
   list_move_tail(&amp;req-&gt;list, ...);     ...
   spin_unlock(&amp;fpq-&gt;lock);             ...
   ...                                  request_end(fc, req);
   ...                                    fuse_put_request(fc, req);
   if (test_bit(FR_INTERRUPTED, ...))
         queue_interrupt(fiq, req);

Fix that by keeping req alive until we finish all manipulations.

Reported-by: syzbot+4e975615ca01f2277bdd@syzkaller.appspotmail.com
Signed-off-by: Kirill Tkhai &lt;ktkhai@virtuozzo.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: 46c34a348b0a ("fuse: no fc-&gt;lock for pqueue parts")
Cc: &lt;stable@vger.kernel.org&gt; # v4.2
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: Dont call set_page_dirty_lock() for ITER_BVEC pages for async_dio</title>
<updated>2018-11-10T15:41:37+00:00</updated>
<author>
<name>Ashish Samant</name>
<email>ashish.samant@oracle.com</email>
</author>
<published>2017-07-13T02:26:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1b6a863ff29ccd7b65b0112bbec1cda26b7f9c4e'/>
<id>1b6a863ff29ccd7b65b0112bbec1cda26b7f9c4e</id>
<content type='text'>
[ Upstream commit 61c12b49e1c9c77d7a1bcc161de540d0fd21cf0c ]

Commit 8fba54aebbdf ("fuse: direct-io: don't dirty ITER_BVEC pages") fixes
the ITER_BVEC page deadlock for direct io in fuse by checking in
fuse_direct_io(), whether the page is a bvec page or not, before locking
it.  However, this check is missed when the "async_dio" mount option is
enabled.  In this case, set_page_dirty_lock() is called from the req-&gt;end
callback in request_end(), when the fuse thread is returning from userspace
to respond to the read request.  This will cause the same deadlock because
the bvec condition is not checked in this path.

Here is the stack of the deadlocked thread, while returning from userspace:

[13706.656686] INFO: task glusterfs:3006 blocked for more than 120 seconds.
[13706.657808] "echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables
this message.
[13706.658788] glusterfs       D ffffffff816c80f0     0  3006      1
0x00000080
[13706.658797]  ffff8800d6713a58 0000000000000086 ffff8800d9ad7000
ffff8800d9ad5400
[13706.658799]  ffff88011ffd5cc0 ffff8800d6710008 ffff88011fd176c0
7fffffffffffffff
[13706.658801]  0000000000000002 ffffffff816c80f0 ffff8800d6713a78
ffffffff816c790e
[13706.658803] Call Trace:
[13706.658809]  [&lt;ffffffff816c80f0&gt;] ? bit_wait_io_timeout+0x80/0x80
[13706.658811]  [&lt;ffffffff816c790e&gt;] schedule+0x3e/0x90
[13706.658813]  [&lt;ffffffff816ca7e5&gt;] schedule_timeout+0x1b5/0x210
[13706.658816]  [&lt;ffffffff81073ffb&gt;] ? gup_pud_range+0x1db/0x1f0
[13706.658817]  [&lt;ffffffff810668fe&gt;] ? kvm_clock_read+0x1e/0x20
[13706.658819]  [&lt;ffffffff81066909&gt;] ? kvm_clock_get_cycles+0x9/0x10
[13706.658822]  [&lt;ffffffff810f5792&gt;] ? ktime_get+0x52/0xc0
[13706.658824]  [&lt;ffffffff816c6f04&gt;] io_schedule_timeout+0xa4/0x110
[13706.658826]  [&lt;ffffffff816c8126&gt;] bit_wait_io+0x36/0x50
[13706.658828]  [&lt;ffffffff816c7d06&gt;] __wait_on_bit_lock+0x76/0xb0
[13706.658831]  [&lt;ffffffffa0545636&gt;] ? lock_request+0x46/0x70 [fuse]
[13706.658834]  [&lt;ffffffff8118800a&gt;] __lock_page+0xaa/0xb0
[13706.658836]  [&lt;ffffffff810c8500&gt;] ? wake_atomic_t_function+0x40/0x40
[13706.658838]  [&lt;ffffffff81194d08&gt;] set_page_dirty_lock+0x58/0x60
[13706.658841]  [&lt;ffffffffa054d968&gt;] fuse_release_user_pages+0x58/0x70 [fuse]
[13706.658844]  [&lt;ffffffffa0551430&gt;] ? fuse_aio_complete+0x190/0x190 [fuse]
[13706.658847]  [&lt;ffffffffa0551459&gt;] fuse_aio_complete_req+0x29/0x90 [fuse]
[13706.658849]  [&lt;ffffffffa05471e9&gt;] request_end+0xd9/0x190 [fuse]
[13706.658852]  [&lt;ffffffffa0549126&gt;] fuse_dev_do_write+0x336/0x490 [fuse]
[13706.658854]  [&lt;ffffffffa054963e&gt;] fuse_dev_write+0x6e/0xa0 [fuse]
[13706.658857]  [&lt;ffffffff812a9ef3&gt;] ? security_file_permission+0x23/0x90
[13706.658859]  [&lt;ffffffff81205300&gt;] do_iter_readv_writev+0x60/0x90
[13706.658862]  [&lt;ffffffffa05495d0&gt;] ? fuse_dev_splice_write+0x350/0x350
[fuse]
[13706.658863]  [&lt;ffffffff812062a1&gt;] do_readv_writev+0x171/0x1f0
[13706.658866]  [&lt;ffffffff810b3d00&gt;] ? try_to_wake_up+0x210/0x210
[13706.658868]  [&lt;ffffffff81206361&gt;] vfs_writev+0x41/0x50
[13706.658870]  [&lt;ffffffff81206496&gt;] SyS_writev+0x56/0xf0
[13706.658872]  [&lt;ffffffff810257a1&gt;] ? syscall_trace_leave+0xf1/0x160
[13706.658874]  [&lt;ffffffff816cbb2e&gt;] system_call_fastpath+0x12/0x71

Fix this by making should_dirty a fuse_io_priv parameter that can be
checked in fuse_aio_complete_req().

Reported-by: Tiger Yang &lt;tiger.yang@oracle.com&gt;
Signed-off-by: Ashish Samant &lt;ashish.samant@oracle.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 61c12b49e1c9c77d7a1bcc161de540d0fd21cf0c ]

Commit 8fba54aebbdf ("fuse: direct-io: don't dirty ITER_BVEC pages") fixes
the ITER_BVEC page deadlock for direct io in fuse by checking in
fuse_direct_io(), whether the page is a bvec page or not, before locking
it.  However, this check is missed when the "async_dio" mount option is
enabled.  In this case, set_page_dirty_lock() is called from the req-&gt;end
callback in request_end(), when the fuse thread is returning from userspace
to respond to the read request.  This will cause the same deadlock because
the bvec condition is not checked in this path.

Here is the stack of the deadlocked thread, while returning from userspace:

[13706.656686] INFO: task glusterfs:3006 blocked for more than 120 seconds.
[13706.657808] "echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables
this message.
[13706.658788] glusterfs       D ffffffff816c80f0     0  3006      1
0x00000080
[13706.658797]  ffff8800d6713a58 0000000000000086 ffff8800d9ad7000
ffff8800d9ad5400
[13706.658799]  ffff88011ffd5cc0 ffff8800d6710008 ffff88011fd176c0
7fffffffffffffff
[13706.658801]  0000000000000002 ffffffff816c80f0 ffff8800d6713a78
ffffffff816c790e
[13706.658803] Call Trace:
[13706.658809]  [&lt;ffffffff816c80f0&gt;] ? bit_wait_io_timeout+0x80/0x80
[13706.658811]  [&lt;ffffffff816c790e&gt;] schedule+0x3e/0x90
[13706.658813]  [&lt;ffffffff816ca7e5&gt;] schedule_timeout+0x1b5/0x210
[13706.658816]  [&lt;ffffffff81073ffb&gt;] ? gup_pud_range+0x1db/0x1f0
[13706.658817]  [&lt;ffffffff810668fe&gt;] ? kvm_clock_read+0x1e/0x20
[13706.658819]  [&lt;ffffffff81066909&gt;] ? kvm_clock_get_cycles+0x9/0x10
[13706.658822]  [&lt;ffffffff810f5792&gt;] ? ktime_get+0x52/0xc0
[13706.658824]  [&lt;ffffffff816c6f04&gt;] io_schedule_timeout+0xa4/0x110
[13706.658826]  [&lt;ffffffff816c8126&gt;] bit_wait_io+0x36/0x50
[13706.658828]  [&lt;ffffffff816c7d06&gt;] __wait_on_bit_lock+0x76/0xb0
[13706.658831]  [&lt;ffffffffa0545636&gt;] ? lock_request+0x46/0x70 [fuse]
[13706.658834]  [&lt;ffffffff8118800a&gt;] __lock_page+0xaa/0xb0
[13706.658836]  [&lt;ffffffff810c8500&gt;] ? wake_atomic_t_function+0x40/0x40
[13706.658838]  [&lt;ffffffff81194d08&gt;] set_page_dirty_lock+0x58/0x60
[13706.658841]  [&lt;ffffffffa054d968&gt;] fuse_release_user_pages+0x58/0x70 [fuse]
[13706.658844]  [&lt;ffffffffa0551430&gt;] ? fuse_aio_complete+0x190/0x190 [fuse]
[13706.658847]  [&lt;ffffffffa0551459&gt;] fuse_aio_complete_req+0x29/0x90 [fuse]
[13706.658849]  [&lt;ffffffffa05471e9&gt;] request_end+0xd9/0x190 [fuse]
[13706.658852]  [&lt;ffffffffa0549126&gt;] fuse_dev_do_write+0x336/0x490 [fuse]
[13706.658854]  [&lt;ffffffffa054963e&gt;] fuse_dev_write+0x6e/0xa0 [fuse]
[13706.658857]  [&lt;ffffffff812a9ef3&gt;] ? security_file_permission+0x23/0x90
[13706.658859]  [&lt;ffffffff81205300&gt;] do_iter_readv_writev+0x60/0x90
[13706.658862]  [&lt;ffffffffa05495d0&gt;] ? fuse_dev_splice_write+0x350/0x350
[fuse]
[13706.658863]  [&lt;ffffffff812062a1&gt;] do_readv_writev+0x171/0x1f0
[13706.658866]  [&lt;ffffffff810b3d00&gt;] ? try_to_wake_up+0x210/0x210
[13706.658868]  [&lt;ffffffff81206361&gt;] vfs_writev+0x41/0x50
[13706.658870]  [&lt;ffffffff81206496&gt;] SyS_writev+0x56/0xf0
[13706.658872]  [&lt;ffffffff810257a1&gt;] ? syscall_trace_leave+0xf1/0x160
[13706.658874]  [&lt;ffffffff816cbb2e&gt;] system_call_fastpath+0x12/0x71

Fix this by making should_dirty a fuse_io_priv parameter that can be
checked in fuse_aio_complete_req().

Reported-by: Tiger Yang &lt;tiger.yang@oracle.com&gt;
Signed-off-by: Ashish Samant &lt;ashish.samant@oracle.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: Add missed unlock_page() to fuse_readpages_fill()</title>
<updated>2018-09-05T07:18:39+00:00</updated>
<author>
<name>Kirill Tkhai</name>
<email>ktkhai@virtuozzo.com</email>
</author>
<published>2018-07-19T12:49:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=84c7c9010234715c9cb9470b09f41ed12b0d2163'/>
<id>84c7c9010234715c9cb9470b09f41ed12b0d2163</id>
<content type='text'>
commit 109728ccc5933151c68d1106e4065478a487a323 upstream.

The above error path returns with page unlocked, so this place seems also
to behave the same.

Fixes: f8dbdf81821b ("fuse: rework fuse_readpages()")
Signed-off-by: Kirill Tkhai &lt;ktkhai@virtuozzo.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 109728ccc5933151c68d1106e4065478a487a323 upstream.

The above error path returns with page unlocked, so this place seems also
to behave the same.

Fixes: f8dbdf81821b ("fuse: rework fuse_readpages()")
Signed-off-by: Kirill Tkhai &lt;ktkhai@virtuozzo.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: Fix oops at process_init_reply()</title>
<updated>2018-09-05T07:18:39+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2018-07-26T14:13:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c93ce9b00b9aa4bae06b758223ff62ca799522c6'/>
<id>c93ce9b00b9aa4bae06b758223ff62ca799522c6</id>
<content type='text'>
commit e8f3bd773d22f488724dffb886a1618da85c2966 upstream.

syzbot is hitting NULL pointer dereference at process_init_reply().
This is because deactivate_locked_super() is called before response for
initial request is processed.

Fix this by aborting and waiting for all requests (including FUSE_INIT)
before resetting fc-&gt;sb.

Original patch by Tetsuo Handa &lt;penguin-kernel@I-love.SKAURA.ne.jp&gt;.

Reported-by: syzbot &lt;syzbot+b62f08f4d5857755e3bc@syzkaller.appspotmail.com&gt;
Fixes: e27c9d3877a0 ("fuse: fuse: add time_gran to INIT_OUT")
Cc: &lt;stable@vger.kernel.org&gt; # v3.19
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit e8f3bd773d22f488724dffb886a1618da85c2966 upstream.

syzbot is hitting NULL pointer dereference at process_init_reply().
This is because deactivate_locked_super() is called before response for
initial request is processed.

Fix this by aborting and waiting for all requests (including FUSE_INIT)
before resetting fc-&gt;sb.

Original patch by Tetsuo Handa &lt;penguin-kernel@I-love.SKAURA.ne.jp&gt;.

Reported-by: syzbot &lt;syzbot+b62f08f4d5857755e3bc@syzkaller.appspotmail.com&gt;
Fixes: e27c9d3877a0 ("fuse: fuse: add time_gran to INIT_OUT")
Cc: &lt;stable@vger.kernel.org&gt; # v3.19
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: umount should wait for all requests</title>
<updated>2018-09-05T07:18:39+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2018-07-26T14:13:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4d6ef17a060cb227007a7dec6aa886abc4c01297'/>
<id>4d6ef17a060cb227007a7dec6aa886abc4c01297</id>
<content type='text'>
commit b8f95e5d13f5f0191dcb4b9113113d241636e7cb upstream.

fuse_abort_conn() does not guarantee that all async requests have actually
finished aborting (i.e. their -&gt;end() function is called).  This could
actually result in still used inodes after umount.

Add a helper to wait until all requests are fully done.  This is done by
looking at the "num_waiting" counter.  When this counter drops to zero, we
can be sure that no more requests are outstanding.

Fixes: 0d8e84b0432b ("fuse: simplify request abort")
Cc: &lt;stable@vger.kernel.org&gt; # v4.2
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b8f95e5d13f5f0191dcb4b9113113d241636e7cb upstream.

fuse_abort_conn() does not guarantee that all async requests have actually
finished aborting (i.e. their -&gt;end() function is called).  This could
actually result in still used inodes after umount.

Add a helper to wait until all requests are fully done.  This is done by
looking at the "num_waiting" counter.  When this counter drops to zero, we
can be sure that no more requests are outstanding.

Fixes: 0d8e84b0432b ("fuse: simplify request abort")
Cc: &lt;stable@vger.kernel.org&gt; # v4.2
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>fuse: fix unlocked access to processing queue</title>
<updated>2018-09-05T07:18:39+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@redhat.com</email>
</author>
<published>2018-07-26T14:13:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4ded21c9ea1cf8687e33ebe0577f6b4353f5d8c6'/>
<id>4ded21c9ea1cf8687e33ebe0577f6b4353f5d8c6</id>
<content type='text'>
commit 45ff350bbd9d0f0977ff270a0d427c71520c0c37 upstream.

fuse_dev_release() assumes that it's the only one referencing the
fpq-&gt;processing list, but that's not true, since fuse_abort_conn() can be
doing the same without any serialization between the two.

Fixes: c3696046beb3 ("fuse: separate pqueue for clones")
Cc: &lt;stable@vger.kernel.org&gt; # v4.2
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 45ff350bbd9d0f0977ff270a0d427c71520c0c37 upstream.

fuse_dev_release() assumes that it's the only one referencing the
fpq-&gt;processing list, but that's not true, since fuse_abort_conn() can be
doing the same without any serialization between the two.

Fixes: c3696046beb3 ("fuse: separate pqueue for clones")
Cc: &lt;stable@vger.kernel.org&gt; # v4.2
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

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