[RFC PATCH v5 01/13] ptrace: Use regset_size() for dynamic regset
From: Greentime Hu
Date: Thu May 28 2020 - 02:41:13 EST
This patch uses regset_size() instead of using regset->n and regset->size
directly. In this case, it will call the get_size() ported by arch
dynamically to support dynamic regset size case.
Signed-off-by: Greentime Hu <greentime.hu@xxxxxxxxxx>
---
kernel/ptrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 43d6179508d6..946b2c4ec4fa 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -888,7 +888,7 @@ static int ptrace_regset(struct task_struct *task, int req, unsigned int type,
regset_no = regset - view->regsets;
kiov->iov_len = min(kiov->iov_len,
- (__kernel_size_t) (regset->n * regset->size));
+ (__kernel_size_t) regset_size(task, regset));
if (req == PTRACE_GETREGSET)
return copy_regset_to_user(task, view, regset_no, 0,
--
2.26.2