lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120907195414.GG13973@ZenIV.linux.org.uk>
Date:	Fri, 7 Sep 2012 20:54:14 +0100
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	Catalin Marinas <catalin.marinas@....com>,
	linux-arch@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 17/31] arm64: System calls handling

On Fri, Sep 07, 2012 at 07:43:36PM +0000, Arnd Bergmann wrote:
> > +       asm(    "add    x0, %0, %1\n\t"
> > +               "mov    x1, %2\n\t"
> > +               "mov    x2, %3\n\t"
> > +               "bl     memmove\n\t"    /* copy regs to top of stack */
> > +               "mov    x27, #0\n\t"    /* not a syscall */
> > +               "mov    x28, %0\n\t"    /* thread structure */
> > +               "mov    sp, x0\n\t"     /* reposition stack pointer */
> > +               "b      ret_to_user"
> > +               :
> > +               : "r" (current_thread_info()),
> > +                 "Ir" (THREAD_START_SP - sizeof(regs)),
> > +                 "r" (&regs),
> > +                 "Ir" (sizeof(regs))
> > +               : "x0", "x1", "x2", "x27", "x28", "x30", "memory");

This should just become ret_from_kernel_execve(); FWIW, arm variant is
ENTRY(ret_from_kernel_execve)
        mov     why, #0                 @ not a syscall
        str     why, [r1, #S_R0]        @ ... and we want 0 in ->ARM_r0 as well
        mov     r2, #S_FRAME_SIZE
        bl      memmove                 @ copy regs to normal location; return
                                        @ value is in r0 and it's the same as
                                        @ the first argument, so r0 is unchanged.
        get_thread_info tsk             @ thread structure
        mov     sp, r0                  @ stack pointer just under pt_regs
        b       ret_slow_syscall

and AFAICS you want pretty much the same, modulo different registers - 'why'
(aka r8) seems to correspond to your x27, 'tsk' (aka r9) - to x28 and the rest
matches one-to-one: x1.. for arguments in place of r1.. and x0 for return value
(instead of r0)...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