From nobody Tue Jul 7 23:32:05 2026 X-Original-To: dev-commits-src-all@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 4gvyDp6ZXbz6kCbB for ; Tue, 07 Jul 2026 23:32:10 +0000 (UTC) (envelope-from git@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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gvyDp66Sdz3K01 for ; Tue, 07 Jul 2026 23:32:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1783467130; 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; bh=aRWur2ySBMlwjzqznjzR5cqmpfoP+CcDKHrV/ATl1pc=; b=cujnoGBUgM7/3OOCkojYxkUKdPJ9K3DhYGkaQzivE34GcYddWlWwMx5Ha37fiLz1i1c3c7 64hzwiQJ916gKXLJEfQfv59lluknI+dq8zh/yk2ed4WT3um7G33uXDQU/Vg0Z78vD+4rFb Q7w34IzhX79XDMoStkfhWyC8b0yywuNuFdsewcPT0KWKboxj5aTaHSWJRxpUg6u+JQ5TM4 njNV5QCVOfOPSYuRXfbosiXg2Vr15wUUCFAIbOYmuUMGlmkTUW6sJEino2b1yCQVW+0czN U77FgNEOIqyLW6wLSiohXgAsSPUktIpZfmPynIcDyGsS93dTWkQMGSsorFMlfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1783467130; a=rsa-sha256; cv=none; b=PFcPNM3rHWwq0+J9lUKiqYgQQDlr4gwmIbT2cx/xwwkKOqaKazrrEbLTAp/yEu+hF7SdU+ WNShIu6bsAGKFOeEplF1ejbFFlCU/B7fyCw3mHL0R5zhl3NORgaWccuLG5YjBS41ybtVtO rZLoP+6oBU7m+FS2m3EHS4LoJwcVGgdyP/EwelGxHpwn4WNjPxO9HafANHL3YwLvH7isZg AnCIH/KV/IYb9DD3UlZ9tesJdtMtbVhF/6K/QdlCOo3MKVgLZ1WDUrSksZgRuCY3ef3A7j 3wvak368OpYHB5dMlrpa1rFMqUZdc77wTbom4ddZFd1ojcGLrLH3yL1RaAR47w== 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=1783467130; 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; bh=aRWur2ySBMlwjzqznjzR5cqmpfoP+CcDKHrV/ATl1pc=; b=PBcE2eWXauI4FeiEuU9N4TpBatj6ViiTUKAjpkamCSlfb81pwmJS9gDVRVU/J/EtQCqfvq BgQeottZuLbujQN8aZIwJGZcqnxQ02q4c3HujGox9pHPI7/yTHPgEWYXBDHj+0gY1BN48I endXrwnusKClnQbASis09ZpHp/LqAZxXLjaVKDq0BMkRh2x7epIRLjMfR8fHGG9dJyuFcA Pyonfrlrj/2IdXBtYb63WkfvCAVYGSk2O7qePLFx/PRI1ihUqshyEK0u3S9K9U7bCZ8RHn TfBMbLd47HYnweQkWU48k22WUoL0TOt5Jf9PObbGHvXnwvgrH1RXjky50rbXJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gvyDp4n0Kzwm4 for ; Tue, 07 Jul 2026 23:32:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 332e2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 07 Jul 2026 23:32:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 407c7c339adb - main - linux/futex: Don't load a timeout when try-locking a mutex List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 407c7c339adb429efcb6658accd16399031c34ca Auto-Submitted: auto-generated Date: Tue, 07 Jul 2026 23:32:05 +0000 Message-Id: <6a4d8c75.332e2.21901efe@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=407c7c339adb429efcb6658accd16399031c34ca commit 407c7c339adb429efcb6658accd16399031c34ca Author: Mark Johnston AuthorDate: 2026-07-07 22:52:56 +0000 Commit: Mark Johnston CommitDate: 2026-07-07 23:28:55 +0000 linux/futex: Don't load a timeout when try-locking a mutex linux_sys_futex() does not copyin a timespec for the timeout if the operation is LINUX_FUTEX_TRYLOCK_PI, presumably because it doesn't make sense to specify a timeout for a try-lock operation. However, this means that we pass a userspace timespec pointer to linux_umtx_abs_timeout_init(). Modify linux_futex_lock_pi() to not initialize the timeout if we're try-locking. Reviewed by: kib, dchagin Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.2 from Z.ai MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58061 --- sys/compat/linux/linux_futex.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index 0586eb55a8f3..2e26fb6458a3 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -356,7 +356,7 @@ linux_futex(struct thread *td, struct linux_futex_args *args) static int linux_futex_lock_pi(struct thread *td, bool try, struct linux_futex_args *args) { - struct umtx_abs_timeout timo; + struct umtx_abs_timeout timo, *timop; struct linux_emuldata *em; struct umtx_pi *pi, *new_pi; struct thread *td1; @@ -370,8 +370,12 @@ linux_futex_lock_pi(struct thread *td, bool try, struct linux_futex_args *args) &uq->uq_key); if (error != 0) return (error); - if (args->ts != NULL) - linux_umtx_abs_timeout_init(&timo, args); + if (!try && args->ts != NULL) { + timop = &timo; + linux_umtx_abs_timeout_init(timop, args); + } else { + timop = NULL; + } umtxq_lock(&uq->uq_key); pi = umtx_pi_lookup(&uq->uq_key); @@ -546,8 +550,7 @@ linux_futex_lock_pi(struct thread *td, bool try, struct linux_futex_args *args) /* We set the contested bit, sleep. */ error = umtxq_sleep_pi(uq, pi, owner, "futexp", - args->ts == NULL ? NULL : &timo, - (args->flags & FUTEX_SHARED) != 0); + timop, (args->flags & FUTEX_SHARED) != 0); if (error != 0) continue;