]> granicus.if.org Git - strace/commitdiff
pathtrace: limit amount of checked poll fds similarly to select limit
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 21 Jul 2017 18:15:24 +0000 (20:15 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 14 Aug 2017 11:33:26 +0000 (11:33 +0000)
* pathtrace.c (pathtrace_match_set): Limit the maximum descriptor number
checked for fd match in poll family syscalls to 1024 * 1024.

pathtrace.c

index 4585e26d218d889e254657bf492178b45d50e5a7..b0dd8f991cf5a4fc71c58c1217e10590b704507c 100644 (file)
@@ -323,6 +323,8 @@ pathtrace_match_set(struct tcb *tcp, struct path_set *set)
                start = tcp->u_arg[0];
                nfds = tcp->u_arg[1];
 
+               if (nfds > 1024 * 1024)
+                       nfds = 1024 * 1024;
                end = start + sizeof(fds) * nfds;
 
                if (nfds == 0 || end < start)