From nobody Wed Oct 1 09:39:15 2025 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 4cc8yW4PRPz69GPX for ; Wed, 01 Oct 2025 09:39:15 +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" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8yW1nDmz3HWy for ; Wed, 01 Oct 2025 09:39:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311555; 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=E6jgyFqCpBR8MyaYRUtiudK9zFjFLNPi2skWAKZdOFo=; b=kN3t/KTPr1Oplw4xLBTcCZei1DxXepm6iOWvP456BgVtCOeBszmUHUfIocQmzMZXfc57L4 NmuZ+AerUS8LU2Agq3wID1eS4TdZrjvBKkR2HGXRWOg4WWtQSBx6RfnmjKk7DP7Sa46bP/ oD/8/7Gvmgf1YeqesYuQYZOghQrn7vDsc08xWOLgk8O5h9cpXK+UVgHnWuCiOgNdNCrHIP zxlT/Ybj3AKrdewANmfUGo6VSG3N/V4ViuuuC0vjucHcKdsd73lXNzwiCPGPqOmPEfpEia owstBC+aep90IGzJlrM4vZ3Hpt7n7T182MQN3chU4whom1yLhB0zU16c4I127g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311555; 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=E6jgyFqCpBR8MyaYRUtiudK9zFjFLNPi2skWAKZdOFo=; b=rGgYyWSp4AJSs6klfP7LpQfkUYeKOZ+XunCjC9JDHXlE7NqcZR7Pn6JTojU0yxXKjHEzUw C9jjof4rp5aXELSiYkyZ/42y1wnNnBRdPIrdW+T6V5mO5toanMdxPgykr2uo0Z/ckGTGgT GC5T8lPQBGv1FclcwcXhixdtnPq2DuCyrgJX6yKc34KzG1/k25qzEXypx7z52AE/HZE0rl KFhY/gb+4/n7zCoULBGXN6P5zMSQ3zKrTKIPWsNs1TJZcXOIO5lw5lYwTrSLflCLJnVUSG PD6FlW3bJ1xWInN0LHDYbV6KnUhX/8OXU5GaYeVCdMqgfqLaCr//wZf54fJt6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311555; a=rsa-sha256; cv=none; b=wbf31LorA6t53jivEEHz4u7Uxmier5eiGl1r0pPwrn/6PDMmdGQt1eUkp6MW5E9oFN7ts2 2+MmBOeGwudWQHe6Xk0vledyzj5XWTGBmijeTzXAkZFAGqZ88BNLl/e+bW78wo5AmIVFBR JPOsWaetV+o7XH7yUb6B7ejBGthRJ6dE98kyYE/pgpP8PZt6y9Jnsr0eY0o+SRcx7uir6C scNZ5UESfbusCgD4LSubFUnDIXU36moAkMQ/NR5oBEl94jiJCjfWw/RrQI24SFlLOZKkcd GT4O22ABxqS+VEa45dmQt4rE+b5AHmqnSoZ93urCzNgGOBROCrWACBSzmB2oHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cc8yW1FlRz2Lk for ; Wed, 01 Oct 2025 09:39:15 +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 5919dFv9088553 for ; Wed, 1 Oct 2025 09:39:15 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 5919dFVq088552 for bugs@FreeBSD.org; Wed, 1 Oct 2025 09:39:15 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 289120] A time-of-check to time-of-use race exists in gpioc_kqread() of GPIO subsystem Date: Wed, 01 Oct 2025 09:39:15 +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-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@FreeBSD.org 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=3D289120 --- Comment #11 from commit-hook@FreeBSD.org --- A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D4472ecb362b068400f26abfce2db2a2b1= 0a88d95 commit 4472ecb362b068400f26abfce2db2a2b10a88d95 Author: Ahmad Khalifa AuthorDate: 2025-09-30 11:09:50 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 08:52:21 +0000 gpioc: fix race in ioctl(GPIOCONFIGEVENTS) A race can occur in gpioc_ioctl when it is called with GPIOCONFIGEVENTS closely followed by GPIOSETCONFIG. GPIOSETCONFIG can alter the priv->pins list, making it no longer empty and opening the door for access to priv->events while we are reallocating it. Fix this by holding priv->mtx while handling GPIOCONFIGEVENTS. Reported by: Qiu-ji Chen PR: 289120 Reviewed by: mmel MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D52783 (cherry picked from commit d000adfe41e6f2fe8f3dbe92d8fc2d34ae882086) sys/dev/gpio/gpioc.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=