<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/fs, branch v4.19.54</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.19.54</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.19.54'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2019-06-22T06:15:21Z</updated>
<entry>
<title>Abort file_remove_privs() for non-reg. files</title>
<updated>2019-06-22T06:15:21Z</updated>
<author>
<name>Alexander Lochmann</name>
<email>alexander.lochmann@tu-dortmund.de</email>
</author>
<published>2018-12-14T10:55:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e8e448b08450b05d54cf99eb4e3473b708c8fcc0'/>
<id>urn:sha1:e8e448b08450b05d54cf99eb4e3473b708c8fcc0</id>
<content type='text'>
commit f69e749a49353d96af1a293f56b5b56de59c668a upstream.

file_remove_privs() might be called for non-regular files, e.g.
blkdev inode. There is no reason to do its job on things
like blkdev inodes, pipes, or cdevs. Hence, abort if
file does not refer to a regular inode.

AV: more to the point, for devices there might be any number of
inodes refering to given device.  Which one to strip the permissions
from, even if that made any sense in the first place?  All of them
will be observed with contents modified, after all.

Found by LockDoc (Alexander Lochmann, Horst Schirmeier and Olaf
Spinczyk)

Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Alexander Lochmann &lt;alexander.lochmann@tu-dortmund.de&gt;
Signed-off-by: Horst Schirmeier &lt;horst.schirmeier@tu-dortmund.de&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Zubin Mithra &lt;zsm@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ocfs2: fix error path kobject memory leak</title>
<updated>2019-06-22T06:15:21Z</updated>
<author>
<name>Tobin C. Harding</name>
<email>tobin@kernel.org</email>
</author>
<published>2019-06-01T05:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c7fb6b75def2c2a4bf2902006099ae586fcdb234'/>
<id>urn:sha1:c7fb6b75def2c2a4bf2902006099ae586fcdb234</id>
<content type='text'>
[ Upstream commit b9fba67b3806e21b98bd5a98dc3921a8e9b42d61 ]

If a call to kobject_init_and_add() fails we should call kobject_put()
otherwise we leak memory.

Add call to kobject_put() in the error path of call to
kobject_init_and_add().  Please note, this has the side effect that the
release method is called if kobject_init_and_add() fails.

Link: http://lkml.kernel.org/r/20190513033458.2824-1-tobin@kernel.org
Signed-off-by: Tobin C. Harding &lt;tobin@kernel.org&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Joseph Qi &lt;joseph.qi@linux.alibaba.com&gt;
Cc: Mark Fasheh &lt;mark@fasheh.com&gt;
Cc: Joel Becker &lt;jlbec@evilplan.org&gt;
Cc: Junxiao Bi &lt;junxiao.bi@oracle.com&gt;
Cc: Changwei Ge &lt;gechangwei@live.cn&gt;
Cc: Gang He &lt;ghe@suse.com&gt;
Cc: Jun Piao &lt;piaojun@huawei.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>configfs: Fix use-after-free when accessing sd-&gt;s_dentry</title>
<updated>2019-06-22T06:15:17Z</updated>
<author>
<name>Sahitya Tummala</name>
<email>stummala@codeaurora.org</email>
</author>
<published>2019-01-03T11:18:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e9fcebe018226e0dc2af391ec291f1701d9b2ff1'/>
<id>urn:sha1:e9fcebe018226e0dc2af391ec291f1701d9b2ff1</id>
<content type='text'>
[ Upstream commit f6122ed2a4f9c9c1c073ddf6308d1b2ac10e0781 ]

In the vfs_statx() context, during path lookup, the dentry gets
added to sd-&gt;s_dentry via configfs_attach_attr(). In the end,
vfs_statx() kills the dentry by calling path_put(), which invokes
configfs_d_iput(). Ideally, this dentry must be removed from
sd-&gt;s_dentry but it doesn't if the sd-&gt;s_count &gt;= 3. As a result,
sd-&gt;s_dentry is holding reference to a stale dentry pointer whose
memory is already freed up. This results in use-after-free issue,
when this stale sd-&gt;s_dentry is accessed later in
configfs_readdir() path.

This issue can be easily reproduced, by running the LTP test case -
sh fs_racer_file_list.sh /config
(https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/fs/racer/fs_racer_file_list.sh)

Fixes: 76ae281f6307 ('configfs: fix race between dentry put and lookup')
Signed-off-by: Sahitya Tummala &lt;stummala@codeaurora.org&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: fix to avoid accessing xattr across the boundary</title>
<updated>2019-06-19T06:18:02Z</updated>
<author>
<name>Randall Huang</name>
<email>huangrandall@google.com</email>
</author>
<published>2019-04-11T08:26:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ae3787d433f7b87ebf6b916e524c6e280e4e5804'/>
<id>urn:sha1:ae3787d433f7b87ebf6b916e524c6e280e4e5804</id>
<content type='text'>
[ Upstream commit 2777e654371dd4207a3a7f4fb5fa39550053a080 ]

When we traverse xattr entries via __find_xattr(),
if the raw filesystem content is faked or any hardware failure occurs,
out-of-bound error can be detected by KASAN.
Fix the issue by introducing boundary check.

[   38.402878] c7   1827 BUG: KASAN: slab-out-of-bounds in f2fs_getxattr+0x518/0x68c
[   38.402891] c7   1827 Read of size 4 at addr ffffffc0b6fb35dc by task
[   38.402935] c7   1827 Call trace:
[   38.402952] c7   1827 [&lt;ffffff900809003c&gt;] dump_backtrace+0x0/0x6bc
[   38.402966] c7   1827 [&lt;ffffff9008090030&gt;] show_stack+0x20/0x2c
[   38.402981] c7   1827 [&lt;ffffff900871ab10&gt;] dump_stack+0xfc/0x140
[   38.402995] c7   1827 [&lt;ffffff9008325c40&gt;] print_address_description+0x80/0x2d8
[   38.403009] c7   1827 [&lt;ffffff900832629c&gt;] kasan_report_error+0x198/0x1fc
[   38.403022] c7   1827 [&lt;ffffff9008326104&gt;] kasan_report_error+0x0/0x1fc
[   38.403037] c7   1827 [&lt;ffffff9008325000&gt;] __asan_load4+0x1b0/0x1b8
[   38.403051] c7   1827 [&lt;ffffff90085fcc44&gt;] f2fs_getxattr+0x518/0x68c
[   38.403066] c7   1827 [&lt;ffffff90085fc508&gt;] f2fs_xattr_generic_get+0xb0/0xd0
[   38.403080] c7   1827 [&lt;ffffff9008395708&gt;] __vfs_getxattr+0x1f4/0x1fc
[   38.403096] c7   1827 [&lt;ffffff9008621bd0&gt;] inode_doinit_with_dentry+0x360/0x938
[   38.403109] c7   1827 [&lt;ffffff900862d6cc&gt;] selinux_d_instantiate+0x2c/0x38
[   38.403123] c7   1827 [&lt;ffffff900861b018&gt;] security_d_instantiate+0x68/0x98
[   38.403136] c7   1827 [&lt;ffffff9008377db8&gt;] d_splice_alias+0x58/0x348
[   38.403149] c7   1827 [&lt;ffffff900858d16c&gt;] f2fs_lookup+0x608/0x774
[   38.403163] c7   1827 [&lt;ffffff900835eacc&gt;] lookup_slow+0x1e0/0x2cc
[   38.403177] c7   1827 [&lt;ffffff9008367fe0&gt;] walk_component+0x160/0x520
[   38.403190] c7   1827 [&lt;ffffff9008369ef4&gt;] path_lookupat+0x110/0x2b4
[   38.403203] c7   1827 [&lt;ffffff900835dd38&gt;] filename_lookup+0x1d8/0x3a8
[   38.403216] c7   1827 [&lt;ffffff900835eeb0&gt;] user_path_at_empty+0x54/0x68
[   38.403229] c7   1827 [&lt;ffffff9008395f44&gt;] SyS_getxattr+0xb4/0x18c
[   38.403241] c7   1827 [&lt;ffffff9008084200&gt;] el0_svc_naked+0x34/0x38

Signed-off-by: Randall Huang &lt;huangrandall@google.com&gt;
[Jaegeuk Kim: Fix wrong ending boundary]
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs/ocfs2: fix race in ocfs2_dentry_attach_lock()</title>
<updated>2019-06-19T06:18:00Z</updated>
<author>
<name>Wengang Wang</name>
<email>wen.gang.wang@oracle.com</email>
</author>
<published>2019-06-13T22:56:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6b9aa7ac48d729c545d17e062cab2c35bf2e9bc8'/>
<id>urn:sha1:6b9aa7ac48d729c545d17e062cab2c35bf2e9bc8</id>
<content type='text'>
commit be99ca2716972a712cde46092c54dee5e6192bf8 upstream.

ocfs2_dentry_attach_lock() can be executed in parallel threads against the
same dentry.  Make that race safe.  The race is like this:

            thread A                               thread B

