NetBSD Problem Report #60841

From www@netbsd.org  Sat Oct  3 04:34:43 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A93141A923C
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  3 Oct 2026 04:34:43 +0000 (UTC)
Message-Id: <20261003043442.8651E1A923E@mollari.NetBSD.org>
Date: Sat,  3 Oct 2026 04:34:42 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: kdc(8) sends pids to signals instead of signals to pids
X-Send-Pr-Version: www-1.0
X-From4GNATS: "campbell+netbsd@mumble.net via gnats" <gnats-admin@NetBSD.org>

>Number:         60841
>Category:       bin
>Synopsis:       kdc(8) sends pids to signals instead of signals to pids
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          pending-pullups
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 03 04:35:00 +0000 2026
>Closed-Date:    
>Last-Modified:  Sat Oct 24 17:20:03 +0000 2026
>Originator:     Taylor R Campbell
>Release:        current, 11, 10, ...
>Organization:
.cnI ,noitallangiS CDKteN ehT
>Environment:
>Description:

	When the KDC process supervisor exits, after notifying children
	gracefully, if the children don't exit promptly enough, then as
	a fallback it sends SIGTERM and then SIGKILL to the child pids.

	Or it tries to, anyway.

	Actually, it sends the child pids to SIGTERM and then SIGKILL,
	that is, passes the pid as the signal argument and the signal
	as the pid argument to kill(2) by mistake:

   1015     for (i=0; i < max_kids; i++)
   1016 	if (pids[i] > 0)
   1017 	    kill(sig, pids[i]);

	https://nxr.netbsd.org/xref/src/crypto/external/bsd/heimdal/dist/kdc/connect.c?r=1.5#1015

	Which is to say, it might send some random signal to some
	random process which happens to have pid 9 or 15 if you're
	unlucky.

	Fortunately it only does this if the primary mechanism of
	waking the child processes fails.

>How-To-Repeat:

	code inspection

>Fix:

	pull upstream commit b22f33250a98efcda3a07fdc36bc2fd386230857

>Release-Note:

>Audit-Trail:
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60841 CVS commit: src/crypto/external/bsd/heimdal/dist/kdc
Date: Sat, 3 Oct 2026 04:49:34 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Sat Oct  3 04:49:34 UTC 2026

 Modified Files:
 	src/crypto/external/bsd/heimdal/dist/kdc: connect.c

 Log Message:
 heimdal: Apply upstream fix for kill(2) argument order in kdc(8).

 commit b22f33250a98efcda3a07fdc36bc2fd386230857
 Author: Roland C. Dowdeswell <elric@imrryr.org>
 Date:   Fri Sep 25 14:45:23 2026 +0100

     kdc: correct kill_kids kill(2) arg order

 PR bin/60841: kdc(8) sends pids to signals instead of signals to pids


 To generate a diff of this commit:
 cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/heimdal/dist/kdc/connect.c

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

State-Changed-From-To: open->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Sat, 03 Oct 2026 04:51:29 +0000
State-Changed-Why:
fixed in HEAD, needs pullup-11, pullup-10


State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Wed, 21 Oct 2026 01:39:17 +0000
State-Changed-Why:
pullup-11 #549
pullup-10 #1394


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60841 CVS commit: [netbsd-11] src/crypto/external/bsd/heimdal/dist/kdc
Date: Sat, 24 Oct 2026 17:16:56 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Oct 24 17:16:56 UTC 2026

 Modified Files:
 	src/crypto/external/bsd/heimdal/dist/kdc [netbsd-11]: connect.c

 Log Message:
 Pull up following revision(s) (requested by riastradh in ticket #549):

 	crypto/external/bsd/heimdal/dist/kdc/connect.c: revision 1.6

 heimdal: Apply upstream fix for kill(2) argument order in kdc(8).

 commit b22f33250a98efcda3a07fdc36bc2fd386230857
 Author: Roland C. Dowdeswell <elric%imrryr.org@localhost>
 Date:   Fri Sep 25 14:45:23 2026 +0100

     kdc: correct kill_kids kill(2) arg order

 PR bin/60841: kdc(8) sends pids to signals instead of signals to pids


 To generate a diff of this commit:
 cvs rdiff -u -r1.5 -r1.5.4.1 \
     src/crypto/external/bsd/heimdal/dist/kdc/connect.c

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

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60841 CVS commit: [netbsd-10] src/crypto/external/bsd/heimdal/dist/kdc
Date: Sat, 24 Oct 2026 17:18:10 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Oct 24 17:18:10 UTC 2026

 Modified Files:
 	src/crypto/external/bsd/heimdal/dist/kdc [netbsd-10]: connect.c

 Log Message:
 Pull up following revision(s) (requested by riastradh in ticket #1394):

 	crypto/external/bsd/heimdal/dist/kdc/connect.c: revision 1.6

 heimdal: Apply upstream fix for kill(2) argument order in kdc(8).

 commit b22f33250a98efcda3a07fdc36bc2fd386230857
 Author: Roland C. Dowdeswell <elric%imrryr.org@localhost>
 Date:   Fri Sep 25 14:45:23 2026 +0100

     kdc: correct kill_kids kill(2) arg order

 PR bin/60841: kdc(8) sends pids to signals instead of signals to pids


 To generate a diff of this commit:
 cvs rdiff -u -r1.4.8.1 -r1.4.8.2 \
     src/crypto/external/bsd/heimdal/dist/kdc/connect.c

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

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.