Skip to contentSkip to conversation

parisc/unwind: use copy_from_kernel_nofault()

PATCH New Sven Schnelle 1 participant 1 message Sep 30, 2021 PA-RISC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 parisc/unwind: use copy_from_kernel_nofault()

I have no idea why get_user() is used there, but we're unwinding the kernel stack, so we should use copy_from_kernel_nofault().

---
 arch/parisc/kernel/unwind.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/parisc/kernel/unwind.c +2 -1
index 87ae476d1c4f..889d5889203a 100644
@@ -302,7 +302,8 @@ static void unwind_frame_regs(struct unwind_frame_info *info)
 				break;
 			}
 
-			if (get_user(tmp, (unsigned long *)(info->prev_sp - RP_OFFSET))) 
+			if (copy_from_kernel_nofault(&tmp,
+			    (void *)info->prev_sp - RP_OFFSET, sizeof(tmp)))
 				break;
 			info->prev_ip = tmp;
 			sp = info->prev_sp;
Signature · 1 line
2.33.0