WSL2-Linux-Kernel/arch/xtensa
Yi Yang 4b02493838 xtensa/simdisk: fix proc_read_simdisk()
commit b011946d03 upstream.

The commit a69755b187 ("xtensa simdisk: switch to proc_create_data()")
split read operation into two parts, first retrieving the path when it's
non-null and second retrieving the trailing '\n'. However when the path
is non-null the first simple_read_from_buffer updates ppos, and the
second simple_read_from_buffer returns 0 if ppos is greater than 1 (i.e.
almost always). As a result reading from that proc file is almost always
empty.

Fix it by making a temporary copy of the path with the trailing '\n' and
using simple_read_from_buffer on that copy.

Cc: stable@vger.kernel.org
Fixes: a69755b187 ("xtensa simdisk: switch to proc_create_data()")
Signed-off-by: Yi Yang <yiyang13@huawei.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-09 10:23:28 +02:00
..
boot xtensa: fix DTC warning unit_address_format 2022-04-13 20:59:09 +02:00
configs
include xtensa: use fallback for random_get_entropy() instead of zero 2022-05-30 09:29:14 +02:00
kernel ptrace/xtensa: Replace PT_SINGLESTEP with TIF_SINGLESTEP 2022-06-09 10:22:29 +02:00
lib
mm
platforms xtensa/simdisk: fix proc_read_simdisk() 2022-06-09 10:23:28 +02:00
variants
Kbuild
Kconfig
Kconfig.debug
Makefile