From nobody Fri Apr 10 07:53:48 2026 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fsTZj0ZL2z6YFvH for ; Fri, 10 Apr 2026 07:53:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fsTZh6pCgz3cfL for ; Fri, 10 Apr 2026 07:53:48 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1775807629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hekKwIBGzOOzwTpVEcl9sbWhiipzVm4UA/BZaqa71NE=; b=E+cpTbKmU4IyDPSwPAiNO1iNwuKlNJw7vTrPKd+lgF4X8o4VwOVjzhijiSNMRyqqzLr20U FaT/JLhXrO33ER6IfRMePDvu43Fa3FyvFdyNIZAxSJEr9cM7XuALrNUMpErqZfLlM0P7s6 JADrLCeqR0e/izJoKn5K3XZJnbnZx/4QrRBF5shyCOhQXf4j0LiK0JylCIa5UFyDwPZskm 73vf8xQXmcsa90u2NDhSuzsmBp1W6jvjb/PYaOQzE4KL4bHVWrtTa9T0rSuG4xT7NThfph EYqLmK2/EahkYnutOV5AYDU+Qdl95jewUvJHZphKZO3MvcejaJhAQEck+vhrlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1775807629; a=rsa-sha256; cv=none; b=qkcK1uH4h2mm+EuC/Aii9MtmEGViIQRJKPurfgkldVgfLk3uKinM9KjE9zybzQBgFcqGYL KyVw2Z74QXun8vSvxXOWWL6/LTQ7/dPCO1KsOZ0g5gC8qogt7Mwi0xweqxdMBZArYoVoW/ WyLLhHBfbc/BrSNv2ehjqeq5831/5ymHXZsa/P1w6Gdw7ZE2lXYOzUX8VRKzXXDnecizad bix/KNmF8mYKl/D4mqBHQosf74C0mYqtc7MylkF+3ZvfrcfE7LiFtq5RI0d6CTQMgGjieo Zogg7R1f59THMoShHAsjKmsaR+/ShBtM9ACqP/Q9Nyv+wyuODP3ld2+vsZY+5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1775807629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hekKwIBGzOOzwTpVEcl9sbWhiipzVm4UA/BZaqa71NE=; b=lf77G9l71SdWsYr0t9RMkK2izji+5IKKfYxOPdvtky2Y+9oZMg7B8FyX+h8YmeTXFBMwKK uRwn1LeMx1N3A4juCeV6FP8DkdMwpcUgQaeyl/iIUx868sBzZK7JWfhfJTUlhCxw7qXb+h uULnqqb8TJPaSjnig6VP0WDz72dIuycRT/FfKv9Sf4MdLalxldc7MNfQDqsNRii429QpyJ Rpbsqm68WCHx3Re0FbDN3ouklQ0JR5ENbvV1QdkyvUUR9W21bzxIqkYpby8ZUCJZ3y/i2x eSeiA+lsNIeW3EJ4oGQALA76fPPJt72HdNSabXLIu+1cyCTn2RQ8kqYachMx1A== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4fsTZh6PVgzbKP for ; Fri, 10 Apr 2026 07:53:48 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 63A7rmM3094020 for ; Fri, 10 Apr 2026 07:53:48 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 63A7rmSU094019 for bugs@FreeBSD.org; Fri, 10 Apr 2026 07:53:48 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 293382] Dead lock and kernel crash around closefp_impl Date: Fri, 10 Apr 2026 07:53:48 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 14.3-STABLE X-Bugzilla-Keywords: crash X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: devgs@ukr.net X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D293382 --- Comment #52 from Paul --- (In reply to Konstantin Belousov from comment #50) Hi, Thanks for the patch. Though, could't help but also include the assert impl= ied by Kyle. It should't hurt to have an extra check, I hope. This is the final patch that we've applied to the current HEAD: diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 01731ca46b6b..38b67d81dff2 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -2037,8 +2037,13 @@ kqueue_expand(struct kqueue *kq, const struct filter= ops *fops, uintptr_t ident, to_free =3D list; } else { if (kq->kq_knlist !=3D NULL) { - bcopy(kq->kq_knlist, list, - kq->kq_knlistsize * sizeof(*lis= t)); + volatile char *src, *dst; + src =3D (void *)kq->kq_knlist; + dst =3D (void *)list; + for (size_t i =3D 0; + i < kq->kq_knlistsize * sizeof(*list); + i++) + dst[i] =3D src[i]; to_free =3D kq->kq_knlist; kq->kq_knlist =3D NULL; } @@ -2953,8 +2958,9 @@ knote_drop_detached(struct knote *kn, struct thread *= td) else list =3D &kq->kq_knhash[KN_HASH(kn->kn_id, kq->kq_knhashmas= k)]; - if (!SLIST_EMPTY(list)) - SLIST_REMOVE(list, kn, knote, kn_link); + KASSERT(!SLIST_EMPTY(list), + ("knote %p is not on the list of %lu", kn, kn->kn_id)); + SLIST_REMOVE(list, kn, knote, kn_link); if (kn->kn_status & KN_QUEUED) knote_dequeue(kn); KQ_UNLOCK_FLUX(kq); --=20 You are receiving this mail because: You are the assignee for the bug.=