[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJfpegv0iJtzukJMbWR2n7ANxAQmLnf+ekRfmf8V5RdyK20w6Q@mail.gmail.com>
Date: Wed, 23 Apr 2014 14:00:51 +0200
From: Miklos Szeredi <miklos@...redi.hu>
To: Russell King - ARM Linux <linux@....linux.org.uk>
Cc: Wade Farnsworth <wade_farnsworth@...tor.com>,
Al Viro <viro@...iv.linux.org.uk>,
linux-arch <linux-arch@...r.kernel.org>,
Kernel Mailing List <linux-kernel@...r.kernel.org>,
Miklos Szeredi <mszeredi@...e.cz>
Subject: Re: [PATCH 02/15] arm: __NR_syscalls fix
On Wed, Apr 23, 2014 at 12:27 PM, Russell King - ARM Linux
<linux@....linux.org.uk> wrote:
> On Fri, Apr 11, 2014 at 01:45:02PM +0100, Russell King - ARM Linux wrote:
>> On Fri, Apr 11, 2014 at 02:02:32PM +0200, Miklos Szeredi wrote:
>> > On Fri, Apr 11, 2014 at 1:54 PM, Russell King - ARM Linux
>> > <linux@....linux.org.uk> wrote:
>> > > On Fri, Apr 11, 2014 at 01:50:50PM +0200, Miklos Szeredi wrote:
>> > >> Yes, and the padding will be of wrong length if NR_syscalls is
>> > >> incorrect (which may be Oopsable?). At least that is my impression
>> > >> from a casual glance.
>> > >
>> > > Please explain.
>> >
>> > Look at ending lines of arch/arm/kernel/calls.S: if NR_syscalls is a
>> > multiple of 4, then syscalls_padding will be zero. I.e. no padding
>> > despite the fact that there is in fact only 382 system calls in table
>> > and there should be 2 sys_ni_syscall pads.
>>
>> Hmm, it looks like you're right... this used to work fine until...
>>
>> commit 1f66e06fb6414732bef7bf4a071ef76a837badec
>> Author: Wade Farnsworth <wade_farnsworth@...tor.com>
>> Date: Fri Sep 7 18:18:25 2012 +0100
>>
>> ARM: 7524/1: support syscall tracing
>>
>> because the tracing code wanted to know the number of syscalls. I don't
>> know what the answer is here, because the current solution is IMHO far
>> to fragile.
>
> Actually, no, you're wrong. Look closely at the definitions. __NR_syscalls
> is not the same as NR_syscalls.
>
> __NR_syscalls is the statically defined size of the syscall table for
> *probes purposes.
>
> NR_syscalls is the assembly-counted number of CALL() macros in
> arch/arm/kernel/calls.S.
All I can say is: UGGGGH.
But I've not had close encounters with arch code, so this may be
acceptable to you. Whatever...
Thanks,
Miklos
--
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