[PATCH 7/7] Skip the entry if the sys_func field is NULL

H.J. Lu hjl.tools at gmail.com
Mon Feb 6 17:42:40 UTC 2012


On Mon, Feb 6, 2012 at 9:31 AM, Dmitry V. Levin <ldv at altlinux.org> wrote:
> On Mon, Feb 06, 2012 at 07:43:58AM -0800, H.J. Lu wrote:
>> On Mon, Feb 6, 2012 at 7:24 AM, Dmitry V. Levin wrote:
>> > On Fri, Feb 03, 2012 at 10:19:55AM -0800, H.J. Lu wrote:
>> >>
>> >> This patch avoids segfault when there are holes in system call table.
>> >> It can happen with syscall (number, ...) and number is in those holes.
>> >
>> > We don't have sysent tables with holes yet, do we?
>>
>> I am working on such a target, x32.
>>
>> > Another question is, assuming that we have such sysent tables, should
>> > those syscalls be treated exactly the same way as syscalls which numbers
>> > are out of range?
>>
>> I don't mind either way as long as strace doesn't segfault.
>
> What about the following commit message, then?
>
> ---
> Skip the syscall entry if the sys_func field is NULL
>
> Avoid NULL dereference when there are holes in sysent tables.
> It can happen with syscall (number, ...) and number is in those holes.
> There are no targets with holey systent tables so far, but at least
> one such a target, x32, is already on the horizon.
>
> * defs.h (SCNO_IN_RANGE): Also check the sys_func field.

Works for me.

Thanks.


-- 
H.J.




More information about the Strace-devel mailing list