NetBSD Problem Report #58529

From riastradh@netbsd.org  Wed Jul 31 00:25:48 2024
Return-Path: <riastradh@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)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 5870D1A923C
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 31 Jul 2024 00:25:48 +0000 (UTC)
Message-Id: <20240731002547.45103FC79@cvs.NetBSD.org>
Date: Wed, 31 Jul 2024 00:25:47 +0000
From: "Taylor R Campbell" <riastradh@netbsd.org>
Reply-To: riastradh@netbsd.org
To: gnats-bugs@gnats.NetBSD.org
Subject: PR/58463 CVS commit: src/sys/net

>Number:         58529
>Category:       pending
>Synopsis:       PR/58463 CVS commit: src/sys/net
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Wed Jul 31 00:30:02 +0000 2024
>Closed-Date:    Thu Aug 01 18:15:56 +0000 2024
>Last-Modified:  Thu Aug 01 18:15:56 +0000 2024
>Originator:     riastradh@netbsd.org
>Release:        
>Organization:

>Environment:

>Description:
 Module Name:	src
 Committed By:	riastradh
 Date:		Wed Jul 31 00:25:47 UTC 2024

 Modified Files:
 	src/sys/net: if_wg.c

 Log Message:
 wg(4): Make a rule for who wins when both peers send INIT at once.

 The rule is that the peer with the numerically smaller public key
 hash, in little-endian, takes priority iff the low order bit of

 H(peer A pubkey) ^ H(peer B pubkey) ^ H(posix minutes as le64)

 is 0, and the peer with the lexicographically larger public key takes
 priority iff the low-order bit is 1.

 Another case of:

 PR kern/56252: wg(4) state machine has race conditions
 PR kern/58463: if_wg does not work when idle.

 This one is, as far as I can tell, simply a deadlock in the protocol
 of the whitepaper -- until both sides give up on the handshake and
 one of them (but not both) later decides to try sending data again.

 (But not related to our t_misc:wg_rekey test, as far as I can tell,
 and I haven't put enough thought into how to reliably trigger this
 race to write a new automatic test for it.)


 To generate a diff of this commit:
 cvs rdiff -u -r1.129 -r1.130 src/sys/net/if_wg.c

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

>How-To-Repeat:

>Fix:

Unknown
>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: spz@NetBSD.org
State-Changed-When: Thu, 01 Aug 2024 18:15:56 +0000
State-Changed-Why:
should have gone into 58463


>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.