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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130121225517.GV4939@ZenIV.linux.org.uk>
Date:	Mon, 21 Jan 2013 22:55:17 +0000
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Nicolas Dichtel <nicolas.dichtel@...nd.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-arch@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
	Tony Luck <tony.luck@...el.com>
Subject: [RFC] making HAVE_SYSCALL_WRAPPERS universal (Re: Issues with "x86,
 um: switch to generic fork/vfork/clone" commit)

[linux-arch Cc'd]
On Mon, Jan 21, 2013 at 02:30:11AM +0000, Al Viro wrote:

> Neither do I, to be honest.  It might be saving us a few cycles on
> some architectures, but I'd like to see examples of that.  amd64
> doesn't seem to be one, at least...

*grumble*

OK, there is one problem - SYSCALL_ALIAS() is as arch-dependent as
cond_syscall().  As far as I can tell, with cond_syscall() we have
the following variants:
	1) alpha, mips
.weak foo
foo = sys_ni_syscall
	2) itanic, ppc
asmlinkage long x (void) __attribute__((weak,alias("sys_ni_syscall")))
	3) very common - most of the architectures
.weak foo
.set foo sys_ni_syscall
	3a) blackfin, h8300 - same as (3), except that asm symbols get
underscore prepended.
.weak _foo
.set _foo _sys_ni_syscall

For SYSCALL_ALIAS(foo,bar):
	1) alpha, mips
foo = bar
.globl foo
	2) ppc64
.globl foo
.set foo bar
.globl .foo
.set .foo .bar
[note that ppc64 cond_syscall ends up generating similar pair, only with
.globl replaced with .weak]
	3) s390, sparc, tile
.globl foo
.set foo bar

I suspect that (3) here should cover the same things as (3,3a) for
cond_syscalls(), with the same "prepend _" variation on blackfin/h8300.
I really wonder what's going on with ppc64, though - as far as I can
tell, .foo is the real function there, while foo is a OPD entry refering
to it.  Do we have anything similar on other architectures?  And what
about itanic?  After looking at the assembler generated by cond_syscall
there, I suspect that
foo# = bar#
.globl foo#
would be the right answer there, but I'd really like somebody familiar with
ia64 to confirm that...

Another question: what's the following comment from spu_callbacks.c about?
 * 4. They are optional and we can't rely on them being
 *    linked into the kernel. Unfortunately, the cond_syscall
 *    helper does not work here as it does not add the necessary
 *    opd symbols:
 *      mbind, mq_open, ipc, ...
What isn't added?  sys_ni_syscall is an OPD entry and weak aliases for it
*are* created.  That comment predates the conversion of cond_syscall()
definition to the current one; it used to be
.weak .foo
.set .foo .sys_ni_syscall
and that wouldn't have created the second alias; is it simply obsolete?
Note that mbind and friends still are not available to SPU; should that
be changed now that we can do that?

I've tried to sanitize cond_syscall/SYSCALL_ALIAS situation; the tree is in
git.kernel.org/pub/scm/linux/kernel/git/viro/signal experimental-syscalls
NOTE: this is absolutely untested and might very well blow up
on any number of architectures.

Review and comments would be very welcome.

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