mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Suresh Siddha <suresh.b.siddha@intel.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	roland@redhat.com, suresh.b.siddha@intel.com, oleg@redhat.com,
	tglx@linutronix.de
Subject: [tip:x86/ptrace] ptrace: Fix ptrace_regset() comments and diagnose errors specifically
Date: Tue, 23 Feb 2010 21:48:43 GMT	[thread overview]
Message-ID: <tip-c6a0dd7ec6fb2d4927979ed4dc562fc5c122d826@git.kernel.org> (raw)
In-Reply-To: <20100222225240.397523600@sbs-t61.sc.intel.com>

Commit-ID:  c6a0dd7ec6fb2d4927979ed4dc562fc5c122d826
Gitweb:     http://git.kernel.org/tip/c6a0dd7ec6fb2d4927979ed4dc562fc5c122d826
Author:     Suresh Siddha <suresh.b.siddha@intel.com>
AuthorDate: Mon, 22 Feb 2010 14:51:32 -0800
Committer:  H. Peter Anvin <hpa@zytor.com>
CommitDate: Tue, 23 Feb 2010 13:45:26 -0800

ptrace: Fix ptrace_regset() comments and diagnose errors specifically

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>
LKML-Reference: <20100222225240.397523600@sbs-t61.sc.intel.com>
Acked-by: Roland McGrath <roland@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
 include/linux/ptrace.h |    5 +++++
 kernel/ptrace.c        |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index dbfa821..c5eab89 100644
--- a/include/linux/ptrace.h
+++ b/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};
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 13b4554..42ad8ae 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -537,7 +537,7 @@ static int ptrace_regset(struct task_struct *task, int req, unsigned int type,
 	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,

      parent reply	other threads:[~2010-02-23 21:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-22 22:51 [patch 1/3] ptrace: fix " 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-bot for Suresh Siddha [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-c6a0dd7ec6fb2d4927979ed4dc562fc5c122d826@git.kernel.org \
    --to=suresh.b.siddha@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=roland@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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