<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/fs, branch v5.1.14</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.1.14</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.1.14'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2019-06-22T06:09:15Z</updated>
<entry>
<title>ocfs2: fix error path kobject memory leak</title>
<updated>2019-06-22T06:09:15Z</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=bb1313f8e3e009b327cb1a289c517a6291d44ca3'/>
<id>urn:sha1:bb1313f8e3e009b327cb1a289c517a6291d44ca3</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>dfs_cache: fix a wrong use of kfree in flush_cache_ent()</title>
<updated>2019-06-22T06:09:12Z</updated>
<author>
<name>Gen Zhang</name>
<email>blackgod016574@gmail.com</email>
</author>
<published>2019-05-28T01:12:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=560e20f2307aeac798fb52145199a36d751d3d8b'/>
<id>urn:sha1:560e20f2307aeac798fb52145199a36d751d3d8b</id>
<content type='text'>
[ Upstream commit 50fbc13dc12666f3604dc2555a47fc8c4e29162b ]

In flush_cache_ent(), 'ce-&gt;ce_path' is allocated by kstrdup_const().
It should be freed by kfree_const(), rather than kfree().

Signed-off-by: Gen Zhang &lt;blackgod016574@gmail.com&gt;
Reviewed-by: Paulo Alcantara &lt;palcantara@suse.de&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&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:09:11Z</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=3f81d5ff634022c14b9f359f14698adeb1226a7a'/>
<id>urn:sha1:3f81d5ff634022c14b9f359f14698adeb1226a7a</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>io_uring: Fix __io_uring_register() false success</title>
<updated>2019-06-22T06:09:10Z</updated>
<author>
<name>Pavel Begunkov</name>
<email>asml.silence@gmail.com</email>
</author>
<published>2019-05-26T09:35:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fd670f49dd3054679d35f7da5ec9f31619f16dd0'/>
<id>urn:sha1:fd670f49dd3054679d35f7da5ec9f31619f16dd0</id>
<content type='text'>
[ Upstream commit a278682dad37fd2f8d2f30d8e84e376a856ab472 ]

If io_copy_iov() fails, it will break the loop and report success,
albeit partially completed operation.

Signed-off-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&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:00:06Z</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=980628e34fef39f05eee1c3a1d575bf181abfdf6'/>
<id>urn:sha1:980628e34fef39f05eee1c3a1d575bf181abfdf6</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:00:02Z</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=0ef80f61670794ca712e7772ddb61df5764dbf7e'/>
<id>urn:sha1:0ef80f61670794ca712e7772ddb61df5764dbf7e</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>io_uring: fix memory leak of UNIX domain socket inode</title>
<updated>2019-06-19T06:00:02Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2019-06-12T21:58:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3d61202e8a4c021af12a564d8ed42d08ff03ac14'/>
<id>urn:sha1:3d61202e8a4c021af12a564d8ed42d08ff03ac14</id>
<content type='text'>
commit 355e8d26f719c207aa2e00e6f3cfab3acf21769b upstream.

Opening and closing an io_uring instance leaks a UNIX domain socket
inode.  This is because the -&gt;file of the io_uring instance's internal
UNIX domain socket is set to point to the io_uring file, but then
sock_release() sees the non-NULL -&gt;file and assumes the inode reference
is held by the file so doesn't call iput().  That's not the case here,
since the reference is still meant to be held by the socket; the actual
inode of the io_uring file is different.

Fix this leak by NULL-ing out -&gt;file before releasing the socket.

Reported-by: syzbot+111cb28d9f583693aefa@syzkaller.appspotmail.com
Fixes: 2b188cc1bb85 ("Add io_uring IO interface")
Cc: &lt;stable@vger.kernel.org&gt; # v5.1+
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>io_uring: fix failure to verify SQ_AFF cpu</title>
<updated>2019-06-15T09:53:06Z</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@kernel.dk</email>
</author>
<published>2019-05-15T02:00:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cf1fa8c91fbd1111782bac82cdd01b6330bfbbca'/>
<id>urn:sha1:cf1fa8c91fbd1111782bac82cdd01b6330bfbbca</id>
<content type='text'>
commit 44a9bd18a0f06bba19d155aeaa11e2edce898293 upstream.

The test case we have is rightfully failing with the current kernel:

io_uring_setup(1, 0x7ffe2cafebe0), flags: IORING_SETUP_SQPOLL|IORING_SETUP_SQ_AFF, resv: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000, sq_thread_cpu: 4
expected -1, got 3

This is in a vm, and CPU3 is the last valid one, hence asking for 4
should fail the setup with -EINVAL, not succeed. The problem is that
we're using array_index_nospec() with nr_cpu_ids as the index, hence we
wrap and end up using CPU0 instead of CPU4. This makes the setup
succeed where it should be failing.

We don't need to use array_index_nospec() as we're not indexing any
array with this. Instead just compare with nr_cpu_ids directly. This
is fine as we're checking with cpu_online() afterwards.

Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&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:53:06Z</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=f40c32fdfbf7c0ae98404b5b7203d2fc6bc9ad78'/>
<id>urn:sha1:f40c32fdfbf7c0ae98404b5b7203d2fc6bc9ad78</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:53:06Z</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=289e5e057bfe69008dcd5d8ee1a03a6e48529eed'/>
<id>urn:sha1:289e5e057bfe69008dcd5d8ee1a03a6e48529eed</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>
</feed>