(A1) enter ocfs2_dentry_attach_lock,
seeing dentry-&gt;d_fsdata is NULL,
and no alias found by
ocfs2_find_local_alias, so kmalloc
a new ocfs2_dentry_lock structure
to local variable "dl", dl1

               .....

                                    (B1) enter ocfs2_dentry_attach_lock,
                                    seeing dentry-&gt;d_fsdata is NULL,
                                    and no alias found by
                                    ocfs2_find_local_alias so kmalloc
                                    a new ocfs2_dentry_lock structure
                                    to local variable "dl", dl2.

                                                   ......

(A2) set dentry-&gt;d_fsdata with dl1,
call ocfs2_dentry_lock() and increase
dl1-&gt;dl_lockres.l_ro_holders to 1 on
success.
              ......

                                    (B2) set dentry-&gt;d_fsdata with dl2
                                    call ocfs2_dentry_lock() and increase
				    dl2-&gt;dl_lockres.l_ro_holders to 1 on
				    success.

                                                  ......

(A3) call ocfs2_dentry_unlock()
and decrease
dl2-&gt;dl_lockres.l_ro_holders to 0
on success.
             ....

                                    (B3) call ocfs2_dentry_unlock(),
                                    decreasing
				    dl2-&gt;dl_lockres.l_ro_holders, but
				    see it's zero now, panic

Link: http://lkml.kernel.org/r/20190529174636.22364-1-wen.gang.wang@oracle.com
Signed-off-by: Wengang Wang &lt;wen.gang.wang@oracle.com&gt;
Reported-by: Daniel Sobe &lt;daniel.sobe@nxp.com&gt;
Tested-by: Daniel Sobe &lt;daniel.sobe@nxp.com&gt;
Reviewed-by: Changwei Ge &lt;gechangwei@live.cn&gt;
Reviewed-by: Joseph Qi &lt;joseph.qi@linux.alibaba.com&gt;
Cc: Mark Fasheh &lt;mark@fasheh.com&gt;
Cc: Joel Becker &lt;jlbec@evilplan.org&gt;
Cc: Junxiao Bi &lt;junxiao.bi@oracle.com&gt;
Cc: Gang He &lt;ghe@suse.com&gt;
Cc: Jun Piao &lt;piaojun@huawei.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ovl: support stacked SEEK_HOLE/SEEK_DATA</title>
<updated>2019-06-15T09:54:11Z</updated>
<author>
<name>Amir Goldstein</name>
<email>amir73il@gmail.com</email>
</author>
<published>2019-02-27T11:32:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=afec706807cd326ab2a5e4d08162cda98eb495a0'/>
<id>urn:sha1:afec706807cd326ab2a5e4d08162cda98eb495a0</id>
<content type='text'>
commit 9e46b840c7053b5f7a245e98cd239b60d189a96c upstream.

Overlay file f_pos is the master copy that is preserved
through copy up and modified on read/write, but only real
fs knows how to SEEK_HOLE/SEEK_DATA and real fs may impose
limitations that are more strict than -&gt;s_maxbytes for specific
files, so we use the real file to perform seeks.

We do not call real fs for SEEK_CUR:0 query and for SEEK_SET:0
requests.

Fixes: d1d04ef8572b ("ovl: stack file ops")
Reported-by: Eddie Horng &lt;eddiehorng.tw@gmail.com&gt;
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&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>ovl: check the capability before cred overridden</title>
<updated>2019-06-15T09:54:11Z</updated>
<author>
<name>Jiufei Xue</name>
<email>jiufei.xue@linux.alibaba.com</email>
</author>
<published>2019-05-06T07:41:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=22dac6cc9549fec8ceb82ec1cc6da24a9f5a6705'/>
<id>urn:sha1:22dac6cc9549fec8ceb82ec1cc6da24a9f5a6705</id>
<content type='text'>
commit 98487de318a6f33312471ae1e2afa16fbf8361fe upstream.

We found that it return success when we set IMMUTABLE_FL flag to a file in
docker even though the docker didn't have the capability
CAP_LINUX_IMMUTABLE.

The commit d1d04ef8572b ("ovl: stack file ops") and dab5ca8fd9dd ("ovl: add
lsattr/chattr support") implemented chattr operations on a regular overlay
file. ovl_real_ioctl() overridden the current process's subjective
credentials with ofs-&gt;creator_cred which have the capability
CAP_LINUX_IMMUTABLE so that it will return success in
vfs_ioctl()-&gt;cap_capable().

Fix this by checking the capability before cred overridden. And here we
only care about APPEND_FL and IMMUTABLE_FL, so get these information from
inode.

[SzM: move check and call to underlying fs inside inode locked region to
prevent two such calls from racing with each other]

Signed-off-by: Jiufei Xue &lt;jiufei.xue@linux.alibaba.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Cc: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>nfsd: avoid uninitialized variable warning</title>
<updated>2019-06-15T09:54:07Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2019-03-22T14:07:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=806e83958482b7f197e20fe965a05281998bd1fd'/>
<id>urn:sha1:806e83958482b7f197e20fe965a05281998bd1fd</id>
<content type='text'>
[ Upstream commit 0ab88ca4bcf18ba21058d8f19220f60afe0d34d8 ]

clang warns that 'contextlen' may be accessed without an initialization:

fs/nfsd/nfs4xdr.c:2911:9: error: variable 'contextlen' is uninitialized when used here [-Werror,-Wuninitialized]
                                                                contextlen);
                                                                ^~~~~~~~~~
