Date: Tue, 26 Jun 2012 16:42:40 +0700 (NOVT) From: Eugene Grosbein <egrosbein@rdtc.ru> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/169439: [patch] Stock ntpd segfaults when used with GPS pps source Message-ID: <201206260942.q5Q9ge33060024@syslog.sd.rdtc.ru> Resent-Message-ID: <201206260950.q5Q9o4Gb060740@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 169439 >Category: bin >Synopsis: [patch] Stock ntpd segfaults when used with GPS pps source >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 26 09:50:03 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Eugene Grosbein >Release: FreeBSD 8.3-STABLE amd64 >Organization: RDTC JSC >Environment: System: FreeBSD syslog.sd.rdtc.ru 8.3-STABLE FreeBSD 8.3-STABLE #4: Wed Jun 20 01:33:15 NOVT 2012 root@syslog.sd.rdtc.ru:/usr/local/obj/usr/local/src/sys/SYSLOG amd64 >Description: From my /etc/ntp.conf: # The GPS receiver on cuau3 at 4800 baud # # mode 1 = use $GPRMC statements # time1 = trimming offset # flag3 1 = enable Kernel PPS discipline # server 127.127.20.1 mode 1 iburst maxpoll 9 prefer fudge 127.127.20.1 time1 0.000 flag3 1 refid PPS ntpd segfaults while parsing configuration due to missing check for NULL pointer. >How-To-Repeat: See above >Fix: --- contrib/ntp/ntpd/refclock_nmea.c.orig 2012-06-26 16:10:46.000000000 +0700 +++ contrib/ntp/ntpd/refclock_nmea.c 2012-06-26 16:11:12.000000000 +0700 @@ -257,7 +257,7 @@ pp = peer->procptr; up = (struct nmeaunit *)pp->unitptr; #ifdef HAVE_PPSAPI - if (up->handle != 0) + if (up && up->handle != 0) time_pps_destroy(up->handle); #endif /* HAVE_PPSAPI */ io_closeclock(&pp->io); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206260942.q5Q9ge33060024>