diff for duplicates of <5771005B.3060605@huawei.com> diff --git a/a/2.txt b/N1/2.txt index 6429055..8b13789 100644 --- a/a/2.txt +++ b/N1/2.txt @@ -1,179 +1 @@ -From 06f5abeca59069cb41b0b4fdfa06240d3f78910d Mon Sep 17 00:00:00 2001 -From: Zhou Chengming <zhouchengming1@huawei.com> -Date: Mon, 27 Jun 2016 12:57:02 +0800 -Subject: [PATCH] ilp32: fix {GET,SET}SIGMASK request for ptrace -The function compat_ptrace_request(used by ilp32) don't handle -{GET,SET}SIGMASK request, so it will be handled by ptrace_request. -But it's wrong because the compat_sigset_t of ilp32 differs from -the sigset_t of aarch64. The patch fixes it. - -Signed-off-by: Zhou Chengming <zhouchengming1@huawei.com> ---- - arch/arm64/include/asm/signal_ilp32.h | 22 ++++++++++++ - arch/arm64/kernel/ptrace.c | 62 +++++++++++++++++++++++++++++++++ - arch/arm64/kernel/signal_ilp32.c | 23 +------------ - 3 files changed, 85 insertions(+), 22 deletions(-) - -diff --git a/arch/arm64/include/asm/signal_ilp32.h b/arch/arm64/include/asm/signal_ilp32.h -index 30eff23..ed52607 100644 ---- a/arch/arm64/include/asm/signal_ilp32.h -+++ b/arch/arm64/include/asm/signal_ilp32.h -@@ -21,6 +21,28 @@ - int ilp32_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set, - struct pt_regs *regs); - -+static inline int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set) -+{ -+ compat_sigset_t cset; -+ -+ cset.sig[0] = set->sig[0] & 0xffffffffull; -+ cset.sig[1] = set->sig[0] >> 32; -+ -+ return copy_to_user(uset, &cset, sizeof(*uset)); -+} -+ -+static inline int get_sigset_t(sigset_t *set, -+ const compat_sigset_t __user *uset) -+{ -+ compat_sigset_t s32; -+ -+ if (copy_from_user(&s32, uset, sizeof(*uset))) -+ return -EFAULT; -+ -+ set->sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32); -+ return 0; -+} -+ - #else - - static inline int ilp32_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set, -diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c -index a861105..8d4cad1 100644 ---- a/arch/arm64/kernel/ptrace.c -+++ b/arch/arm64/kernel/ptrace.c -@@ -44,6 +44,7 @@ - #include <asm/syscall.h> - #include <asm/traps.h> - #include <asm/system_misc.h> -+#include <asm/signal_ilp32.h> - - #define CREATE_TRACE_POINTS - #include <trace/events/syscalls.h> -@@ -1231,12 +1232,73 @@ COMPAT_SYSCALL_DEFINE4(aarch32_ptrace, compat_long_t, request, compat_long_t, pi - - #endif /* CONFIG_AARCH32_EL0 */ - -+#ifdef CONFIG_ARM64_ILP32 -+ -+static int compat_ilp32_ptrace(struct task_struct *child, compat_long_t request, -+ compat_ulong_t addr, compat_ulong_t data) -+{ -+ compat_ulong_t __user *datap = compat_ptr(data); -+ int ret; -+ -+ switch (request) { -+ case PTRACE_GETSIGMASK: -+ if (addr != sizeof(compat_sigset_t)) { -+ ret = -EINVAL; -+ break; -+ } -+ -+ if (put_sigset_t((compat_sigset_t __user *)datap, &child->blocked)) -+ ret = -EFAULT; -+ else -+ ret = 0; -+ break; -+ -+ case PTRACE_SETSIGMASK: { -+ sigset_t new_set; -+ if (addr != sizeof(compat_sigset_t)) { -+ ret = -EINVAL; -+ break; -+ } -+ -+ if (get_sigset_t(&new_set, (compat_sigset_t __user *)datap)) { -+ ret = -EFAULT; -+ break; -+ } -+ -+ sigdelsetmask(&new_set, sigmask(SIGKILL)|sigmask(SIGSTOP)); -+ -+ /* -+ * Every thread does recalc_sigpending() after resume, so -+ * retarget_shared_pending() and recalc_sigpending() are not -+ * called here. -+ */ -+ spin_lock_irq(&child->sighand->siglock); -+ child->blocked = new_set; -+ spin_unlock_irq(&child->sighand->siglock); -+ -+ ret = 0; -+ break; -+ } -+ -+ default: -+ ret = compat_ptrace_request(child, request, addr, data); -+ } -+ -+ return ret; -+} -+ -+#endif /* CONFIG_ARM64_ILP32 */ -+ - #ifdef CONFIG_COMPAT - - long compat_arch_ptrace(struct task_struct *child, compat_long_t request, - compat_ulong_t caddr, compat_ulong_t cdata) - { -+#ifdef CONFIG_ARM64_ILP32 -+ return compat_ilp32_ptrace(child, request, caddr, cdata); -+#else - return compat_ptrace_request(child, request, caddr, cdata); -+#endif - } - - #endif /* CONFIG_COMPAT */ -diff --git a/arch/arm64/kernel/signal_ilp32.c b/arch/arm64/kernel/signal_ilp32.c -index 8ca64b9..3ef2749 100644 ---- a/arch/arm64/kernel/signal_ilp32.c -+++ b/arch/arm64/kernel/signal_ilp32.c -@@ -28,6 +28,7 @@ - #include <asm/fpsimd.h> - #include <asm/signal32_common.h> - #include <asm/signal_common.h> -+#include <asm/signal_ilp32.h> - #include <asm/uaccess.h> - #include <asm/unistd.h> - #include <asm/ucontext.h> -@@ -58,28 +59,6 @@ struct ilp32_rt_sigframe { - struct ilp32_sigframe sig; - }; - --static inline int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set) --{ -- compat_sigset_t cset; -- -- cset.sig[0] = set->sig[0] & 0xffffffffull; -- cset.sig[1] = set->sig[0] >> 32; -- -- return copy_to_user(uset, &cset, sizeof(*uset)); --} -- --static inline int get_sigset_t(sigset_t *set, -- const compat_sigset_t __user *uset) --{ -- compat_sigset_t s32; -- -- if (copy_from_user(&s32, uset, sizeof(*uset))) -- return -EFAULT; -- -- set->sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32); -- return 0; --} -- - static int restore_ilp32_sigframe(struct pt_regs *regs, - struct ilp32_sigframe __user *sf) - { --- -1.7.7 diff --git a/a/content_digest b/N1/content_digest index 418e338..a40046f 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -248,184 +248,5 @@ "\01:2\0" "fn\00001-ilp32-fix-GET-SET-SIGMASK-request-for-ptrace.patch\0" "b\0" - "From 06f5abeca59069cb41b0b4fdfa06240d3f78910d Mon Sep 17 00:00:00 2001\n" - "From: Zhou Chengming <zhouchengming1@huawei.com>\n" - "Date: Mon, 27 Jun 2016 12:57:02 +0800\n" - "Subject: [PATCH] ilp32: fix {GET,SET}SIGMASK request for ptrace\n" - "\n" - "The function compat_ptrace_request(used by ilp32) don't handle\n" - "{GET,SET}SIGMASK request, so it will be handled by ptrace_request.\n" - "But it's wrong because the compat_sigset_t of ilp32 differs from\n" - "the sigset_t of aarch64. The patch fixes it.\n" - "\n" - "Signed-off-by: Zhou Chengming <zhouchengming1@huawei.com>\n" - "---\n" - " arch/arm64/include/asm/signal_ilp32.h | 22 ++++++++++++\n" - " arch/arm64/kernel/ptrace.c | 62 +++++++++++++++++++++++++++++++++\n" - " arch/arm64/kernel/signal_ilp32.c | 23 +------------\n" - " 3 files changed, 85 insertions(+), 22 deletions(-)\n" - "\n" - "diff --git a/arch/arm64/include/asm/signal_ilp32.h b/arch/arm64/include/asm/signal_ilp32.h\n" - "index 30eff23..ed52607 100644\n" - "--- a/arch/arm64/include/asm/signal_ilp32.h\n" - "+++ b/arch/arm64/include/asm/signal_ilp32.h\n" - "@@ -21,6 +21,28 @@\n" - " int ilp32_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set,\n" - " \t\t\t struct pt_regs *regs);\n" - " \n" - "+static inline int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set)\n" - "+{\n" - "+\tcompat_sigset_t cset;\n" - "+\n" - "+\tcset.sig[0] = set->sig[0] & 0xffffffffull;\n" - "+\tcset.sig[1] = set->sig[0] >> 32;\n" - "+\n" - "+\treturn copy_to_user(uset, &cset, sizeof(*uset));\n" - "+}\n" - "+\n" - "+static inline int get_sigset_t(sigset_t *set,\n" - "+\t\t\t const compat_sigset_t __user *uset)\n" - "+{\n" - "+\tcompat_sigset_t s32;\n" - "+\n" - "+\tif (copy_from_user(&s32, uset, sizeof(*uset)))\n" - "+\t\treturn -EFAULT;\n" - "+\n" - "+\tset->sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);\n" - "+\treturn 0;\n" - "+}\n" - "+\n" - " #else\n" - " \n" - " static inline int ilp32_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set,\n" - "diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c\n" - "index a861105..8d4cad1 100644\n" - "--- a/arch/arm64/kernel/ptrace.c\n" - "+++ b/arch/arm64/kernel/ptrace.c\n" - "@@ -44,6 +44,7 @@\n" - " #include <asm/syscall.h>\n" - " #include <asm/traps.h>\n" - " #include <asm/system_misc.h>\n" - "+#include <asm/signal_ilp32.h>\n" - " \n" - " #define CREATE_TRACE_POINTS\n" - " #include <trace/events/syscalls.h>\n" - "@@ -1231,12 +1232,73 @@ COMPAT_SYSCALL_DEFINE4(aarch32_ptrace, compat_long_t, request, compat_long_t, pi\n" - " \n" - " #endif /* CONFIG_AARCH32_EL0 */\n" - " \n" - "+#ifdef CONFIG_ARM64_ILP32\n" - "+\n" - "+static int compat_ilp32_ptrace(struct task_struct *child, compat_long_t request,\n" - "+\t\t\tcompat_ulong_t addr, compat_ulong_t data)\n" - "+{\n" - "+\tcompat_ulong_t __user *datap = compat_ptr(data);\n" - "+\tint ret;\n" - "+\n" - "+\tswitch (request) {\n" - "+\tcase PTRACE_GETSIGMASK:\n" - "+\t\tif (addr != sizeof(compat_sigset_t)) {\n" - "+\t\t\tret = -EINVAL;\n" - "+\t\t\tbreak;\n" - "+\t\t}\n" - "+\n" - "+\t\tif (put_sigset_t((compat_sigset_t __user *)datap, &child->blocked))\n" - "+\t\t\tret = -EFAULT;\n" - "+\t\telse\n" - "+\t\t\tret = 0;\n" - "+\t\tbreak;\n" - "+\n" - "+\tcase PTRACE_SETSIGMASK: {\n" - "+\t\tsigset_t new_set;\n" - "+\t\tif (addr != sizeof(compat_sigset_t)) {\n" - "+\t\t\tret = -EINVAL;\n" - "+\t\t\tbreak;\n" - "+\t\t}\n" - "+\n" - "+\t\tif (get_sigset_t(&new_set, (compat_sigset_t __user *)datap)) {\n" - "+\t\t\tret = -EFAULT;\n" - "+\t\t\tbreak;\n" - "+\t\t}\n" - "+\n" - "+\t\tsigdelsetmask(&new_set, sigmask(SIGKILL)|sigmask(SIGSTOP));\n" - "+\n" - "+\t\t/*\n" - "+\t\t * Every thread does recalc_sigpending() after resume, so\n" - "+\t\t * retarget_shared_pending() and recalc_sigpending() are not\n" - "+\t\t * called here.\n" - "+\t\t */\n" - "+\t\tspin_lock_irq(&child->sighand->siglock);\n" - "+\t\tchild->blocked = new_set;\n" - "+\t\tspin_unlock_irq(&child->sighand->siglock);\n" - "+\n" - "+\t\tret = 0;\n" - "+\t\tbreak;\n" - "+\t}\n" - "+\n" - "+\tdefault:\n" - "+\t\tret = compat_ptrace_request(child, request, addr, data);\n" - "+\t}\n" - "+\n" - "+\treturn ret;\n" - "+}\n" - "+\n" - "+#endif /* CONFIG_ARM64_ILP32 */\n" - "+\n" - " #ifdef CONFIG_COMPAT\n" - " \n" - " long compat_arch_ptrace(struct task_struct *child, compat_long_t request,\n" - " \t\t\tcompat_ulong_t caddr, compat_ulong_t cdata)\n" - " {\n" - "+#ifdef CONFIG_ARM64_ILP32\n" - "+\treturn compat_ilp32_ptrace(child, request, caddr, cdata);\n" - "+#else\n" - " \treturn compat_ptrace_request(child, request, caddr, cdata);\n" - "+#endif\n" - " }\n" - " \n" - " #endif /* CONFIG_COMPAT */\n" - "diff --git a/arch/arm64/kernel/signal_ilp32.c b/arch/arm64/kernel/signal_ilp32.c\n" - "index 8ca64b9..3ef2749 100644\n" - "--- a/arch/arm64/kernel/signal_ilp32.c\n" - "+++ b/arch/arm64/kernel/signal_ilp32.c\n" - "@@ -28,6 +28,7 @@\n" - " #include <asm/fpsimd.h>\n" - " #include <asm/signal32_common.h>\n" - " #include <asm/signal_common.h>\n" - "+#include <asm/signal_ilp32.h>\n" - " #include <asm/uaccess.h>\n" - " #include <asm/unistd.h>\n" - " #include <asm/ucontext.h>\n" - "@@ -58,28 +59,6 @@ struct ilp32_rt_sigframe {\n" - " \tstruct ilp32_sigframe sig;\n" - " };\n" - " \n" - "-static inline int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set)\n" - "-{\n" - "-\tcompat_sigset_t cset;\n" - "-\n" - "-\tcset.sig[0] = set->sig[0] & 0xffffffffull;\n" - "-\tcset.sig[1] = set->sig[0] >> 32;\n" - "-\n" - "-\treturn copy_to_user(uset, &cset, sizeof(*uset));\n" - "-}\n" - "-\n" - "-static inline int get_sigset_t(sigset_t *set,\n" - "- const compat_sigset_t __user *uset)\n" - "-{\n" - "-\tcompat_sigset_t s32;\n" - "-\n" - "-\tif (copy_from_user(&s32, uset, sizeof(*uset)))\n" - "-\t\treturn -EFAULT;\n" - "-\n" - "-\tset->sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);\n" - "-\treturn 0;\n" - "-}\n" - "-\n" - " static int restore_ilp32_sigframe(struct pt_regs *regs,\n" - " struct ilp32_sigframe __user *sf)\n" - " {\n" - "-- \n" - 1.7.7 -094bdc41ab47d8248cd2e31df34425a28e23c007cf829bf998188e8135fed6f1 +4cb7369270ededc34d629428bbf53976c725a637caff17e72bc7380406706df0
diff --git a/a/1.txt b/N2/1.txt index dfee8b7..aaef462 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -209,3 +209,184 @@ Thanks! > > . > + +-------------- next part -------------- +>From 06f5abeca59069cb41b0b4fdfa06240d3f78910d Mon Sep 17 00:00:00 2001 +From: Zhou Chengming <zhouchengming1@huawei.com> +Date: Mon, 27 Jun 2016 12:57:02 +0800 +Subject: [PATCH] ilp32: fix {GET,SET}SIGMASK request for ptrace + +The function compat_ptrace_request(used by ilp32) don't handle +{GET,SET}SIGMASK request, so it will be handled by ptrace_request. +But it's wrong because the compat_sigset_t of ilp32 differs from +the sigset_t of aarch64. The patch fixes it. + +Signed-off-by: Zhou Chengming <zhouchengming1@huawei.com> +--- + arch/arm64/include/asm/signal_ilp32.h | 22 ++++++++++++ + arch/arm64/kernel/ptrace.c | 62 +++++++++++++++++++++++++++++++++ + arch/arm64/kernel/signal_ilp32.c | 23 +------------ + 3 files changed, 85 insertions(+), 22 deletions(-) + +diff --git a/arch/arm64/include/asm/signal_ilp32.h b/arch/arm64/include/asm/signal_ilp32.h +index 30eff23..ed52607 100644 +--- a/arch/arm64/include/asm/signal_ilp32.h ++++ b/arch/arm64/include/asm/signal_ilp32.h +@@ -21,6 +21,28 @@ + int ilp32_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set, + struct pt_regs *regs); + ++static inline int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set) ++{ ++ compat_sigset_t cset; ++ ++ cset.sig[0] = set->sig[0] & 0xffffffffull; ++ cset.sig[1] = set->sig[0] >> 32; ++ ++ return copy_to_user(uset, &cset, sizeof(*uset)); ++} ++ ++static inline int get_sigset_t(sigset_t *set, ++ const compat_sigset_t __user *uset) ++{ ++ compat_sigset_t s32; ++ ++ if (copy_from_user(&s32, uset, sizeof(*uset))) ++ return -EFAULT; ++ ++ set->sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32); ++ return 0; ++} ++ + #else + + static inline int ilp32_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set, +diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c +index a861105..8d4cad1 100644 +--- a/arch/arm64/kernel/ptrace.c ++++ b/arch/arm64/kernel/ptrace.c +@@ -44,6 +44,7 @@ + #include <asm/syscall.h> + #include <asm/traps.h> + #include <asm/system_misc.h> ++#include <asm/signal_ilp32.h> + + #define CREATE_TRACE_POINTS + #include <trace/events/syscalls.h> +@@ -1231,12 +1232,73 @@ COMPAT_SYSCALL_DEFINE4(aarch32_ptrace, compat_long_t, request, compat_long_t, pi + + #endif /* CONFIG_AARCH32_EL0 */ + ++#ifdef CONFIG_ARM64_ILP32 ++ ++static int compat_ilp32_ptrace(struct task_struct *child, compat_long_t request, ++ compat_ulong_t addr, compat_ulong_t data) ++{ ++ compat_ulong_t __user *datap = compat_ptr(data); ++ int ret; ++ ++ switch (request) { ++ case PTRACE_GETSIGMASK: ++ if (addr != sizeof(compat_sigset_t)) { ++ ret = -EINVAL; ++ break; ++ } ++ ++ if (put_sigset_t((compat_sigset_t __user *)datap, &child->blocked)) ++ ret = -EFAULT; ++ else ++ ret = 0; ++ break; ++ ++ case PTRACE_SETSIGMASK: { ++ sigset_t new_set; ++ if (addr != sizeof(compat_sigset_t)) { ++ ret = -EINVAL; ++ break; ++ } ++ ++ if (get_sigset_t(&new_set, (compat_sigset_t __user *)datap)) { ++ ret = -EFAULT; ++ break; ++ } ++ ++ sigdelsetmask(&new_set, sigmask(SIGKILL)|sigmask(SIGSTOP)); ++ ++ /* ++ * Every thread does recalc_sigpending() after resume, so ++ * retarget_shared_pending() and recalc_sigpending() are not ++ * called here. ++ */ ++ spin_lock_irq(&child->sighand->siglock); ++ child->blocked = new_set; ++ spin_unlock_irq(&child->sighand->siglock); ++ ++ ret = 0; ++ break; ++ } ++ ++ default: ++ ret = compat_ptrace_request(child, request, addr, data); ++ } ++ ++ return ret; ++} ++ ++#endif /* CONFIG_ARM64_ILP32 */ ++ + #ifdef CONFIG_COMPAT + + long compat_arch_ptrace(struct task_struct *child, compat_long_t request, + compat_ulong_t caddr, compat_ulong_t cdata) + { ++#ifdef CONFIG_ARM64_ILP32 ++ return compat_ilp32_ptrace(child, request, caddr, cdata); ++#else + return compat_ptrace_request(child, request, caddr, cdata); ++#endif + } + + #endif /* CONFIG_COMPAT */ +diff --git a/arch/arm64/kernel/signal_ilp32.c b/arch/arm64/kernel/signal_ilp32.c +index 8ca64b9..3ef2749 100644 +--- a/arch/arm64/kernel/signal_ilp32.c ++++ b/arch/arm64/kernel/signal_ilp32.c +@@ -28,6 +28,7 @@ + #include <asm/fpsimd.h> + #include <asm/signal32_common.h> + #include <asm/signal_common.h> ++#include <asm/signal_ilp32.h> + #include <asm/uaccess.h> + #include <asm/unistd.h> + #include <asm/ucontext.h> +@@ -58,28 +59,6 @@ struct ilp32_rt_sigframe { + struct ilp32_sigframe sig; + }; + +-static inline int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set) +-{ +- compat_sigset_t cset; +- +- cset.sig[0] = set->sig[0] & 0xffffffffull; +- cset.sig[1] = set->sig[0] >> 32; +- +- return copy_to_user(uset, &cset, sizeof(*uset)); +-} +- +-static inline int get_sigset_t(sigset_t *set, +- const compat_sigset_t __user *uset) +-{ +- compat_sigset_t s32; +- +- if (copy_from_user(&s32, uset, sizeof(*uset))) +- return -EFAULT; +- +- set->sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32); +- return 0; +-} +- + static int restore_ilp32_sigframe(struct pt_regs *regs, + struct ilp32_sigframe __user *sf) + { +-- +1.7.7 diff --git a/a/2.hdr b/a/2.hdr deleted file mode 100644 index 492e161..0000000 --- a/a/2.hdr +++ /dev/null @@ -1,5 +0,0 @@ -Content-Type: text/plain; charset="gb18030"; - name="0001-ilp32-fix-GET-SET-SIGMASK-request-for-ptrace.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: attachment; - filename="0001-ilp32-fix-GET-SET-SIGMASK-request-for-ptrace.patch" diff --git a/a/2.txt b/a/2.txt deleted file mode 100644 index 6429055..0000000 --- a/a/2.txt +++ /dev/null @@ -1,179 +0,0 @@ -From 06f5abeca59069cb41b0b4fdfa06240d3f78910d Mon Sep 17 00:00:00 2001 -From: Zhou Chengming <zhouchengming1@huawei.com> -Date: Mon, 27 Jun 2016 12:57:02 +0800 -Subject: [PATCH] ilp32: fix {GET,SET}SIGMASK request for ptrace - -The function compat_ptrace_request(used by ilp32) don't handle -{GET,SET}SIGMASK request, so it will be handled by ptrace_request. -But it's wrong because the compat_sigset_t of ilp32 differs from -the sigset_t of aarch64. The patch fixes it. - -Signed-off-by: Zhou Chengming <zhouchengming1@huawei.com> ---- - arch/arm64/include/asm/signal_ilp32.h | 22 ++++++++++++ - arch/arm64/kernel/ptrace.c | 62 +++++++++++++++++++++++++++++++++ - arch/arm64/kernel/signal_ilp32.c | 23 +------------ - 3 files changed, 85 insertions(+), 22 deletions(-) - -diff --git a/arch/arm64/include/asm/signal_ilp32.h b/arch/arm64/include/asm/signal_ilp32.h -index 30eff23..ed52607 100644 ---- a/arch/arm64/include/asm/signal_ilp32.h -+++ b/arch/arm64/include/asm/signal_ilp32.h -@@ -21,6 +21,28 @@ - int ilp32_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set, - struct pt_regs *regs); - -+static inline int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set) -+{ -+ compat_sigset_t cset; -+ -+ cset.sig[0] = set->sig[0] & 0xffffffffull; -+ cset.sig[1] = set->sig[0] >> 32; -+ -+ return copy_to_user(uset, &cset, sizeof(*uset)); -+} -+ -+static inline int get_sigset_t(sigset_t *set, -+ const compat_sigset_t __user *uset) -+{ -+ compat_sigset_t s32; -+ -+ if (copy_from_user(&s32, uset, sizeof(*uset))) -+ return -EFAULT; -+ -+ set->sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32); -+ return 0; -+} -+ - #else - - static inline int ilp32_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set, -diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c -index a861105..8d4cad1 100644 ---- a/arch/arm64/kernel/ptrace.c -+++ b/arch/arm64/kernel/ptrace.c -@@ -44,6 +44,7 @@ - #include <asm/syscall.h> - #include <asm/traps.h> - #include <asm/system_misc.h> -+#include <asm/signal_ilp32.h> - - #define CREATE_TRACE_POINTS - #include <trace/events/syscalls.h> -@@ -1231,12 +1232,73 @@ COMPAT_SYSCALL_DEFINE4(aarch32_ptrace, compat_long_t, request, compat_long_t, pi - - #endif /* CONFIG_AARCH32_EL0 */ - -+#ifdef CONFIG_ARM64_ILP32 -+ -+static int compat_ilp32_ptrace(struct task_struct *child, compat_long_t request, -+ compat_ulong_t addr, compat_ulong_t data) -+{ -+ compat_ulong_t __user *datap = compat_ptr(data); -+ int ret; -+ -+ switch (request) { -+ case PTRACE_GETSIGMASK: -+ if (addr != sizeof(compat_sigset_t)) { -+ ret = -EINVAL; -+ break; -+ } -+ -+ if (put_sigset_t((compat_sigset_t __user *)datap, &child->blocked)) -+ ret = -EFAULT; -+ else -+ ret = 0; -+ break; -+ -+ case PTRACE_SETSIGMASK: { -+ sigset_t new_set; -+ if (addr != sizeof(compat_sigset_t)) { -+ ret = -EINVAL; -+ break; -+ } -+ -+ if (get_sigset_t(&new_set, (compat_sigset_t __user *)datap)) { -+ ret = -EFAULT; -+ break; -+ } -+ -+ sigdelsetmask(&new_set, sigmask(SIGKILL)|sigmask(SIGSTOP)); -+ -+ /* -+ * Every thread does recalc_sigpending() after resume, so -+ * retarget_shared_pending() and recalc_sigpending() are not -+ * called here. -+ */ -+ spin_lock_irq(&child->sighand->siglock); -+ child->blocked = new_set; -+ spin_unlock_irq(&child->sighand->siglock); -+ -+ ret = 0; -+ break; -+ } -+ -+ default: -+ ret = compat_ptrace_request(child, request, addr, data); -+ } -+ -+ return ret; -+} -+ -+#endif /* CONFIG_ARM64_ILP32 */ -+ - #ifdef CONFIG_COMPAT - - long compat_arch_ptrace(struct task_struct *child, compat_long_t request, - compat_ulong_t caddr, compat_ulong_t cdata) - { -+#ifdef CONFIG_ARM64_ILP32 -+ return compat_ilp32_ptrace(child, request, caddr, cdata); -+#else - return compat_ptrace_request(child, request, caddr, cdata); -+#endif - } - - #endif /* CONFIG_COMPAT */ -diff --git a/arch/arm64/kernel/signal_ilp32.c b/arch/arm64/kernel/signal_ilp32.c -index 8ca64b9..3ef2749 100644 ---- a/arch/arm64/kernel/signal_ilp32.c -+++ b/arch/arm64/kernel/signal_ilp32.c -@@ -28,6 +28,7 @@ - #include <asm/fpsimd.h> - #include <asm/signal32_common.h> - #include <asm/signal_common.h> -+#include <asm/signal_ilp32.h> - #include <asm/uaccess.h> - #include <asm/unistd.h> - #include <asm/ucontext.h> -@@ -58,28 +59,6 @@ struct ilp32_rt_sigframe { - struct ilp32_sigframe sig; - }; - --static inline int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set) --{ -- compat_sigset_t cset; -- -- cset.sig[0] = set->sig[0] & 0xffffffffull; -- cset.sig[1] = set->sig[0] >> 32; -- -- return copy_to_user(uset, &cset, sizeof(*uset)); --} -- --static inline int get_sigset_t(sigset_t *set, -- const compat_sigset_t __user *uset) --{ -- compat_sigset_t s32; -- -- if (copy_from_user(&s32, uset, sizeof(*uset))) -- return -EFAULT; -- -- set->sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32); -- return 0; --} -- - static int restore_ilp32_sigframe(struct pt_regs *regs, - struct ilp32_sigframe __user *sf) - { --- -1.7.7 diff --git a/a/content_digest b/N2/content_digest index 418e338..db9fb5d 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -2,37 +2,11 @@ "ref\01466207668-10549-13-git-send-email-ynorov@caviumnetworks.com\0" "ref\05770B041.3040509@huawei.com\0" "ref\020160627053916.GA305@yury-N73SV\0" - "From\0zhouchengming <zhouchengming1@huawei.com>\0" - "Subject\0Re: [PATCH] ilp32: fix {GET,SET}SIGMASK request for ptrace\0" + "From\0zhouchengming1@huawei.com (zhouchengming)\0" + "Subject\0[PATCH] ilp32: fix {GET,SET}SIGMASK request for ptrace\0" "Date\0Mon, 27 Jun 2016 18:30:51 +0800\0" - "To\0Yury Norov <ynorov@caviumnetworks.com>\0" - "Cc\0arnd@arndb.de" - catalin.marinas@arm.com - linux-arm-kernel@lists.infradead.org - linux-kernel@vger.kernel.org - linux-doc@vger.kernel.org - linux-arch@vger.kernel.org - libc-alpha@sourceware.org - schwidefsky@de.ibm.com - heiko.carstens@de.ibm.com - pinskia@gmail.com - broonie@kernel.org - joseph@codesourcery.com - christoph.muellner@theobroma-systems.com - bamvor.zhangjian@huawei.com - szabolcs.nagy@arm.com - klimov.linux@gmail.com - Nathan_Lynch@mentor.com - agraf@suse.de - Prasun.Kapoor@caviumnetworks.com - kilobyte@angband.pl - geert@linux-m68k.org - philipp.tomsich@theobroma-systems.com - manuel.montezelo@gmail.com - linyongting@huawei.com - maxim.kuvyrkov@linaro.org - " davem@davemloft.net\0" - "\01:1\0" + "To\0linux-arm-kernel@lists.infradead.org\0" + "\00:1\0" "b\0" "On 2016/6/27 13:39, Yury Norov wrote:\n" "> Hi Zhou,\n" @@ -244,11 +218,10 @@ ">> struct\n" ">\n" "> .\n" - > - "\01:2\0" - "fn\00001-ilp32-fix-GET-SET-SIGMASK-request-for-ptrace.patch\0" - "b\0" - "From 06f5abeca59069cb41b0b4fdfa06240d3f78910d Mon Sep 17 00:00:00 2001\n" + ">\n" + "\n" + "-------------- next part --------------\n" + ">From 06f5abeca59069cb41b0b4fdfa06240d3f78910d Mon Sep 17 00:00:00 2001\n" "From: Zhou Chengming <zhouchengming1@huawei.com>\n" "Date: Mon, 27 Jun 2016 12:57:02 +0800\n" "Subject: [PATCH] ilp32: fix {GET,SET}SIGMASK request for ptrace\n" @@ -428,4 +401,4 @@ "-- \n" 1.7.7 -094bdc41ab47d8248cd2e31df34425a28e23c007cf829bf998188e8135fed6f1 +052ab0af9a8d8f6d98a623fffc8a5d048f07e6c3dccf07acd21f1375533e00bf
diff --git a/a/2.txt b/N3/2.txt index 6429055..0ec47f5 100644 --- a/a/2.txt +++ b/N3/2.txt @@ -1,4 +1,4 @@ -From 06f5abeca59069cb41b0b4fdfa06240d3f78910d Mon Sep 17 00:00:00 2001 +>From 06f5abeca59069cb41b0b4fdfa06240d3f78910d Mon Sep 17 00:00:00 2001 From: Zhou Chengming <zhouchengming1@huawei.com> Date: Mon, 27 Jun 2016 12:57:02 +0800 Subject: [PATCH] ilp32: fix {GET,SET}SIGMASK request for ptrace diff --git a/a/content_digest b/N3/content_digest index 418e338..184a4e7 100644 --- a/a/content_digest +++ b/N3/content_digest @@ -6,32 +6,32 @@ "Subject\0Re: [PATCH] ilp32: fix {GET,SET}SIGMASK request for ptrace\0" "Date\0Mon, 27 Jun 2016 18:30:51 +0800\0" "To\0Yury Norov <ynorov@caviumnetworks.com>\0" - "Cc\0arnd@arndb.de" - catalin.marinas@arm.com - linux-arm-kernel@lists.infradead.org - linux-kernel@vger.kernel.org - linux-doc@vger.kernel.org - linux-arch@vger.kernel.org - libc-alpha@sourceware.org - schwidefsky@de.ibm.com - heiko.carstens@de.ibm.com - pinskia@gmail.com - broonie@kernel.org - joseph@codesourcery.com - christoph.muellner@theobroma-systems.com - bamvor.zhangjian@huawei.com - szabolcs.nagy@arm.com - klimov.linux@gmail.com - Nathan_Lynch@mentor.com - agraf@suse.de - Prasun.Kapoor@caviumnetworks.com - kilobyte@angband.pl - geert@linux-m68k.org - philipp.tomsich@theobroma-systems.com - manuel.montezelo@gmail.com - linyongting@huawei.com - maxim.kuvyrkov@linaro.org - " davem@davemloft.net\0" + "Cc\0<arnd@arndb.de>" + <catalin.marinas@arm.com> + <linux-arm-kernel@lists.infradead.org> + <linux-kernel@vger.kernel.org> + <linux-doc@vger.kernel.org> + <linux-arch@vger.kernel.org> + <libc-alpha@sourceware.org> + <schwidefsky@de.ibm.com> + <heiko.carstens@de.ibm.com> + <pinskia@gmail.com> + <broonie@kernel.org> + <joseph@codesourcery.com> + <christoph.muellner@theobroma-systems.com> + <bamvor.zhangjian@huawei.com> + <szabolcs.nagy@arm.com> + <klimov.linux@gmail.com> + <Nathan_Lynch@mentor.com> + <agraf@suse.de> + <Prasun.Kapoor@caviumnetworks.com> + <kilobyte@angband.pl> + <geert@linux-m68k.org> + <philipp.tomsich@theobroma-systems.com> + <manuel.montezelo@gmail.com> + <linyongting@huawei.com> + <maxim.kuvyrkov@linaro.org> + " <davem@davemloft.net>\0" "\01:1\0" "b\0" "On 2016/6/27 13:39, Yury Norov wrote:\n" @@ -248,7 +248,7 @@ "\01:2\0" "fn\00001-ilp32-fix-GET-SET-SIGMASK-request-for-ptrace.patch\0" "b\0" - "From 06f5abeca59069cb41b0b4fdfa06240d3f78910d Mon Sep 17 00:00:00 2001\n" + ">From 06f5abeca59069cb41b0b4fdfa06240d3f78910d Mon Sep 17 00:00:00 2001\n" "From: Zhou Chengming <zhouchengming1@huawei.com>\n" "Date: Mon, 27 Jun 2016 12:57:02 +0800\n" "Subject: [PATCH] ilp32: fix {GET,SET}SIGMASK request for ptrace\n" @@ -428,4 +428,4 @@ "-- \n" 1.7.7 -094bdc41ab47d8248cd2e31df34425a28e23c007cf829bf998188e8135fed6f1 +46c4c8b49ff94bf8e98dea82410cd1e0aae3fedf54e1ef2250e74ed9f7fc524c
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.