WSL2-Linux-Kernel/arch
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
..
alpha alpha: fix alloc_zeroed_user_highpage_movable() 2022-06-09 10:22:43 +02:00
arc ARC: entry: fix syscall_trace_exit argument 2022-04-27 14:39:00 +02:00
arm ARM: dts: at91: sama7g5: remove interrupt-parent from gic node 2022-06-09 10:23:11 +02:00
arm64 arm64: dts: marvell: espressobin-ultra: enable front USB3 port 2022-06-09 10:23:10 +02:00
csky csky: patch_text: Fixup last cpu should be master 2022-06-09 10:23:26 +02:00
h8300
hexagon uaccess: fix integer overflow on access_ok() 2022-03-28 09:58:45 +02:00
ia64 ia64: define get_cycles macro for arch-override 2022-05-30 09:29:12 +02:00
m68k m68k: math-emu: Fix dependencies of math emulation support 2022-06-09 10:22:59 +02:00
microblaze uaccess: fix nios2 and microblaze get_user_8() 2022-04-08 14:23:18 +02:00
mips mips: use fallback for random_get_entropy() instead of just c0 random 2022-05-30 09:29:13 +02:00
nds32 nds32: fix access_ok() checks in get/put_user 2022-03-28 09:58:46 +02:00
nios2 nios2: use fallback for random_get_entropy() instead of zero 2022-05-30 09:29:14 +02:00
openrisc openrisc: start CPU timer early in boot 2022-06-09 10:22:38 +02:00
parisc parisc/stifb: Implement fb_is_primary_device() 2022-06-09 10:22:26 +02:00
powerpc powerpc/fsl_rio: Fix refcount leak in fsl_rio_setup 2022-06-09 10:23:12 +02:00
riscv riscv: Move alternative length validation into subsection 2022-06-09 10:22:27 +02:00
s390 kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add] 2022-06-09 10:23:27 +02:00
sh Documentation, arch: Remove leftovers from CIFS_WEAK_PW_HASH 2022-01-27 11:05:21 +01:00
sparc signal: Deliver SIGTRAP on perf event asynchronously if blocked 2022-06-09 10:22:48 +02:00
um um: chan_user: Fix winch_tramp() return value 2022-06-09 10:23:27 +02:00
x86 kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add] 2022-06-09 10:23:27 +02:00
xtensa xtensa/simdisk: fix proc_read_simdisk() 2022-06-09 10:23:28 +02:00
.gitignore
Kconfig stack: Constrain and fix stack offset randomization with Clang builds 2022-04-08 14:23:06 +02:00