From nobody Tue Jul 14 14:56:25 2026 X-Original-To: dev-commits-src-branches@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 4h02SV0d93z6kr8v for ; Tue, 14 Jul 2026 14:56:26 +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 4h02ST4z8fz3MG1 for ; Tue, 14 Jul 2026 14:56:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784040985; 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=kAFLMh8cIqwW414P9Fve8XshZaSJPWtxFSjlJqe/ENU=; b=Nh8+Pi39XOb1OU+CyU9VMfi+GQdzs4v+e5pvd03SGtdQovfOqhIPrZyeejeFssbjpk33fT DofCf4/TrCpghGTfCpOIedQvl+Bf6sZOo1tQNDzec6RNlc+tS5AUHrEooiQLwY2/ljh4Tt tpQF2gLIpR3KyWAHefJQzczSmOuYmwv06l8/597xJbgCLZSyx1geVeTQqOE8+uY+TMqSeL Hs82snFKaHHjXKvpY4VkZKKGFkefBy8BrfUOo/U5DvRiL2MA9MbJ2BORE4sQsP8esyZv8F +jrRp6d72Xv5nBIaPhtnZVW1Q866J4i7XoRhb55e2SEwSqIZFKrtHaSYrmfCmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784040985; a=rsa-sha256; cv=none; b=qoxNzOoo7fyRho8uWIKolmQRMdKNJJiwj1i/PCE8qSzj0Ut6cAHzUWdr876vrW3UKZbZLz Rzvt+kYdTzGaTTNZinR8dFT7ulmYcSe2Nq582dol68vXHtppygoRKrzzcoprsNxJCVQRys F3Y85XYff25qBZNfBjiFENYcts6+um5irX6Wz3FcgqJ0XXjN93x8lj0lHup9QRNEcKYyOr 2YSGwXe+YLJNqunh8Y+cgkLALK5Ey5T8O7wO/v+GRi49HuA+vg6sIs2Y/bOvYNOwhWs+Yp WydTW/J1w79fvE+kfk0MHBsj7IfaDghJ0Uf1e06P06g+CjoYsjkQEsgha46Ktw== 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=1784040985; 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=kAFLMh8cIqwW414P9Fve8XshZaSJPWtxFSjlJqe/ENU=; b=gCmX5zsbkKRLS59j/kOB04kmNfPlllF2BrXepMWnhrnPTOHzzuQlmYuzHIz3rJoUNte/5S eW0waBFjZd5lXCY9+AAzuNolQ32nI73mmJVIji4ekwmD/a/YkXFDDz4FhNHRNpglKcuVMY Tv1K7WO8cq+E9TuHW1mCAiQ848T7xmPVb2DVhNaKA7aID0seaND8GO0RwtREWihKNLKof1 aGU5ITqorReW0weqaZMo87PXBU+KwXhKX/9EzjI+J1iV9dB1Tg/sE6J334qMsgmk5rSqWN b8IZTyM2iNvsUF4JXaBgPz/g7YLDWmvcc1lKwfumDG1AjP6ILU6gerKAtlNf2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h02ST1qHwzpn5 for ; Tue, 14 Jul 2026 14:56:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e951 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Jul 2026 14:56:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 49b5356bc3e9 - stable/14 - linux/futex: Don't load a timeout when try-locking a mutex List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 49b5356bc3e97ec42709996814b0e4d8a582eafb Auto-Submitted: auto-generated Date: Tue, 14 Jul 2026 14:56:25 +0000 Message-Id: <6a564e19.3e951.4a9c9d0f@gitrepo.freebsd.org> The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=49b5356bc3e97ec42709996814b0e4d8a582eafb commit 49b5356bc3e97ec42709996814b0e4d8a582eafb Author: Mark Johnston AuthorDate: 2026-07-07 22:52:56 +0000 Commit: Mark Johnston CommitDate: 2026-07-14 14:08:41 +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 (cherry picked from commit 407c7c339adb429efcb6658accd16399031c34ca) --- 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 37d0142bae8b..27a6e580cc70 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;