<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/fuse/inode.c, branch linux-4.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-04-13T10:50:05Z</updated>
<entry>
<title>fuse: don't unhash root</title>
<updated>2024-04-13T10:50:05Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2024-02-28T15:50:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0f8957f5077b29cda838be2f75ef6cd2668e6df4'/>
<id>urn:sha1:0f8957f5077b29cda838be2f75ef6cd2668e6df4</id>
<content type='text'>
[ Upstream commit b1fe686a765e6c0d71811d825b5a1585a202b777 ]

The root inode is assumed to be always hashed.  Do not unhash the root
inode even if it is marked BAD.

Fixes: 5d069dbe8aaf ("fuse: fix bad inode")
Cc: &lt;stable@vger.kernel.org&gt; # v5.11
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fuse: limit nsec</title>
<updated>2022-08-25T09:14:55Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2022-07-21T14:06:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0bff2d2383d781aaf2683c014a87b3586228ff32'/>
<id>urn:sha1:0bff2d2383d781aaf2683c014a87b3586228ff32</id>
<content type='text'>
commit 47912eaa061a6a81e4aa790591a1874c650733c0 upstream.

Limit nanoseconds to 0..999999999.

Fixes: d8a5ba45457e ("[PATCH] FUSE - core")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fuse: fix bad inode</title>
<updated>2022-01-27T08:04:34Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2022-01-24T15:17:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1e1bb4933f1faafc68db8e0ecd5838a65dd1aae9'/>
<id>urn:sha1:1e1bb4933f1faafc68db8e0ecd5838a65dd1aae9</id>
<content type='text'>
commit 5d069dbe8aaf2a197142558b6fb2978189ba3454 upstream.

Jan Kara's analysis of the syzbot report (edited):

  The reproducer opens a directory on FUSE filesystem, it then attaches
  dnotify mark to the open directory.  After that a fuse_do_getattr() call
  finds that attributes returned by the server are inconsistent, and calls
  make_bad_inode() which, among other things does:

          inode-&gt;i_mode = S_IFREG;

  This then confuses dnotify which doesn't tear down its structures
  properly and eventually crashes.

Avoid calling make_bad_inode() on a live inode: switch to a private flag on
the fuse inode.  Also add the test to ops which the bad_inode_ops would
have caught.

This bug goes back to the initial merge of fuse in 2.6.14...

