From nobody Thu Feb 27 08:36:44 2025 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z3Pp500Bdz5prrX for ; Thu, 27 Feb 2025 08:36:44 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z3Pp46Q0nz3ZT9 for ; Thu, 27 Feb 2025 08:36:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740645404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BD8nz0KuA3UUhWGtdgsgDalL5VJEJImh7Un6xsMBQUA=; b=xf6ojlycH4mrb5O85C6NPlxk0LeW7RbooAEUrrZToaNxhQCYfl5Xnq4e0Vmq2kfpiW0i3a 3/A6kjWWxtEyZnCRPN8JSoQe5A1K2u/Lm/JIT+OhXFgOEWrSz7pFblJVrL4rD0GbEnXeYa i96d+OxV9mYWHqTgWZg9ipzJAfE7LbBXXCMvmaVy7PUGrrtICoFcwdrUTrXflfHEXmggh/ muOxYesbSyKtTcrivYywTEVouanahDTMKlomEVoSxGH4y/3bddqTYR2CLYLBtY/9axXL9C cD8CXTSwgsSrlV4M2F8V1xJzwNqjgWT0kiwIMXR9RLLEhD0sCrLV/mOH5VyrnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740645404; a=rsa-sha256; cv=none; b=KEtWk829i7AsE2PYAktb0HPKNT3mwrAl52hDG7/vsL0I5jlTLn07WTFozVj+E5mBt6CulD Ph/kdtwv8J4dB4Eh87h8Nt4A1ikfJNALRkLWOK1Cpvp7iaBIcRTA3gRPWC+hHYzFZloF/1 t475jDEyYUrA9wugeQNE3cNMawMjNnh/wd4MjSPyISYolG++vJAqRegknV4BoXYA7nJP6b fW/NvbPIUra0gJ1K62KXcyxcAz9SRisgpgYFExincAN2OA1dsJcuziiFb9rQYpTo0UDlnv 6/NfUBV/poRGmZlV1f6T6X/Gjz+yAZNMYh71xgXC9kYm2+n3vdxh0STKF4T2bQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740645404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BD8nz0KuA3UUhWGtdgsgDalL5VJEJImh7Un6xsMBQUA=; b=CIW0nhTVS2mpeKz9Ktd2WpuC3NKbsHmHMpi6s72n8oKCpTBUHVJOdLgkS+C/V3uMyH/tuu pE1ZsXDlHXnnjIwhmU8v5U+ivRP5cmrdFM2hUI6uG+/YrxrPskE3yeMCcWDZ5128ZiGisl Oy03hfN1PCGhDY4sAxrYlUZ5c2w+V7WTgsk1CBrU12VEUvOrluXha299+XmZV2ZYbWW0Yp MCxXl0DOGbHZsJk+tbrR9+fHeBodE887FGl4rc2wuXbKO+b+JPeJks4he5NYb15a532lJ+ n6UyEGtqKK83sA8HauUkmIIq1W4tFip05+31u8fEYZQfIrFSNmIPef5eOXydbA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z3Pp44xXwzc3n for ; Thu, 27 Feb 2025 08:36:44 +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 51R8aiSx034742 for ; Thu, 27 Feb 2025 08:36:44 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 51R8aier034739 for bugs@FreeBSD.org; Thu, 27 Feb 2025 08:36:44 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: bugs@FreeBSD.org Subject: [Bug 285065] NULL pointer deference in ntpd Date: Thu, 27 Feb 2025 08:36:44 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: freebsd@dev.thsi.be X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D285065 Bug ID: 285065 Summary: NULL pointer deference in ntpd Product: Base System Version: Unspecified Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: freebsd@dev.thsi.be Hello, In contrib/ntp/ntpd/ntp_io.c the function update_interfaces deferences the ep pointer which is NULL in the else branch, in here: L1906: for (ep2 =3D newaddrs; ep2 !=3D NULL; ep2 =3D next_ep) { next_ep =3D ep2->elink; ep2->elink =3D NULL; ep =3D create_interface(port, ep2); if (ep !=3D NULL) { ifi.action =3D IFS_CREATED; ifi.ep =3D ep; if (receiver !=3D NULL) { (*receiver)(data, &ifi); } new_interface_found =3D TRUE; DPRINT_INTERFACE(3, (ep, "updating ", " new - created\n")); } else { DPRINT_INTERFACE(3, (ep, "updating ", " new - FAILED")); msyslog(LOG_ERR, "cannot bind address %s", stoa(&ep->sin)); } free(ep2); } The bug is present in all branches. It manifests in a crash of ntpd. (lldb) bt * thread #1, name =3D 'ntpd', stop reason =3D signal SIGSEGV * frame #0: 0x000bbb18 ntpd`socktoa(sock=3D0x00000018) at socktoa.c:46:10 frame #1: 0x00060d28 ntpd`update_interfaces(port=3D123, receiver=3D, data=3D) at ntp_io.c:1926:5 frame #2: 0x0005fb7c ntpd`io_open_sockets [inlined] create_sockets(port=3D123) at ntp_io.c:2036:2 frame #3: 0x0005f760 ntpd`io_open_sockets at ntp_io.c:513:2 frame #4: 0x0004bc14 ntpd`config_ntpd(ptree=3D0x208a90c0, input_from_files=3D) at ntp_config.c:5036:2 frame #5: 0x00049964 ntpd`save_and_apply_config_tree(input_from_file=3D) at ntp_config.c:5276:2 [artificial] frame #6: 0x00049aec ntpd`getconfig(argc=3D, argv=3D) at ntp_config.c:5212:2 frame #7: 0x0007f2f8 ntpd`ntpdmain(argc=3D0, argv=3D0xbfbfed4c) at ntpd.c:1141:2 frame #8: 0x0007eaf0 ntpd`main(argc=3D, argv=3D) at ntpd.c:445:9 (lldb) --=20 You are receiving this mail because: You are the assignee for the bug.=