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: <474B7175.3030002@zytor.com>
Date:	Mon, 26 Nov 2007 17:23:01 -0800
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Ulrich Drepper <drepper@...hat.com>
CC:	Linus Torvalds <torvalds@...ux-foundation.org>,
	David Miller <davem@...emloft.net>,
	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	mingo@...e.hu, tglx@...utronix.de
Subject: Re: [PATCHv4 5/6] Allow setting O_NONBLOCK flag for new sockets

Ulrich Drepper wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> H. Peter Anvin wrote:
>> No.
>>
>> I already said I'm not looking at changing the calling convention for
>> existing syscalls.
> 
> I did not suggest or ask for that at all.
> 
> I was asking you to consider the real implementation details for a new
> syscall mechanism.
> 
> We do not want to abandon the use of syscall/sysenter and go back to int
> (on x86/x86-64).  This means that you have to come up with a mechanism
> which hooks into the current syscall/sysenter path while preserving full
> backward compatibility.
> 
> Now it's your turn.  How do you do this without additional costs?
> 

- Add sys_new_call to the syscall table
- Create a stub thunk:

asmlinkage long sys_old_call(long parm1, long parm2, long parm3)
{
	return sys_new_call(parm1, parm2, parm3, 0);
}

We have 2^n examples on this in the kernel already.

Or, if the new syscall requires more than 6 parameters (with the current 
convention):

asmlinkage long sys_new_call6(long parm1, long parm2, long parm3,
			      long parm4, long parm5,
			      long __user *additional)
{
	long xparm[3];	/* 8 parameters, total */

	if (copy_from_user(xparm, additional, sizeof xparm)
	    != sizeof xparm)
		return -EFAULT;

	return sys_new_call(parm1, parm2, parm3, parm4, parm5,
			    xparm[0], xparm[1], xparm[2]);
}

This is a fixed-size copy from userspace, which obviously cannot be avoided.

The C version isn't optimal, obviously, hence my mentioning the 
possibility of doing it in the arch layer.

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