* [PATCH 00/13] Make user_regset_copyin_ignore() *void* @ 2022-10-14 21:22 Sergey Shtylyov 2022-10-14 21:22 ` [PATCH 02/13] arm: ptrace: user_regset_copyin_ignore() always returns 0 Sergey Shtylyov 2022-10-14 21:22 ` [PATCH 03/13] arm64: " Sergey Shtylyov 0 siblings, 2 replies; 4+ messages in thread From: Sergey Shtylyov @ 2022-10-14 21:22 UTC (permalink / raw) To: Oleg Nesterov, Russell King, Catalin Marinas, Will Deacon, Brian Cain, Thomas Bogendoerfer, Dinh Nguyen, Jonas Bonn, Stefan Kristiansson, Stafford Horne, James E.J. Bottomley, Helge Deller, Michael Ellerman, Nicholas Piggin, Christophe Leroy, Yoshinori Sato, Rich Felker, David S. Miller, linux-arm-kernel, linux-hexagon, linux-ia64, linux-kernel, linux-mips, linux-parisc, linux-sh, linuxppc-dev, openrisc, sparclinux Cc: Andrew Morton, lvc-patches, lvc-project Here are 13 patches against the 'next-20221014' tag of the 'linux-next.git' repo. I'm not sure how this cross-arch series should be merged -- perhaps thru Andrew Morton's tree? user_regset_copyin_ignore() apparently cannot fail and so always returns 0. Let's first remove the result checks in several architectures that call this function and then make user_regset_copyin_ignore() return *void* instead of *int*... Sergey Shtylyov (13): arc: ptrace: user_regset_copyin_ignore() always returns 0 arm: ptrace: user_regset_copyin_ignore() always returns 0 arm64: ptrace: user_regset_copyin_ignore() always returns 0 hexagon: ptrace: user_regset_copyin_ignore() always returns 0 ia64: ptrace: user_regset_copyin_ignore() always returns 0 mips: ptrace: user_regset_copyin_ignore() always returns 0 nios2: ptrace: user_regset_copyin_ignore() always returns 0 openrisc: ptrace: user_regset_copyin_ignore() always returns 0 parisc: ptrace: user_regset_copyin_ignore() always returns 0 powerpc: ptrace: user_regset_copyin_ignore() always returns 0 sh: ptrace: user_regset_copyin_ignore() always returns 0 sparc: ptrace: user_regset_copyin_ignore() always returns 0 regset: make user_regset_copyin_ignore() *void* arch/arc/kernel/ptrace.c | 2 +- arch/arm/kernel/ptrace.c | 8 +++----- arch/arm64/kernel/ptrace.c | 16 ++++------------ arch/hexagon/kernel/ptrace.c | 7 +++---- arch/ia64/kernel/ptrace.c | 20 +++++++++----------- arch/mips/kernel/ptrace.c | 9 +++++---- arch/nios2/kernel/ptrace.c | 6 +++--- arch/openrisc/kernel/ptrace.c | 8 +++----- arch/parisc/kernel/ptrace.c | 15 +++++++++------ arch/powerpc/kernel/ptrace/ptrace-tm.c | 10 +++++----- arch/powerpc/kernel/ptrace/ptrace-view.c | 10 +++++----- arch/sh/kernel/ptrace_32.c | 8 ++++---- arch/sparc/kernel/ptrace_32.c | 9 +++++---- arch/sparc/kernel/ptrace_64.c | 23 +++++++++++------------ include/linux/regset.h | 15 +++++++-------- 15 files changed, 77 insertions(+), 89 deletions(-) -- 2.26.3 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 02/13] arm: ptrace: user_regset_copyin_ignore() always returns 0 2022-10-14 21:22 [PATCH 00/13] Make user_regset_copyin_ignore() *void* Sergey Shtylyov @ 2022-10-14 21:22 ` Sergey Shtylyov 2022-10-14 21:22 ` [PATCH 03/13] arm64: " Sergey Shtylyov 1 sibling, 0 replies; 4+ messages in thread From: Sergey Shtylyov @ 2022-10-14 21:22 UTC (permalink / raw) To: Oleg Nesterov, Russell King, linux-arm-kernel, linux-kernel; +Cc: Andrew Morton user_regset_copyin_ignore() always returns 0, so checking its result seems pointless -- don't do this anymore... Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> --- arch/arm/kernel/ptrace.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index bfe88c6e60d5..2d8e2516906b 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c @@ -651,11 +651,9 @@ static int vfp_set(struct task_struct *target, if (ret) return ret; - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - user_fpregs_offset + sizeof(new_vfp.fpregs), - user_fpscr_offset); - if (ret) - return ret; + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + user_fpregs_offset + sizeof(new_vfp.fpregs), + user_fpscr_offset); ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &new_vfp.fpscr, -- 2.26.3 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 03/13] arm64: ptrace: user_regset_copyin_ignore() always returns 0 2022-10-14 21:22 [PATCH 00/13] Make user_regset_copyin_ignore() *void* Sergey Shtylyov 2022-10-14 21:22 ` [PATCH 02/13] arm: ptrace: user_regset_copyin_ignore() always returns 0 Sergey Shtylyov @ 2022-10-14 21:22 ` Sergey Shtylyov 2022-11-09 11:20 ` Catalin Marinas 1 sibling, 1 reply; 4+ messages in thread From: Sergey Shtylyov @ 2022-10-14 21:22 UTC (permalink / raw) To: Oleg Nesterov, Catalin Marinas, Will Deacon, linux-arm-kernel, linux-kernel Cc: Andrew Morton, lvc-patches, lvc-project user_regset_copyin_ignore() always returns 0, so checking its result seems pointless -- don't do this anymore... Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool. Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> --- arch/arm64/kernel/ptrace.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index c2fb5755bbec..f3af3371280a 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -514,9 +514,7 @@ static int hw_break_set(struct task_struct *target, /* Resource info and pad */ offset = offsetof(struct user_hwdebug_state, dbg_regs); - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, offset); - if (ret) - return ret; + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, offset); /* (address, ctrl) registers */ limit = regset->n * regset->size; @@ -543,11 +541,8 @@ static int hw_break_set(struct task_struct *target, return ret; offset += PTRACE_HBP_CTRL_SZ; - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - offset, - offset + PTRACE_HBP_PAD_SZ); - if (ret) - return ret; + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, + offset, offset + PTRACE_HBP_PAD_SZ); offset += PTRACE_HBP_PAD_SZ; idx++; } @@ -954,10 +949,7 @@ static int sve_set_common(struct task_struct *target, start = end; end = SVE_PT_SVE_FPSR_OFFSET(vq); - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, - start, end); - if (ret) - goto out; + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, start, end); /* * Copy fpsr, and fpcr which must follow contiguously in -- 2.26.3 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 03/13] arm64: ptrace: user_regset_copyin_ignore() always returns 0 2022-10-14 21:22 ` [PATCH 03/13] arm64: " Sergey Shtylyov @ 2022-11-09 11:20 ` Catalin Marinas 0 siblings, 0 replies; 4+ messages in thread From: Catalin Marinas @ 2022-11-09 11:20 UTC (permalink / raw) To: Sergey Shtylyov Cc: Oleg Nesterov, Will Deacon, linux-arm-kernel, linux-kernel, Andrew Morton, lvc-patches, lvc-project On Sat, Oct 15, 2022 at 12:22:25AM +0300, Sergey Shtylyov wrote: > user_regset_copyin_ignore() always returns 0, so checking its result seems > pointless -- don't do this anymore... > > Found by Linux Verification Center (linuxtesting.org) with the SVACE static > analysis tool. > > Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Acked-by: Catalin Marinas <catalin.marinas@arm.com> What's happening with this series? (just going through my inbox) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-09 11:21 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-10-14 21:22 [PATCH 00/13] Make user_regset_copyin_ignore() *void* Sergey Shtylyov 2022-10-14 21:22 ` [PATCH 02/13] arm: ptrace: user_regset_copyin_ignore() always returns 0 Sergey Shtylyov 2022-10-14 21:22 ` [PATCH 03/13] arm64: " Sergey Shtylyov 2022-11-09 11:20 ` Catalin Marinas
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).