fs/nfsd/nfs4xdr.c:2424:16: note: initialize the variable 'contextlen' to silence this warning
        int contextlen;
                      ^
                       = 0

Presumably this cannot happen, as FATTR4_WORD2_SECURITY_LABEL is
set if CONFIG_NFSD_V4_SECURITY_LABEL is enabled.
Adding another #ifdef like the other two in this function
avoids the warning.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nfsd: allow fh_want_write to be called twice</title>
<updated>2019-06-15T09:54:07Z</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@redhat.com</email>
</author>
<published>2019-04-12T20:37:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b4330e4a7c129106070e244424f7fcfe30f80c0c'/>
<id>urn:sha1:b4330e4a7c129106070e244424f7fcfe30f80c0c</id>
<content type='text'>
[ Upstream commit 0b8f62625dc309651d0efcb6a6247c933acd8b45 ]

A fuzzer recently triggered lockdep warnings about potential sb_writers
deadlocks caused by fh_want_write().

Looks like we aren't careful to pair each fh_want_write() with an
fh_drop_write().

It's not normally a problem since fh_put() will call fh_drop_write() for
us.  And was OK for NFSv3 where we'd do one operation that might call
fh_want_write(), and then put the filehandle.

But an NFSv4 protocol fuzzer can do weird things like call unlink twice
in a compound, and then we get into trouble.

I'm a little worried about this approach of just leaving everything to
fh_put().  But I think there are probably a lot of
fh_want_write()/fh_drop_write() imbalances so for now I think we need it
to be more forgiving.

Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fuse: retrieve: cap requested size to negotiated max_write</title>
<updated>2019-06-15T09:54:07Z</updated>
<author>
<name>Kirill Smelkov</name>
<email>kirr@nexedi.com</email>
</author>
<published>2019-03-27T10:15:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ae35c325d8fda01844dc5ec64bcc1a9c9208e155'/>
<id>urn:sha1:ae35c325d8fda01844dc5ec64bcc1a9c9208e155</id>
<content type='text'>
[ Upstream commit 7640682e67b33cab8628729afec8ca92b851394f ]

FUSE filesystem server and kernel client negotiate during initialization
phase, what should be the maximum write size the client will ever issue.
Correspondingly the filesystem server then queues sys_read calls to read
requests with buffer capacity large enough to carry request header + that
max_write bytes. A filesystem server is free to set its max_write in
anywhere in the range between [1*page, fc-&gt;max_pages*page]. In particular
go-fuse[2] sets max_write by default as 64K, wheres default fc-&gt;max_pages
corresponds to 128K. Libfuse also allows users to configure max_write, but
by default presets it to possible maximum.

If max_write is &lt; fc-&gt;max_pages*page, and in NOTIFY_RETRIEVE handler we
allow to retrieve more than max_write bytes, corresponding prepared
NOTIFY_REPLY will be thrown away by fuse_dev_do_read, because the
filesystem server, in full correspondence with server/client contract, will
be only queuing sys_read with ~max_write buffer capacity, and
fuse_dev_do_read throws away requests that cannot fit into server request
buffer. In turn the filesystem server could get stuck waiting indefinitely
for NOTIFY_REPLY since NOTIFY_RETRIEVE handler returned OK which is
understood by clients as that NOTIFY_REPLY was queued and will be sent
back.

Cap requested size to negotiate max_write to avoid the problem.  This
aligns with the way NOTIFY_RETRIEVE handler works, which already
unconditionally caps requested retrieve size to fuse_conn-&gt;max_pages.  This
way it should not hurt NOTIFY_RETRIEVE semantic if we return less data than
was originally requested.

Please see [1] for context where the problem of stuck filesystem was hit
for real, how the situation was traced and for more involving patch that
did not make it into the tree.

[1] https://marc.info/?l=linux-fsdevel&amp;m=155057023600853&amp;w=2
[2] https://github.com/hanwen/go-fuse

Signed-off-by: Kirill Smelkov &lt;kirr@nexedi.com&gt;
Cc: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Cc: Jakob Unterwurzacher &lt;jakobunt@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
