lkml.org 
[lkml]   [2020]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH v5 01/13] ptrace: Use regset_size() for dynamic regset
Date
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@sifive.com>
---
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
\
 
 \ /
  Last update: 2020-05-28 08:42    [W:0.105 / U:1.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site