pull in security patch from FreeBSD

This commit is contained in:
danh 2001-04-05 13:56:54 +00:00
parent cbb7c303b4
commit 1569bd5bde
2 changed files with 25 additions and 2 deletions

View File

@ -1,9 +1,8 @@
# $OpenBSD: Makefile,v 1.8 2001/04/05 11:58:05 espie Exp $
# $OpenBSD: Makefile,v 1.9 2001/04/05 13:56:54 danh Exp $
COMMENT= network time protocol implementation
COMMENT-doc= network time protocol documentation
BROKEN= "May be holed"
VERSION= 4.0.99k
DISTNAME= ntp-${VERSION}
CATEGORIES= net

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-ntpd_ntp_control_c,v 1.1 2001/04/05 13:56:54 danh Exp $
--- ntpd/ntp_control.c.orig Sat Jul 15 10:46:05 2000
+++ ntpd/ntp_control.c Thu Apr 5 09:40:13 2001
@@ -1821,9 +1821,18 @@ ctl_getitem(
while (cp < reqend &&
isspace((int)*cp))
cp++;
- while (cp < reqend && *cp !=
- ',')
+ while (cp < reqend && *cp != ',') {
*tp++ = *cp++;
+ if (tp > buf + sizeof(buf)) {
+ msyslog(LOG_WARNING, "Attempted \"ntpdx\" exploit from IP %d.%d.%d.%d:%d (possibly spoofed)\n",
+ (ntohl(rmt_addr->sin_addr.s_addr) >> 24) & 0xff,
+ (ntohl(rmt_addr->sin_addr.s_addr) >> 16) & 0xff,
+ (ntohl(rmt_addr->sin_addr.s_addr) >> 8) & 0xff,
+ (ntohl(rmt_addr->sin_addr.s_addr) >> 0) & 0xff,
+ ntohs(rmt_addr->sin_port) );
+ return 0;
+ }
+ }
if (cp < reqend)
cp++;
*tp = '\0';