From owner-freebsd-ports-bugs@freebsd.org Tue Oct 22 20:39:37 2019 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46DA7164B86 for ; Tue, 22 Oct 2019 20:39:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 46yQNT1CzXz4Fvl for ; Tue, 22 Oct 2019 20:39:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 28063164B85; Tue, 22 Oct 2019 20:39:37 +0000 (UTC) Delivered-To: ports-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27CA4164B84 for ; Tue, 22 Oct 2019 20:39:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46yQNT0HyZz4Fvj for ; Tue, 22 Oct 2019 20:39:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7ECE19CAE for ; Tue, 22 Oct 2019 20:39:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x9MKda6O019594 for ; Tue, 22 Oct 2019 20:39:36 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x9MKdaYA019593 for ports-bugs@FreeBSD.org; Tue, 22 Oct 2019 20:39:36 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 241421] net/ntp segfaults with stack_gap!=0 Date: Tue, 22 Oct 2019 20:39:36 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: dewayne@heuristicsystems.com.au X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: cy@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2019 20:39:37 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D241421 Bug ID: 241421 Summary: net/ntp segfaults with stack_gap!=3D0 Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: cy@FreeBSD.org Reporter: dewayne@heuristicsystems.com.au Assignee: cy@FreeBSD.org Flags: maintainer-feedback?(cy@FreeBSD.org) While trying to secure... time (net/ntp), I've noticed that it experiences segmentation faults (SIGSGV). Environment FreeBSD 12.1-STABLE #0 r353429M: Sat Oct 12 19:02:59 AEDT 2019 kern.elf64.aslr.stack_gap=3D1 kern.elf64.aslr.honor_sbrk=3D1 kern.elf64.aslr.pie_enable=3D1 kern.elf64.aslr.enable=3D1 kern.elf64.pie_base=3D16912384 kern.elf64.nxstack=3D1 security.mac.ntpd.uid=3D123 security.mac.ntpd.enabled=3D1 >From the /etc/make.conf CFLAGS include -fPIE -fPIC -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack LDFLAGS include -pie -z relro -z now -z noexecstack=20 # make -C /usr/ports/net/ntp -DUSE_K8 showconfig|grep =3Don IPV6=3Don: IPv6 protocol support LOCAL_CLOCK=3Don: Enable local clock reference SHM=3Don: Enable SHM clock attached thru shared memory SSL=3Don: SSL protocol support THREADS=3Don: Threading support And we kick-off ntp with su -m ntpd -c "/usr/local/sbin/ntpd -c /etc/ntp.conf -u ntpd -x -G --nofork" Yes this does require other files to be ntpd readable, and logs writeable With the nofork, it requires multiple tries to get it to start. Over appro= x 15 tests, the minimum number of attempts (using stack_gap=3D1) is 11 and the m= ost 41. I use a process monitor (s6) which retries starting ntp approx 1.01 seconds until successful. When kern.elf64.aslr.stack_gap=3D0, ntp starts on the first attempt. I'm sharing this because ntpd has a problem with aslr (particularly when enabled via stack_gap, and I had used different percentages stack_gap=3D1|2= |3 during additional tests). --=20 You are receiving this mail because: You are the assignee for the bug.=