<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/staging, branch linux-4.20.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.20.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.20.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2019-03-13T21:04:20+00:00</updated>
<entry>
<title>staging: erofs: keep corrupted fs from crashing kernel in erofs_namei()</title>
<updated>2019-03-13T21:04:20+00:00</updated>
<author>
<name>Gao Xiang</name>
<email>gaoxiang25@huawei.com</email>
</author>
<published>2019-02-01T12:16:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1f236e5b394a95a9a4b7a9afab044561786cb264'/>
<id>urn:sha1:1f236e5b394a95a9a4b7a9afab044561786cb264</id>
<content type='text'>
commit 419d6efc50e94bcf5d6b35cd8c71f79edadec564 upstream.

As Al pointed out, "
... and while we are at it, what happens to
	unsigned int nameoff = le16_to_cpu(de[mid].nameoff);
	unsigned int matched = min(startprfx, endprfx);

	struct qstr dname = QSTR_INIT(data + nameoff,
		unlikely(mid &gt;= ndirents - 1) ?
			maxsize - nameoff :
			le16_to_cpu(de[mid + 1].nameoff) - nameoff);

	/* string comparison without already matched prefix */
	int ret = dirnamecmp(name, &amp;dname, &amp;matched);
if le16_to_cpu(de[...].nameoff) is not monotonically increasing?  I.e.
what's to prevent e.g. (unsigned)-1 ending up in dname.len?

Corrupted fs image shouldn't oops the kernel.. "

Revisit the related lookup flow to address the issue.

Fixes: d72d1ce60174 ("staging: erofs: add namei functions")
Cc: &lt;stable@vger.kernel.org&gt; # 4.19+
Suggested-by: Al Viro &lt;viro@ZenIV.linux.org.uk&gt;
Signed-off-by: Gao Xiang &lt;gaoxiang25@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;


</content>
</entry>
<entry>
<title>staging: android: ashmem: Avoid range_alloc() allocation with ashmem_mutex held.</title>
<updated>2019-03-10T06:10:10+00:00</updated>
<author>
<name>Tetsuo Handa</name>
<email>penguin-kernel@I-love.SAKURA.ne.jp</email>
</author>
<published>2019-02-22T11:03:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=03e121813f1c8be62977318b0916a02ee553c921'/>
<id>urn:sha1:03e121813f1c8be62977318b0916a02ee553c921</id>
<content type='text'>
commit ecd182cbf4e107928077866399100228d2359c60 upstream.

ashmem_pin() is calling range_shrink() without checking whether
range_alloc() succeeded. Also, doing memory allocation with ashmem_mutex
held should be avoided because ashmem_shrink_scan() tries to hold it.

Therefore, move memory allocation for range_alloc() to ashmem_pin_unpin()
and make range_alloc() not to fail.

This patch is mostly meant for backporting purpose for fuzz testing on
stable/distributor kernels, for there is a plan to remove this code in
near future.

Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Cc: stable@vger.kernel.org
Reviewed-by: Joel Fernandes &lt;joel@joelfernandes.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>staging: android: ashmem: Don't call fallocate() with ashmem_mutex held.</title>
<updated>2019-03-10T06:10:10+00:00</updated>
<author>
<name>Tetsuo Handa</name>
<email>penguin-kernel@I-love.SAKURA.ne.jp</email>
</author>
<published>2019-02-05T10:28:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f07d13412f692ebc355ff21d843c495890aaaf0e'/>
<id>urn:sha1:f07d13412f692ebc355ff21d843c495890aaaf0e</id>
<content type='text'>
commit fb4415a12632f0b9078a0aa80c16745d48fcfc74 upstream.

syzbot is hitting lockdep warnings [1][2][3]. This patch tries to fix
the warning by eliminating ashmem_shrink_scan() =&gt; {shmem|vfs}_fallocate()
sequence.

[1] https://syzkaller.appspot.com/bug?id=87c399f6fa6955006080b24142e2ce7680295ad4
[2] https://syzkaller.appspot.com/bug?id=7ebea492de7521048355fc84210220e1038a7908
[3] https://syzkaller.appspot.com/bug?id=e02419c12131c24e2a957ea050c2ab6dcbbc3270

Reported-by: syzbot &lt;syzbot+a76129f18c89f3e2ddd4@syzkaller.appspotmail.com&gt;
Reported-by: syzbot &lt;syzbot+148c2885d71194f18d28@syzkaller.appspotmail.com&gt;
Reported-by: syzbot &lt;syzbot+4b8b031b89e6b96c4b2e@syzkaller.appspotmail.com&gt;
Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Cc: stable@vger.kernel.org
Acked-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>staging: android: ion: fix sys heap pool's gfp_flags</title>
<updated>2019-03-10T06:10:10+00:00</updated>
<author>
<name>Qing Xia</name>
<email>saberlily.xia@hisilicon.com</email>
</author>
<published>2019-02-01T06:59:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ecab53ee92acaaef2ecccdc085976730dc297866'/>
<id>urn:sha1:ecab53ee92acaaef2ecccdc085976730dc297866</id>
<content type='text'>
commit 9bcf065e28122588a6cbee08cf847826dacbb438 upstream.