Reported-by: syzbot+f427adf9324b92652ccc@syzkaller.appspotmail.com
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Tested-by: Jan Kara &lt;jack@suse.cz&gt;
Cc: &lt;stable@vger.kernel.org&gt;
[bwh: Backported to 4.19:
 - Drop changes in fuse_dir_fsync(), fuse_readahead(), fuse_evict_inode()
 - In fuse_get_link(), return ERR_PTR(-EIO) for bad inodes
 - Convert some additional calls to is_bad_inode()
 - Adjust filename, context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fuse: fix deadlock with aio poll and fuse_iqueue::waitq.lock</title>
<updated>2019-10-05T11:10:13Z</updated>
<author>
<name>Eric Biggers</name>
</author>
<published>2019-09-09T03:15:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5bead06b3443c784637d454c5c64a3bd05752cf4'/>
<id>urn:sha1:5bead06b3443c784637d454c5c64a3bd05752cf4</id>
<content type='text'>
[ Upstream commit 76e43c8ccaa35c30d5df853013561145a0f750a5 ]

When IOCB_CMD_POLL is used on the FUSE device, aio_poll() disables IRQs
and takes kioctx::ctx_lock, then fuse_iqueue::waitq.lock.

This may have to wait for fuse_iqueue::waitq.lock to be released by one
of many places that take it with IRQs enabled.  Since the IRQ handler
may take kioctx::ctx_lock, lockdep reports that a deadlock is possible.

Fix it by protecting the state of struct fuse_iqueue with a separate
spinlock, and only accessing fuse_iqueue::waitq using the versions of
the waitqueue functions which do IRQ-safe locking internally.

Reproducer:

	#include &lt;fcntl.h&gt;
	#include &lt;stdio.h&gt;
	#include &lt;sys/mount.h&gt;
	#include &lt;sys/stat.h&gt;
	#include &lt;sys/syscall.h&gt;
	#include &lt;unistd.h&gt;
	#include &lt;linux/aio_abi.h&gt;

	int main()
	{
		char opts[128];
		int fd = open("/dev/fuse", O_RDWR);
		aio_context_t ctx = 0;
		struct iocb cb = { .aio_lio_opcode = IOCB_CMD_POLL, .aio_fildes = fd };
		struct iocb *cbp = &amp;cb;

		sprintf(opts, "fd=%d,rootmode=040000,user_id=0,group_id=0", fd);
		mkdir("mnt", 0700);
		mount("foo",  "mnt", "fuse", 0, opts);
		syscall(__NR_io_setup, 1, &amp;ctx);
		syscall(__NR_io_submit, ctx, 1, &amp;cbp);
	}

Beginning of lockdep output:

	=====================================================
	WARNING: SOFTIRQ-safe -&gt; SOFTIRQ-unsafe lock order detected
	5.3.0-rc5 #9 Not tainted
	-----------------------------------------------------
	syz_fuse/135 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
	000000003590ceda (&amp;fiq-&gt;waitq){+.+.}, at: spin_lock include/linux/spinlock.h:338 [inline]
	000000003590ceda (&amp;fiq-&gt;waitq){+.+.}, at: aio_poll fs/aio.c:1751 [inline]
	000000003590ceda (&amp;fiq-&gt;waitq){+.+.}, at: __io_submit_one.constprop.0+0x203/0x5b0 fs/aio.c:1825

	and this task is already holding:
	0000000075037284 (&amp;(&amp;ctx-&gt;ctx_lock)-&gt;rlock){..-.}, at: spin_lock_irq include/linux/spinlock.h:363 [inline]
	0000000075037284 (&amp;(&amp;ctx-&gt;ctx_lock)-&gt;rlock){..-.}, at: aio_poll fs/aio.c:1749 [inline]
	0000000075037284 (&amp;(&amp;ctx-&gt;ctx_lock)-&gt;rlock){..-.}, at: __io_submit_one.constprop.0+0x1f4/0x5b0 fs/aio.c:1825
	which would create a new lock dependency:
	 (&amp;(&amp;ctx-&gt;ctx_lock)-&gt;rlock){..-.} -&gt; (&amp;fiq-&gt;waitq){+.+.}

	but this new dependency connects a SOFTIRQ-irq-safe lock:
	 (&amp;(&amp;ctx-&gt;ctx_lock)-&gt;rlock){..-.}

	[...]

Reported-by: syzbot+af05535bb79520f95431@syzkaller.appspotmail.com
Reported-by: syzbot+d86c4426a01f60feddc7@syzkaller.appspotmail.com
Fixes: bfe4037e722e ("aio: implement IOCB_CMD_POLL")
Cc: &lt;stable@vger.kernel.org&gt; # v4.19+
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>fuse: convert last timespec use to timespec64</title>
<updated>2018-07-26T14:13:12Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2018-07-13T14:35:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a64ba10f65bfe2bead4693ef7fda9f7978dfa162'/>
<id>urn:sha1:a64ba10f65bfe2bead4693ef7fda9f7978dfa162</id>
<content type='text'>
All of fuse uses 64-bit timestamps with the exception of the
fuse_change_attributes(), so let's convert this one as well.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>fuse: fix initial parallel dirops</title>
<updated>2018-07-26T14:13:11Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2018-07-26T14:13:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=63576c13bd17848376c8ba4a98f5d5151140c4ac'/>
<id>urn:sha1:63576c13bd17848376c8ba4a98f5d5151140c4ac</id>
<content type='text'>
If parallel dirops are enabled in FUSE_INIT reply, then first operation may
leave fi-&gt;mutex held.

Reported-by: syzbot &lt;syzbot+3f7b29af1baa9d0a55be@syzkaller.appspotmail.com&gt;
Fixes: 5c672ab3f0ee ("fuse: serialize dirops by default")
Cc: &lt;stable@vger.kernel.org&gt; # v4.7
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>fuse: Fix oops at process_init_reply()</title>
<updated>2018-07-26T14:13:11Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2018-07-26T14:13:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e8f3bd773d22f488724dffb886a1618da85c2966'/>
<id>urn:sha1:e8f3bd773d22f488724dffb886a1618da85c2966</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>fuse: umount should wait for all requests</title>
<updated>2018-07-26T14:13:11Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2018-07-26T14:13:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b8f95e5d13f5f0191dcb4b9113113d241636e7cb'/>
<id>urn:sha1:b8f95e5d13f5f0191dcb4b9113113d241636e7cb</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>Merge tag 'vfs-timespec64' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground</title>
<updated>2018-06-14T22:31:07Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2018-06-14T22:31:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7a932516f55cdf430c7cce78df2010ff7db6b874'/>
<id>urn:sha1:7a932516f55cdf430c7cce78df2010ff7db6b874</id>
<content type='text'>
Pull inode timestamps conversion to timespec64 from Arnd Bergmann:
 "This is a late set of changes from Deepa Dinamani doing an automated
  treewide conversion of the inode and iattr structures from 'timespec'
  to 'timespec64', to push the conversion from the VFS layer into the
  individual file systems.

  As Deepa writes:

   'The series aims to switch vfs timestamps to use struct timespec64.
    Currently vfs uses struct timespec, which is not y2038 safe.

    The series involves the following:
    1. Add vfs helper functions for supporting struct timepec64
       timestamps.
    2. Cast prints of vfs timestamps to avoid warnings after the switch.
    3. Simplify code using vfs timestamps so that the actual replacement
       becomes easy.
    4. Convert vfs timestamps to use struct timespec64 using a script.
       This is a flag day patch.

    Next steps:
    1. Convert APIs that can handle timespec64, instead of converting
       timestamps at the boundaries.
    2. Update internal data structures to avoid timestamp conversions'

  Thomas Gleixner adds:

   'I think there is no point to drag that out for the next merge
    window. The whole thing needs to be done in one go for the core
    changes which means that you're going to play that catchup game
    forever. Let's get over with it towards the end of the merge window'"

* tag 'vfs-timespec64' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground:
  pstore: Remove bogus format string definition
  vfs: change inode times to use struct timespec64
  pstore: Convert internal records to timespec64
  udf: Simplify calls to udf_disk_stamp_to_time
  fs: nfs: get rid of memcpys for inode times
  ceph: make inode time prints to be long long
  lustre: Use long long type to print inode time
  fs: add timespec64_truncate()
</content>
</entry>
<entry>
<title>Merge tag 'fuse-update-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse</title>
<updated>2018-06-07T15:50:57Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2018-06-07T15:50:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=da315f6e03988a7127680bbc26e1028991b899b8'/>
<id>urn:sha1:da315f6e03988a7127680bbc26e1028991b899b8</id>
<content type='text'>
Pull fuse updates from Miklos Szeredi:
 "The most interesting part of this update is user namespace support,
  mostly done by Eric Biederman. This enables safe unprivileged fuse
  mounts within a user namespace.

  There are also a couple of fixes for bugs found by syzbot and
  miscellaneous fixes and cleanups"

* tag 'fuse-update-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
  fuse: don't keep dead fuse_conn at fuse_fill_super().
  fuse: fix control dir setup and teardown
  fuse: fix congested state leak on aborted connections
  fuse: Allow fully unprivileged mounts
  fuse: Ensure posix acls are translated outside of init_user_ns
  fuse: add writeback documentation
  fuse: honor AT_STATX_FORCE_SYNC
  fuse: honor AT_STATX_DONT_SYNC
  fuse: Restrict allow_other to the superblock's namespace or a descendant
  fuse: Support fuse filesystems outside of init_user_ns
  fuse: Fail all requests with invalid uids or gids
  fuse: Remove the buggy retranslation of pids in fuse_dev_do_read
  fuse: return -ECONNABORTED on /dev/fuse read after abort
  fuse: atomic_o_trunc should truncate pagecache
</content>
</entry>
</feed>
