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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Sun, 18 Mar 2007 13:42:42 -0700 (PDT)
From:	Davide Libenzi <davidel@...ilserver.org>
To:	Arnd Bergmann <arnd@...db.de>
cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Oleg Nesterov <oleg@...sign.ru>
Subject: Re: [patch 5/13] signal/timer/event fds v6 - signalfd compat code
 ...

On Sat, 17 Mar 2007, Arnd Bergmann wrote:

> On Friday 16 March 2007 01:22:15 Davide Libenzi wrote:
> > +asmlinkage long compat_sys_signalfd(int ufd,
> > +                                   const compat_sigset_t __user *sigmask,
> > +                                   compat_size_t sigsetsize)
> > +{
> > +       compat_sigset_t ss32;
> > +       sigset_t tmp;
> > +       sigset_t __user *ksigmask;
> > +
> > +       if (sigsetsize != sizeof(compat_sigset_t))
> > +               return -EINVAL;
> > +       if (copy_from_user(&ss32, sigmask, sizeof(ss32)))
> > +               return -EFAULT;
> > +       sigset_from_compat(&tmp, &ss32);
> > +       ksigmask = compat_alloc_user_space(sizeof(sigset_t));
> > +       if (copy_to_user(ksigmask, &tmp, sizeof(sigset_t)))
> > +               return -EFAULT;
> > +
> > +       return sys_signalfd(ufd, ksigmask, sizeof(sigset_t));
> > +}
> 
> Doing the compat_alloc_user_space() magic obviously makes the 32 bit
> emulation code less efficient. How about having a
> 
> long do_signalfd(int ufd, const sigset_t *sigmask, size_t sigsetsize);
> 
> that is called directly by both sys_signalfd and compat_sys_signalfd?
> Same obviously applies also to do_timerfd.

Hmm,  copy_*_user (one or two moves) and compat_alloc_user_space are 
pretty fast...



- Davide


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