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: <20101008053656.GU19804@ZenIV.linux.org.uk>
Date:	Fri, 8 Oct 2010 06:36:56 +0100
From:	Al Viro <viro@...IV.linux.org.uk>
To:	"Maciej W. Rozycki" <macro@...esourcery.com>
Cc:	David Daney <ddaney@...iumnetworks.com>,
	Al Viro <viro@....linux.org.uk>, ralf@...ux-mips.org,
	linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
	"Maciej W. Rozycki" <macro@...ux-mips.org>
Subject: Re: [PATCH 3/5] mips: sanitize restart logics

On Thu, Sep 30, 2010 at 02:50:17AM +0100, Maciej W. Rozycki wrote:
> On Wed, 29 Sep 2010, David Daney wrote:
>  Not exactly.  These GNU C library functions rely on the magic value of 
> "1" there to recognise contexts they created themselves and which must 
> therefore be handled by themselves internally (these contexts are not 
> complete and only preserve the call-saved registers as specified by the 
> respective MIPS ABIs, and are therefore unsafe to be passed to the 
> rt_sigreturn(2) syscall).  All the other values, including of course "0", 
> are not treated specially and the context is passed to rt_sigreturn(2) as 
> usually.  This only matters in cases where e.g. setcontext(3) is used to 
> exit from or return to a signal handler.

Nothing has changed in that respect; setup_sigcontext() (and its counterparts)
do _not_ use regs->regs[0].  Note
        err |= __put_user(0, &sc->sc_regs[0]);
        for (i = 1; i < 32; i++)
                err |= __put_user(regs->regs[i], &sc->sc_regs[i]);
in there.  The whole point of ->regs[0] uses (both original and modified)
is that $0 is constant 0 and thus the kernel is free to use that member
of pt_regs to indicate that syscall restart might be needed.  So's libc,
for that matter (to distinguish between sigreturn and setcontext ones).
When sigframe is created we still discard the value - the fragment above
is not modified at all.

BTW, with original code regs->regs[0] *can* be 1, if you are leaving syscall
with -EINVAL.  It won't reach the userland, though.
--
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