In the first loop, gfp_flags will be modified to high_order_gfp_flags,
and there will be no chance to change back to low_order_gfp_flags.

Fixes: e7f63771b60e ("ION: Sys_heap: Add cached pool to spead up cached buffer alloc")
Signed-off-by: Qing Xia &lt;saberlily.xia@hisilicon.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Jing Xia &lt;jing.xia@unisoc.com&gt;
Reviewed-by: Yuming Han &lt;yuming.han@unisoc.com&gt;
Reviewed-by: Zhaoyang Huang &lt;zhaoyang.huang@unisoc.com&gt;
Reviewed-by: Orson Zhai &lt;orson.zhai@unisoc.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>staging: wilc1000: fix to set correct value for 'vif_num'</title>
<updated>2019-03-10T06:10:10+00:00</updated>
<author>
<name>Ajay Singh</name>
<email>ajay.kathat@microchip.com</email>
</author>
<published>2019-02-07T11:28:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1ef1d73fc328cedfd5eae0af73a72218e211dc32'/>
<id>urn:sha1:1ef1d73fc328cedfd5eae0af73a72218e211dc32</id>
<content type='text'>
commit dda037057a572f5c82ac2499eb4e6fb17600ba3e upstream.

Set correct value in '-&gt;vif_num' for the total number of interfaces and
set '-&gt;idx' value using 'i'.

Fixes: 735bb39ca3be ("staging: wilc1000: simplify vif[i]-&gt;ndev accesses")
Fixes: 0e490657c721 ("staging: wilc1000: Fix problem with wrong vif index")
Cc: &lt;stable@vger.kernel.org&gt;
Suggested-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>staging: comedi: ni_660x: fix missing break in switch statement</title>
<updated>2019-03-10T06:10:10+00:00</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2019-02-12T18:44:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2b4f6798d3c269f562325f22cf8f6be0976f4439'/>
<id>urn:sha1:2b4f6798d3c269f562325f22cf8f6be0976f4439</id>
<content type='text'>
commit 479826cc86118e0d87e5cefb3df5b748e0480924 upstream.

Add missing break statement in order to prevent the code from falling
through to the default case and return -EINVAL every time.

This bug was found thanks to the ongoing efforts to enable
-Wimplicit-fallthrough.

Fixes: aa94f2888825 ("staging: comedi: ni_660x: tidy up ni_660x_set_pfi_routing()")
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Reviewed-by: Ian Abbott &lt;abbotti@mev.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>staging: erofs: compressed_pages should not be accessed again after freed</title>
<updated>2019-03-10T06:10:10+00:00</updated>
<author>
<name>Gao Xiang</name>
<email>gaoxiang25@huawei.com</email>
</author>
<published>2019-02-27T05:33:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ff209c160c3527a865c66b47b4f363709aae6cdd'/>
<id>urn:sha1:ff209c160c3527a865c66b47b4f363709aae6cdd</id>
<content type='text'>
commit af692e117cb8cd9d3d844d413095775abc1217f9 upstream.

This patch resolves the following page use-after-free issue,
z_erofs_vle_unzip:
    ...
    for (i = 0; i &lt; nr_pages; ++i) {
        ...
        z_erofs_onlinepage_endio(page);  (1)
    }

    for (i = 0; i &lt; clusterpages; ++i) {
        page = compressed_pages[i];

        if (page-&gt;mapping == mngda)      (2)
            continue;
        /* recycle all individual staging pages */
        (void)z_erofs_gather_if_stagingpage(page_pool, page); (3)
        WRITE_ONCE(compressed_pages[i], NULL);
    }
    ...

After (1) is executed, page is freed and could be then reused, if
compressed_pages is scanned after that, it could fall info (2) or
(3) by mistake and that could finally be in a mess.

This patch aims to solve the above issue only with little changes
as much as possible in order to make the fix backport easier.

Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Cc: &lt;stable@vger.kernel.org&gt; # 4.19+
Signed-off-by: Gao Xiang &lt;gaoxiang25@huawei.com&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;


</content>
</entry>
<entry>
<title>staging: erofs: fix illegal address access under memory pressure</title>
<updated>2019-03-10T06:10:09+00:00</updated>
<author>
<name>Gao Xiang</name>
<email>gaoxiang25@huawei.com</email>
</author>
<published>2019-02-27T05:33:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cfb9b64e5f2e4de89807294d5d07dc3b3c45a59c'/>
<id>urn:sha1:cfb9b64e5f2e4de89807294d5d07dc3b3c45a59c</id>
<content type='text'>
commit 1e5ceeab6929585512c63d05911d6657064abf7b upstream.

Considering a read request with two decompressed file pages,
If a decompression work cannot be started on the previous page
due to memory pressure but in-memory LTP map lookup is done,
builder-&gt;work should be still NULL.

Moreover, if the current page also belongs to the same map,
it won't try to start the decompression work again and then
run into trouble.

This patch aims to solve the above issue only with little changes
as much as possible in order to make the fix backport easier.

