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

Dmitry V. Levin ldv at altlinux.org
Mon Feb 6 17:31:27 UTC 2012


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


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20120206/1f5346ef/attachment.bin>


More information about the Strace-devel mailing list