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] [day] [month] [year] [list]
Date:	Sat, 2 Jun 2007 00:27:56 +0100
From:	Russell King <rmk+lkml@....linux.org.uk>
To:	Deepak Saxena <dsaxena@...xity.net>, Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH RT] Fix NR_syscalls in ARM

On Sat, Jun 02, 2007 at 12:18:40AM +0100, Russell King wrote:
> On Fri, Jun 01, 2007 at 04:10:53PM -0700, Deepak Saxena wrote:
> > The -rt patch adds a NR_syscalls symbol to the arm/unistd.h but
> > it is not the correct value as there are 348 syscalls on ARM
> > and the existing change sets the symbol to 322.
> > 
> > Russell: Why isn't this in mainline? Other arches all seem to have 
> > this symbol already defined.
> 
> The hint is that it isn't in mainline; it's just plainly not required.
> It's also the wrong place to define it; it's not a property that
> unistd.h should concern itself with - it's a property of the kernel's
> branch table for calling the syscalls, and on ARM we calculate that
> number directly from the size of the kernel's branch table.
> 
> It's also not just last_syscall_number+1 since the table is sized to
> make the assembly easy - iow, a number divisible by 4.
> 
> So all in all, NR_syscalls in unistd.h is just utterly wrong.

BTW, it should be pointed out that you've found the exact reason why
putting it in unistd.h is _wrong_.  It's all to easy for it to get
out of sync with updates to the place where it really matters - the
code which bounds-checks the syscall number (that being the assembly
code which indexes the branch table.)

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
-
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