提交 65a5053b 编写于 作者: H Hartley Sweeten 提交者: Russell King

ARM: 5638/1: arch/arm/kernel/signal.c: use correct address space for CRUNCH

preserve_crunch_context() calls __copy_to_user() which expects the
destination address to be in __user space.  setup_sigframe() properly
passes the destination address.

restore_crunch_context() calls __copy_from_user() which expects the
source address to be in __user space.  restore_sigframe() properly
passes the source address.

This fixes {preserve/restore}_crunch_context() to accept the
address as __user space and resolves the following sparse warnings:

  arch/arm/kernel/signal.c:146:31:
     warning: incorrect type in argument 1 (different address spaces)
        expected void [noderef] <asn:1>*to
        got struct crunch_sigframe *frame

  arch/arm/kernel/signal.c:156:38:
     warning: incorrect type in argument 2 (different address spaces)
        expected void const [noderef] <asn:1>*from
        got struct crunch_sigframe *frame

  arch/arm/kernel/signal.c:250:48:
     warning: incorrect type in argument 1 (different address spaces)
        expected struct crunch_sigframe *frame
        got struct crunch_sigframe [noderef] <asn:1>*<noident>

  arch/arm/kernel/signal.c:365:49:
     warning: incorrect type in argument 1 (different address spaces)
        expected struct crunch_sigframe *frame
        got struct crunch_sigframe [noderef] <asn:1>*<noident>
Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 0a51810a
...@@ -133,7 +133,7 @@ sys_sigaction(int sig, const struct old_sigaction __user *act, ...@@ -133,7 +133,7 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
} }
#ifdef CONFIG_CRUNCH #ifdef CONFIG_CRUNCH
static int preserve_crunch_context(struct crunch_sigframe *frame) static int preserve_crunch_context(struct crunch_sigframe __user *frame)
{ {
char kbuf[sizeof(*frame) + 8]; char kbuf[sizeof(*frame) + 8];
struct crunch_sigframe *kframe; struct crunch_sigframe *kframe;
...@@ -146,7 +146,7 @@ static int preserve_crunch_context(struct crunch_sigframe *frame) ...@@ -146,7 +146,7 @@ static int preserve_crunch_context(struct crunch_sigframe *frame)
return __copy_to_user(frame, kframe, sizeof(*frame)); return __copy_to_user(frame, kframe, sizeof(*frame));
} }
static int restore_crunch_context(struct crunch_sigframe *frame) static int restore_crunch_context(struct crunch_sigframe __user *frame)
{ {
char kbuf[sizeof(*frame) + 8]; char kbuf[sizeof(*frame) + 8];
struct crunch_sigframe *kframe; struct crunch_sigframe *kframe;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册