NetBSD Problem Report #55795

From dholland@netbsd.org  Sat Nov  7 22:52:17 2020
Return-Path: <dholland@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 3E78F1A9246
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  7 Nov 2020 22:52:17 +0000 (UTC)
Message-Id: <20201107225216.AE0AE84CE1@mail.netbsd.org>
Date: Sat,  7 Nov 2020 22:52:16 +0000 (UTC)
From: dholland@NetBSD.org
Reply-To: dholland@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: syslogd dies recursively
X-Send-Pr-Version: 3.95

>Number:         55795
>Category:       bin
>Synopsis:       syslogd dies recursively
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 07 22:55:00 +0000 2020
>Last-Modified:  Sun Nov 08 01:15:01 +0000 2020
>Originator:     David A. Holland
>Release:        NetBSD 9.99.49 (20200310)
>Organization:
>Environment:
System: NetBSD valkyrie 9.99.49 NetBSD 9.99.49 (VALKYRIE) #0: Fri Oct  2 15:00:22 EDT 2020  dholland@valkyrie:/y/objects/usrobj-amd64/sys/arch/amd64/compile/VALKYRIE amd64
Architecture: x86_64
Machine: amd64
>Description:

syslogd's die() (in syslogd.c) contains a recursive call to itself if
closing a udp socket fails. This is currently (-r1.135) on line 3017.

It looks like most but not all of the cleanup code is idempotent, so
if this path is ever reached it will probably SIGSEGV.

>How-To-Repeat:

Code reading.

>Fix:

Change the close call to (void)close like the others, I guess. Anyone
have contrary opinions?

>Audit-Trail:
From: Valery Ushakov <uwe@stderr.spb.ru>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/55795: syslogd dies recursively
Date: Sun, 8 Nov 2020 02:07:28 +0300

 May be leave the check and still log the unlikely close failure, but
 then proceed?  But i have no strong opinion on that.

 Otherwise looks good to me.

 -uwe

From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55795 CVS commit: src/usr.sbin/syslogd
Date: Sun, 8 Nov 2020 01:12:46 +0000

 Module Name:	src
 Committed By:	dholland
 Date:		Sun Nov  8 01:12:46 UTC 2020

 Modified Files:
 	src/usr.sbin/syslogd: syslogd.c

 Log Message:
 syslogd: in die(), don't call die() again recursively.

 Particularly not for something as immaterial as close failing.

 PR 55795


 To generate a diff of this commit:
 cvs rdiff -u -r1.135 -r1.136 src/usr.sbin/syslogd/syslogd.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.