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:	Tue, 9 Jun 2009 19:52:47 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	liqin.chen@...plusct.com
Cc:	linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	torvalds@...ux-foundation.org
Subject: Re: [PATCH 22/27] score: create kernel files signal.c sys_score.c time.c

On Tuesday 09 June 2009, liqin.chen@...plusct.com wrote:
> +asmlinkage long sys_mmap(unsigned long addr, size_t len,
> +                       unsigned long prot, unsigned long flags,
> +                       unsigned long fd, off_t offset)
> +{
> +       int err = -EINVAL;
> +
> +       if (offset & ~PAGE_MASK) {
> +               printk(KERN_INFO "no pagemask in mmap\r\n");
> +               goto out;
> +       }
> +
> +       err = sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
> +out:
> +       return err;
> +}

A 32 bit kernel should only need sys_mmap2, not sys_mmap, because it is
trivial to convert in user space.

> +
> +asmlinkage long score_vfork(struct pt_regs *regs)
> +{
> +       return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->regs[0],
> +                                               regs, 0, NULL, NULL);
> +}
> +
> +/*
> + * Fork a new task - this creates a new program thread.
> + * This is called indirectly via a small wrapper
> + */
> +asmlinkage int
> +score_fork(struct pt_regs *regs)
> +{
> +       return do_fork(SIGCHLD, regs->regs[0], regs, 0, NULL, NULL);
> +}

Similarly, you should not need vfork and fork any more, because they can
be handled in user space through clone().

	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