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]
Date:	Thu, 10 Sep 2009 09:31:25 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
Cc:	linux-kernel@...r.kernel.org, Oren Laadan <orenl@...columbia.edu>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Alexey Dobriyan <adobriyan@...il.com>,
	Pavel Emelyanov <xemul@...nvz.org>,
	Andrew Morton <akpm@...l.org>, torvalds@...ux-foundation.org,
	mikew@...gle.com, mingo@...e.hu, hpa@...or.com,
	Nathan Lynch <nathanl@...tin.ibm.com>,
	Containers <containers@...ts.linux-foundation.org>,
	sukadev@...ibm.com
Subject: Re: [RFC][v6][PATCH 8/9]: Define clone_with_pids() syscall

On Thursday 10 September 2009, Sukadev Bhattiprolu wrote:
> 
> +int sys_clone_with_pids(struct pt_regs *regs)
> +{
> +       unsigned long clone_flags;
> +       unsigned long newsp;
> +       int __user *parent_tidptr;
> +       int __user *child_tidptr;
> +       struct pid_set __user *upid_setp;
> +
> +       clone_flags = regs->bx;
> +       newsp = regs->cx;
> +       parent_tidptr = (int __user *)regs->dx;
> +       child_tidptr = (int __user *)regs->di;
> +       upid_setp = (struct pid_set __user *)regs->bp;
> +
> +       if (!newsp)
> +               newsp = regs->sp;
> +
> +       return do_fork_with_pids(clone_flags, newsp, regs, 0, parent_tidptr,
> +                       child_tidptr, upid_setp);
> +}

I wonder if we can avoid spreading copies of this function across
all architectures.

Would it be possible to define it like this?

asmlinkage long
clone_with_pids(int flags, unsigned long child_stack_base, int __user *parent_tid_ptr,
                       int __user *child_tid_ptr, struct pid_set __user *pid_setp)
{
	if (!child_stack_base) {
		struct pt_regs *regs;

		regs = task_pt_regs(current);
		child_stack_base = user_stack_pointer(regs);
	}

	return do_fork_with_pids(clone_flags, child_stack_base, 0,
		parent_tid_ptr, child_tid_ptr, pid_setp);
}

	Arnd <><

--
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