From owner-freebsd-bugs@FreeBSD.ORG Sat Mar 26 18:10:03 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 61BC816A4CE for ; Sat, 26 Mar 2005 18:10:03 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 18C2943D39 for ; Sat, 26 Mar 2005 18:10:03 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j2QIA2U2009105 for ; Sat, 26 Mar 2005 18:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j2QIA2be009104; Sat, 26 Mar 2005 18:10:02 GMT (envelope-from gnats) Resent-Date: Sat, 26 Mar 2005 18:10:02 GMT Resent-Message-Id: <200503261810.j2QIA2be009104@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Shuichi KITAGUCHI Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3AB7316A4CE for ; Sat, 26 Mar 2005 18:00:53 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CB3143D54 for ; Sat, 26 Mar 2005 18:00:53 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j2QI0q7H011960 for ; Sat, 26 Mar 2005 18:00:52 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j2QI0qWa011959; Sat, 26 Mar 2005 18:00:52 GMT (envelope-from nobody) Message-Id: <200503261800.j2QI0qWa011959@www.freebsd.org> Date: Sat, 26 Mar 2005 18:00:52 GMT From: Shuichi KITAGUCHI To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: bin/79260: syslogd may accept illegal facility number from remote. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2005 18:10:03 -0000 >Number: 79260 >Category: bin >Synopsis: syslogd may accept illegal facility number from remote. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Mar 26 18:10:02 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Shuichi KITAGUCHI >Release: 6-CURRENT (but all releases may affected) >Organization: >Environment: FreeBSD rhea.k.ysnb.net 6.0-CURRENT FreeBSD 6.0-CURRENT #0: Sat Mar 19 22:27:19 JST 2005 root@rhea.k.ysnb.net:/spool/sys/obj/data/sys/src/sys/RHEA i386 >Description: syslogd can accept priority number which larger than LOG_NFACILITIES from remote host. but in struct filed, member variable f_pmask array and f_pcmp array is limited to LOG_NFACILITIES. therefore syslogd access invalid address in logmsg() when facility is larger than LOG_NFACILITIES. >How-To-Repeat: send syslog message which facility is larger than LOG_NFACILITIES from remote host. >Fix: I think following patch should fix this problem. --- syslogd.c.old Mon Mar 21 22:19:01 2005 +++ syslogd.c Sun Mar 27 02:44:07 2005 @@ -918,6 +918,12 @@ fac = LOG_FAC(pri); prilev = LOG_PRI(pri); + /* check maximum facility number */ + if (fac > LOG_NFACILITIES){ + (void)sigsetmask(omask); + return; + } + /* extract program name */ for (i = 0; i < NAME_MAX; i++) { if (!isprint(msg[i]) || msg[i] == ':' || msg[i] == '[' || >Release-Note: >Audit-Trail: >Unformatted: