mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 1/3] ptrace: fix ptrace_regset() comments and diagnose errors specifically
@ 2010-02-22 22:51 Suresh Siddha
  2010-02-22 22:51 ` [patch 2/3] x86, ptrace: simplify xstateregs_get() Suresh Siddha
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Suresh Siddha @ 2010-02-22 22:51 UTC (permalink / raw)
  To: H. Peter Anvin, Ingo Molnar, Thomas Gleixner, Roland McGrath,
	Oleg Nesterov
  Cc: LKML, hjl.tools, suresh.b.siddha

[-- Attachment #1: better_characterize_ptrace_regset_error.patch --]
[-- Type: text/plain, Size: 1640 bytes --]

Return -EINVAL for the bad size and for unrecognized NT_* type in
ptrace_regset() instead of -EIO.

Also update the comments for this ptrace interface with more clarifications.

Requested-by: Roland McGrath <roland@redhat.com>
Requested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---
 include/linux/ptrace.h |    5 +++++
 kernel/ptrace.c        |    2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

Index: tip/kernel/ptrace.c
===================================================================
--- tip.orig/kernel/ptrace.c
+++ tip/kernel/ptrace.c
@@ -537,7 +537,7 @@ static int ptrace_regset(struct task_str
 	int regset_no;
 
 	if (!regset || (kiov->iov_len % regset->size) != 0)
-		return -EIO;
+		return -EINVAL;
 
 	regset_no = regset - view->regsets;
 	kiov->iov_len = min(kiov->iov_len,
Index: tip/include/linux/ptrace.h
===================================================================
--- tip.orig/include/linux/ptrace.h
+++ tip/include/linux/ptrace.h
@@ -30,6 +30,11 @@
 /*
  * Generic ptrace interface that exports the architecture specific regsets
  * using the corresponding NT_* types (which are also used in the core dump).
+ * Please note that the NT_PRSTATUS note type in a core dump contains a full
+ * 'struct elf_prstatus'. But the user_regset for NT_PRSTATUS contains just the
+ * elf_gregset_t that is the pr_reg field of 'struct elf_prstatus'. For all the
+ * other user_regset flavors, the user_regset layout and the ELF core dump note
+ * payload are exactly the same layout.
  *
  * This interface usage is as follows:
  *	struct iovec iov = { buf, len};



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-02-23 21:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-22 22:51 [patch 1/3] ptrace: fix ptrace_regset() comments and diagnose errors specifically Suresh Siddha
2010-02-22 22:51 ` [patch 2/3] x86, ptrace: simplify xstateregs_get() Suresh Siddha
2010-02-23 20:38   ` Roland McGrath
2010-02-23 21:49   ` [tip:x86/ptrace] x86, ptrace: Simplify xstateregs_get() tip-bot for Suresh Siddha
2010-02-22 22:51 ` [patch 3/3] x86, ptrace: remove set_stopped_child_used_math() in [x]fpregs_set Suresh Siddha
2010-02-23 20:37   ` Roland McGrath
2010-02-23 21:49   ` [tip:x86/ptrace] x86, ptrace: Remove " tip-bot for Suresh Siddha
2010-02-23 20:39 ` [patch 1/3] ptrace: fix ptrace_regset() comments and diagnose errors specifically Roland McGrath
2010-02-23 21:48 ` [tip:x86/ptrace] ptrace: Fix " tip-bot for Suresh Siddha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome