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: <20100926222828.GA19804@ZenIV.linux.org.uk>
Date:	Sun, 26 Sep 2010 23:28:28 +0100
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Ben Hutchings <ben@...adent.org.uk>
Cc:	LKML <linux-kernel@...r.kernel.org>, linux-alpha@...r.kernel.org
Subject: Re: [PATCH 2/2] alpha: Make sys_getxpid() call do_getppid()

On Sun, Sep 26, 2010 at 04:13:11PM +0100, Ben Hutchings wrote:
> sys_getxpid() was not following RCU protocol or considering namespace
> visibility for the parent pid.  Change it to call do_geptpid() which
> does the right thing.
> 
> Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
> ---
> This is totally untested, and I've never written Alpha assembly before,
> so this definitely needs review and testing by an Alpha porter.
> 
> I've left the shortcut tgid lookup there as I assume it is still valid.

I think I have a better variant, getting rid of asm magic completely.
Basically, in ptrace.h have
#define current_pt_regs() \
        ((struct pt_regs *)(current_thread_info() + 2*PAGE_SIZE) - 1)

(and turn force_successful_syscall_return() into (current_pt_regs()->r0 = 0),
while we are at it) and do what I'm doing for e.g. getxgid and alpha_pipe:
SYSCALL_DEFINE0(getxgid)
{
        struct cred *cred = current->cred;
        current_pt_regs()->r20 = cred->egid;
        return cred->gid;
}

SYSCALL_DEFINE0(alpha_pipe)
{
        int fd[2];
        int res = do_pipe_flags(&fd, 0);
        if (!res) {
                /* The return values are in $0 and $20.  */
                current_pt_regs()->r20 = fd[1];
                res = fd[0];
        }
        return res;
}

I planned to hold it back until the merge window, since it's not a bugfix,
but with that one... what the hell, might as well do it.  Less asm glue
is a Good Thing(tm).

One problem with your patch, though:

; git grep do_getppid
;

IOW, which tree is that against?
--
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