kernel message is:
&lt;4&gt;[1051408.015930s]SLUB: Unable to allocate memory on node -1, gfp=0x2408040(GFP_NOFS|__GFP_ZERO)
&lt;4&gt;[1051408.015930s]  cache: erofs_compress, object size: 144, buffer size: 144, default order: 0, min order: 0
&lt;4&gt;[1051408.015930s]  node 0: slabs: 98, objs: 2744, free: 0
  * Cannot allocate the decompression work

&lt;3&gt;[1051408.015960s]erofs: z_erofs_vle_normalaccess_readpages, readahead error at page 1008 of nid 5391488
  * Note that the previous page was failed to read

&lt;0&gt;[1051408.015960s]Internal error: Accessing user space memory outside uaccess.h routines: 96000005 [#1] PREEMPT SMP
...
&lt;4&gt;[1051408.015991s]Hardware name: kirin710 (DT)
...
&lt;4&gt;[1051408.016021s]PC is at z_erofs_vle_work_add_page+0xa0/0x17c
&lt;4&gt;[1051408.016021s]LR is at z_erofs_do_read_page+0x12c/0xcf0
...
&lt;4&gt;[1051408.018096s][&lt;ffffff80c6fb0fd4&gt;] z_erofs_vle_work_add_page+0xa0/0x17c
&lt;4&gt;[1051408.018096s][&lt;ffffff80c6fb3814&gt;] z_erofs_vle_normalaccess_readpages+0x1a0/0x37c
&lt;4&gt;[1051408.018096s][&lt;ffffff80c6d670b8&gt;] read_pages+0x70/0x190
&lt;4&gt;[1051408.018127s][&lt;ffffff80c6d6736c&gt;] __do_page_cache_readahead+0x194/0x1a8
&lt;4&gt;[1051408.018127s][&lt;ffffff80c6d59318&gt;] filemap_fault+0x398/0x684
&lt;4&gt;[1051408.018127s][&lt;ffffff80c6d8a9e0&gt;] __do_fault+0x8c/0x138
&lt;4&gt;[1051408.018127s][&lt;ffffff80c6d8f90c&gt;] handle_pte_fault+0x730/0xb7c
&lt;4&gt;[1051408.018127s][&lt;ffffff80c6d8fe04&gt;] __handle_mm_fault+0xac/0xf4
&lt;4&gt;[1051408.018157s][&lt;ffffff80c6d8fec8&gt;] handle_mm_fault+0x7c/0x118
&lt;4&gt;[1051408.018157s][&lt;ffffff80c8c52998&gt;] do_page_fault+0x354/0x474
&lt;4&gt;[1051408.018157s][&lt;ffffff80c8c52af8&gt;] do_translation_fault+0x40/0x48
&lt;4&gt;[1051408.018157s][&lt;ffffff80c6c002f4&gt;] do_mem_abort+0x80/0x100
&lt;4&gt;[1051408.018310s]---[ end trace 9f4009a3283bd78b ]---

Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Cc: &lt;stable@vger.kernel.org&gt; # 4.19+
Signed-off-by: Gao Xiang &lt;gaoxiang25@huawei.com&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>staging: erofs: fix race of initializing xattrs of a inode at the same time</title>
<updated>2019-03-10T06:10:09+00:00</updated>
<author>
<name>Gao Xiang</name>
<email>gaoxiang25@huawei.com</email>
</author>
<published>2019-02-18T07:19:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=84f6c9bb3f21deaa9b98a2978aae96a89f4de4e3'/>
<id>urn:sha1:84f6c9bb3f21deaa9b98a2978aae96a89f4de4e3</id>
<content type='text'>
commit 62dc45979f3f8cb0ea67302a93bff686f0c46c5a upstream.

In real scenario, there could be several threads accessing xattrs
of the same xattr-uninitialized inode, and init_inode_xattrs()
almost at the same time.

That's actually an unexpected behavior, this patch closes the race.

Fixes: b17500a0fdba ("staging: erofs: introduce xattr &amp; acl support")
Cc: &lt;stable@vger.kernel.org&gt; # 4.19+
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Gao Xiang &lt;gaoxiang25@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>staging: erofs: fix memleak of inode's shared xattr array</title>
<updated>2019-03-10T06:10:09+00:00</updated>
<author>
<name>Sheng Yong</name>
<email>shengyong1@huawei.com</email>
</author>
<published>2019-02-14T06:46:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e06bb31e0fe4c6fc11693350c2db88ed4e87ae71'/>
<id>urn:sha1:e06bb31e0fe4c6fc11693350c2db88ed4e87ae71</id>
<content type='text'>
commit 3b1b5291f79d040d549d7c746669fc30e8045b9b upstream.

If it fails to read a shared xattr page, the inode's shared xattr array
is not freed. The next time the inode's xattr is accessed, the previously
allocated array is leaked.

Signed-off-by: Sheng Yong &lt;shengyong1@huawei.com&gt;
Fixes: b17500a0fdba ("staging: erofs: introduce xattr &amp; acl support")
Cc: &lt;stable@vger.kernel.org&gt; # 4.19+
Reviewed-by: Gao Xiang &lt;gaoxiang25@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
