]> granicus.if.org Git - strace/commitdiff
arch_sigreturn: change tracee address type from long to unsigned long
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 25 Dec 2016 09:47:03 +0000 (09:47 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 25 Dec 2016 11:32:46 +0000 (11:32 +0000)
* linux/arm/arch_sigreturn.c (arch_sigreturn): Change addr variable
type from long to unsigned long.
* linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise.
* linux/m68k/arch_sigreturn.c (arch_sigreturn): Likewise.
* linux/powerpc/arch_sigreturn.c (arch_sigreturn): Likewise.
* linux/s390/arch_sigreturn.c (arch_sigreturn): Likewise.
* linux/sparc/arch_sigreturn.c (arch_sigreturn): Likewise.
* linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise.
* linux/crisv10/arch_sigreturn.c (arch_sigreturn): Change the type
of addr and regs variables from long to unsigned long.
* linux/mips/arch_sigreturn.c (arch_sigreturn): Change addr variable
type from long to kernel_ureg_t.
* linux/x86_64/arch_sigreturn.c (arch_sigreturn): Change the type
of offset and addr variables from long to kernel_ureg_t.

linux/arm/arch_sigreturn.c
linux/crisv10/arch_sigreturn.c
linux/ia64/arch_sigreturn.c
linux/m68k/arch_sigreturn.c
linux/mips/arch_sigreturn.c
linux/powerpc/arch_sigreturn.c
linux/s390/arch_sigreturn.c
linux/sparc/arch_sigreturn.c
linux/tile/arch_sigreturn.c
linux/x86_64/arch_sigreturn.c

index 28726a27f4eaee52a141bebf5313e90e09eb3c5c..9a8584ebdc1b34f2710ac3069b6afaeb3eaa93de 100644 (file)
@@ -5,7 +5,7 @@ arch_sigreturn(struct tcb *tcp)
 #define SIZEOF_STRUCT_SIGCONTEXT (21 * 4)
 #define OFFSETOF_STRUCT_UCONTEXT_UC_SIGMASK (5 * 4 + SIZEOF_STRUCT_SIGCONTEXT)
 
-       const long addr =
+       const unsigned long addr =
 #ifdef AARCH64
                tcp->currpers == 0 ?
                        (*aarch64_sp_ptr + SIZEOF_STRUCT_SIGINFO +
index 9086d5336dd3a453955cfcb080454497588c2ef9..d45e3bacf5e32c4234ff3307042183d23e43448b 100644 (file)
@@ -1,13 +1,14 @@
 static void
 arch_sigreturn(struct tcb *tcp)
 {
-       long regs[PT_MAX + 1];
+       unsigned long regs[PT_MAX + 1];
 
-       if (ptrace(PTRACE_GETREGS, tcp->pid, NULL, (long)regs) < 0) {
+       if (ptrace(PTRACE_GETREGS, tcp->pid, NULL, regs) < 0) {
                perror_msg("sigreturn: PTRACE_GETREGS");
                return;
        }
-       const long addr = regs[PT_USP] + offsetof(struct sigcontext, oldmask);
+       const unsigned long addr =
+               regs[PT_USP] + offsetof(struct sigcontext, oldmask);
 
        tprints("{mask=");
        print_sigset_addr_len(tcp, addr, NSIG / 8);
index 8b54d6c15a1367bc1dd12b7a10bf0ebc92b77b2d..352ca6829b8716f440f4caf87d8438193861a9ff 100644 (file)
@@ -3,9 +3,9 @@ arch_sigreturn(struct tcb *tcp)
 {
        /* offsetof(struct sigframe, sc) */
 #define OFFSETOF_STRUCT_SIGFRAME_SC    0xA0
-       const long addr = *ia64_frame_ptr + 16 +
-                         OFFSETOF_STRUCT_SIGFRAME_SC +
-                         offsetof(struct sigcontext, sc_mask);
+       const unsigned long addr = *ia64_frame_ptr + 16 +
+                                  OFFSETOF_STRUCT_SIGFRAME_SC +
+                                  offsetof(struct sigcontext, sc_mask);
        tprints("{mask=");
        print_sigset_addr_len(tcp, addr, NSIG / 8);
        tprints("}");
index 12e8bded6dc4c33893bc4c5f0503d1aae4519498..ff3234583470f8096accd838d3650677c7f0b787 100644 (file)
@@ -1,7 +1,7 @@
 static void
 arch_sigreturn(struct tcb *tcp)
 {
-       long addr;
+       unsigned long addr;
 
        /* Fetch pointer to struct sigcontext.  */
        if (umove(tcp, *m68k_usp_ptr + 2 * sizeof(int), &addr) < 0)
index 3095fe59131c90d2587b54ab1e03523d9b806a27..ad972fe048f2cee552ccb5430014b1619820da1d 100644 (file)
@@ -6,8 +6,8 @@ arch_sigreturn(struct tcb *tcp)
         * offsetof(struct sigframe, sf_mask) ==
         * sizeof(sf_ass) + sizeof(sf_pad) + sizeof(struct sigcontext)
         */
-       const long addr = mips_REG_SP + 6 * 4 +
-                         sizeof(struct sigcontext);
+       const kernel_ureg_t addr = mips_REG_SP + 6 * 4 +
+                                  sizeof(struct sigcontext);
 #else
        /*
         * This decodes rt_sigreturn.
@@ -16,8 +16,8 @@ arch_sigreturn(struct tcb *tcp)
         * offsetof(struct rt_sigframe, rs_uc) ==
         * sizeof(sf_ass) + sizeof(sf_pad) + sizeof(struct siginfo)
         */
-       const long addr = mips_REG_SP + 6 * 4 + 128 +
-                         offsetof(struct ucontext, uc_sigmask);
+       const kernel_ureg_t addr = mips_REG_SP + 6 * 4 + 128 +
+                                  offsetof(struct ucontext, uc_sigmask);
 #endif
 
        tprints("{mask=");
index c28a196215ae6e0c077b4446d3134f494435177b..644e05027756ac8934cf6d1051bc2820499a13a3 100644 (file)
@@ -1,19 +1,19 @@
 static void
 arch_sigreturn(struct tcb *tcp)
 {
-       long esp = ppc_regs.gpr[1];
+       unsigned long addr = ppc_regs.gpr[1];
        struct sigcontext sc;
 
        /* Skip dummy stack frame. */
 #ifdef POWERPC64
        if (current_personality == 0)
-               esp += 128;
+               addr += 128;
        else
 #endif
-               esp += 64;
+               addr += 64;
 
-       if (umove(tcp, esp, &sc) < 0) {
-               tprintf("{mask=%#lx}", esp);
+       if (umove(tcp, addr, &sc) < 0) {
+               tprintf("{mask=%#lx}", addr);
        } else {
                unsigned long mask[NSIG / 8 / sizeof(long)];
 #ifdef POWERPC64
index 00549ba87e8ed36da55c5f9b7d850c9deb69a341..3990ae6f79f4e03930e207ff52f35263f3bff0a7 100644 (file)
@@ -1,8 +1,8 @@
 static void
 arch_sigreturn(struct tcb *tcp)
 {
-       long mask[NSIG / 8 / sizeof(long)];
-       const long addr = *s390_frame_ptr + __SIGNAL_FRAMESIZE;
+       unsigned long mask[NSIG / 8 / sizeof(long)];
+       const unsigned long addr = *s390_frame_ptr + __SIGNAL_FRAMESIZE;
 
        if (umove(tcp, addr, &mask) < 0) {
                tprintf("{mask=%#lx}", addr);
index 0c0e5112e9b14ddaafac9fe52857043eb8fbdc72..dca441430ffe64534608f49c9eec1e1be5b51dec 100644 (file)
@@ -11,8 +11,8 @@
 static void
 arch_sigreturn(struct tcb *tcp)
 {
-       long fp = sparc_regs.u_regs[U_REG_FP] +
-                 SIZEOF_STRUCT_SPARC_STACKF + SIZEOF_STRUCT_PT_REGS;
+       unsigned long addr = sparc_regs.u_regs[U_REG_FP] +
+               SIZEOF_STRUCT_SPARC_STACKF + SIZEOF_STRUCT_PT_REGS;
        struct {
                unsigned int mask;
                char fpu_save[PERSONALITY_WORDSIZE];
@@ -20,8 +20,8 @@ arch_sigreturn(struct tcb *tcp)
                unsigned int extramask[NSIG / 8 / sizeof(int) - 1];
        } frame;
 
-       if (umove(tcp, fp, &frame) < 0) {
-               tprintf("{mask=%#lx}", fp);
+       if (umove(tcp, addr, &frame) < 0) {
+               tprintf("{mask=%#lx}", addr);
        } else {
                unsigned int mask[NSIG / 8 / sizeof(int)];
 
index b1182fced2f5f1fd49986ff617128d13f62492e2..53a3fbbe812a48c3a7a01804f96d5c43c8be2b5b 100644 (file)
@@ -3,8 +3,8 @@ arch_sigreturn(struct tcb *tcp)
 {
        /* offset of ucontext in the kernel's sigframe structure */
 #define SIGFRAME_UC_OFFSET C_ABI_SAVE_AREA_SIZE + sizeof(siginfo_t)
-       const long addr = tile_regs.sp + SIGFRAME_UC_OFFSET +
-                         offsetof(struct ucontext, uc_sigmask);
+       const unsigned long addr = tile_regs.sp + SIGFRAME_UC_OFFSET +
+                                  offsetof(struct ucontext, uc_sigmask);
 
        tprints("{mask=");
        print_sigset_addr_len(tcp, addr, NSIG / 8);
index 1de0a0ad258c2d462b9e7046e1d7a4545b9fee4f..46dce4857badb4edde02a6dd6fc64946b917a5fe 100644 (file)
@@ -18,14 +18,14 @@ arch_sigreturn(struct tcb *tcp)
 #define        X86_64_SIGMASK_OFFSET   offsetof(struct ucontext, uc_sigmask)
 #define        X32_SIGMASK_OFFSET      sizeof(ucontext_x32_header)
 
-       const unsigned long offset =
+       const kernel_ureg_t offset =
 #ifdef X32
                X32_SIGMASK_OFFSET;
 #else
                current_personality == 2 ? X32_SIGMASK_OFFSET :
                                           X86_64_SIGMASK_OFFSET;
 #endif
-       const unsigned long addr = (unsigned long) *x86_64_rsp_ptr + offset;
+       const kernel_ureg_t addr = (kernel_ureg_t) *x86_64_rsp_ptr + offset;
        tprints("{mask=");
        print_sigset_addr_len(tcp, addr, NSIG / 8);
        tprints("}");