From: Eugene Syromyatnikov Date: Thu, 20 Jul 2017 19:14:42 +0000 (+0200) Subject: pathtrace: fail poll path match on first failed umove X-Git-Tag: v4.19~120 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b94e67bddc7e1a494df5710bae8834c422135039;p=strace pathtrace: fail poll path match on first failed umove * pathtrace.c (pathtrace_match_set): When checking descriptors of poll family syscalls for fd match, break the loop on first failed umove call. --- diff --git a/pathtrace.c b/pathtrace.c index 4376b6c9..4585e26d 100644 --- a/pathtrace.c +++ b/pathtrace.c @@ -328,10 +328,12 @@ pathtrace_match_set(struct tcb *tcp, struct path_set *set) if (nfds == 0 || end < start) return false; - for (cur = start; cur < end; cur += sizeof(fds)) - if ((umove(tcp, cur, &fds) == 0) - && fdmatch(tcp, fds.fd, set)) + for (cur = start; cur < end; cur += sizeof(fds)) { + if (umove(tcp, cur, &fds)) + break; + if (fdmatch(tcp, fds.fd, set)) return true; + } return false; }