From b94e67bddc7e1a494df5710bae8834c422135039 Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Thu, 20 Jul 2017 21:14:42 +0200 Subject: [PATCH] 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. --- pathtrace.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; } -- 2.50.1