Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Nov 2025 04:00:51 +0000
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: d9c345c9d3ca - stable/13 - ntpd: Fix segfault when same IP on multiple interfaces
Message-ID:  <6923d873.35d06.150cfe7e@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/13 has been updated by cy:

URL: https://cgit.FreeBSD.org/src/commit/?id=d9c345c9d3cac00d055ca748e43b308861529a01

commit d9c345c9d3cac00d055ca748e43b308861529a01
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2025-11-21 00:16:04 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2025-11-24 04:00:43 +0000

    ntpd: Fix segfault when same IP on multiple interfaces
    
    Use the protype socket to obtain the IP address for an error message.
    Using the resultant socket address, a NULL because create_interface()
    had failed, results in SIGSEGV.
    
    To reproduce this bug,
    
    ifconfig bridge100 create
    ifconfig bridge100 10.10.10.10/24
    ifconfig bridge101 create
    ifconfig bridge101 10.10.10.10/24
    ntpd -n
    
    PR:             291119
    
    (cherry picked from commit ac1f48b4a7be104d222dea60f1da946fcb345fb1)
---
 contrib/ntp/ntpd/ntp_io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c
index 9c4f6c1553e3..97b85ee83e36 100644
--- a/contrib/ntp/ntpd/ntp_io.c
+++ b/contrib/ntp/ntpd/ntp_io.c
@@ -1923,7 +1923,7 @@ update_interfaces(
 
 			msyslog(LOG_ERR,
 				"cannot bind address %s",
-				stoa(&ep->sin));
+				stoa(&ep2->sin));
 		}
 		free(ep2);
 	}


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6923d873.35d06.150cfe7e>