[RFC,v2,1/2] ARM: iwmmxt: Add missing __user annotations to sigframe accessors

Message ID 1498583067-14178-2-git-send-email-Dave.Martin@arm.com
State New, archived
Headers

Commit Message

Dave Martin June 27, 2017, 5:04 p.m. UTC
  preserve_iwmmxt_context() and restore_iwmmxt_context() lack __user
accessors on their arguments pointing to the user signal frame.

There does not be appear to be a bug here, but this omission is
inconsistent with the crunch and vfp sigframe access functions.

This patch adds the annotations, for consistency.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
---
 arch/arm/kernel/signal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Russell King - ARM Linux June 27, 2017, 10:05 p.m. UTC | #1
On Tue, Jun 27, 2017 at 06:04:06PM +0100, Dave Martin wrote:
> preserve_iwmmxt_context() and restore_iwmmxt_context() lack __user
> accessors on their arguments pointing to the user signal frame.
> 
> There does not be appear to be a bug here, but this omission is
> inconsistent with the crunch and vfp sigframe access functions.
> 
> This patch adds the annotations, for consistency.
> 
> Signed-off-by: Dave Martin <Dave.Martin@arm.com>

Absolutely the right thing to do.  Please drop this into the patch system,
thanks.
  

Patch

diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 7b8f214..8f06480 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -59,7 +59,7 @@  static int restore_crunch_context(struct crunch_sigframe __user *frame)
 
 #ifdef CONFIG_IWMMXT
 
-static int preserve_iwmmxt_context(struct iwmmxt_sigframe *frame)
+static int preserve_iwmmxt_context(struct iwmmxt_sigframe __user *frame)
 {
 	char kbuf[sizeof(*frame) + 8];
 	struct iwmmxt_sigframe *kframe;
@@ -72,7 +72,7 @@  static int preserve_iwmmxt_context(struct iwmmxt_sigframe *frame)
 	return __copy_to_user(frame, kframe, sizeof(*frame));
 }
 
-static int restore_iwmmxt_context(struct iwmmxt_sigframe *frame)
+static int restore_iwmmxt_context(struct iwmmxt_sigframe __user *frame)
 {
 	char kbuf[sizeof(*frame) + 8];
 	struct iwmmxt_sigframe *kframe;