diff options
author | delphij <delphij@FreeBSD.org> | 2016-01-27 07:41:31 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2016-01-27 07:41:31 +0000 |
commit | c6068befe92b8a57c14895fce91c3f9f484112ae (patch) | |
tree | b594030d53fff8bb3c208102e7c681b13bd35f59 /contrib/ntp/libntp/ntp_worker.c | |
parent | 081d2796398eccde663726fb1d7073ada3146548 (diff) | |
download | FreeBSD-src-c6068befe92b8a57c14895fce91c3f9f484112ae.zip FreeBSD-src-c6068befe92b8a57c14895fce91c3f9f484112ae.tar.gz |
Fix multiple vulnerabilities of ntp. [SA-16:09]
Fix Linux compatibility layer issetugid(2) system call
vulnerability. [SA-16:10]
Security: FreeBSD-SA-16:09.ntp
Security: FreeBSD-SA-16:10.linux
Approved by: so
Diffstat (limited to 'contrib/ntp/libntp/ntp_worker.c')
-rw-r--r-- | contrib/ntp/libntp/ntp_worker.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/ntp/libntp/ntp_worker.c b/contrib/ntp/libntp/ntp_worker.c index f5642e1..087f06c 100644 --- a/contrib/ntp/libntp/ntp_worker.c +++ b/contrib/ntp/libntp/ntp_worker.c @@ -27,6 +27,8 @@ blocking_child ** blocking_children; size_t blocking_children_alloc; int worker_per_query; /* boolean */ int intres_req_pending; +volatile u_int blocking_child_ready_seen; +volatile u_int blocking_child_ready_done; #ifndef HAVE_IO_COMPLETION_PORT @@ -262,6 +264,31 @@ process_blocking_resp( req_child_exit(c); } +void +harvest_blocking_responses(void) +{ + int idx; + blocking_child* cp; + u_int scseen, scdone; + + scseen = blocking_child_ready_seen; + scdone = blocking_child_ready_done; + if (scdone != scseen) { + blocking_child_ready_done = scseen; + for (idx = 0; idx < blocking_children_alloc; idx++) { + cp = blocking_children[idx]; + if (NULL == cp) + continue; + scseen = cp->resp_ready_seen; + scdone = cp->resp_ready_done; + if (scdone != scseen) { + cp->resp_ready_done = scseen; + process_blocking_resp(cp); + } + } + } +} + /* * blocking_child_common runs as a forked child or a thread |