From nobody Mon Jul 27 19:14:51 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 4h87Zh26ZRz6nQCv for ; Mon, 27 Jul 2026 19:14:52 +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 4h87Zg2zTNz3f7S for ; Mon, 27 Jul 2026 19:14:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785179691; 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=fq07+tDuTtHzBKGObGWNBjTic+wcyV4IuRQeZSZOnfI=; b=KphAQ3yoe4Q3x472zmFLyHw0/8uigyvz3MO+rr0HYrx2DvZdHK4KQco4tidR5cTOWQoZCh +IMzyr0L7O6YYSM3aT30xmubUD9AJhva0H25uk5OWQ8XYQ7RgW/i/HgYWFpKOmG4byHGrL KERnCZg/2IJ3j6LSzPxs2G7gKsYLD1jvLEFVRRw3TeIu4i1E7x1d/mDNQKu5bmdfOgyM7Q uz0eJuKvpwvMUNtkE6m6FoQpK5oqSj2ouqsT4m0ppwJtnakmPtlTYyGDRfynGY0J8DFvzn dQj7Jb+UDvVCK3q+UU7f6Io9uH1jMprOo/uJqbya5545XqLuPOCbAMe3EB7lmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785179691; a=rsa-sha256; cv=none; b=cR2kjpVnvyVqsDN2zrSCNl+qltwFrRtw4B+KVYXIfL69F+BfyfIjmQEWTR/CchfNGhIdet t+dueaV/2QoRs3tkbIQ+bvqyjogS71EWVkdfPvgslqIQxZ5GWuTQIK3hCQdy+zmAW9kZfA EN//E3XAxpeVhQVmjjvO3yG0gL5OqnV86vZ30GQRXCIoWORTyFYwbwpkaJrdssfaDrNiGH O5mN2Vt9Nhb1R4tDtW/U9/Gu4hrHgL9OMgZXoBCJ0KfXG+46xt30y9MfUHModLa6DGKMPI 2AU//C0KIk7qmjcA6i/PAYSsG8q8uyYXuBHQz/N13g2HftWr1KNH8iyIwuVwyQ== 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=1785179691; 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=fq07+tDuTtHzBKGObGWNBjTic+wcyV4IuRQeZSZOnfI=; b=Hqaqa2/+ps+BSK+671zvAqIGd35OUhwpargSXWvql3sMHWECq6SLBiZRlgxzECfFd7kcT+ WDR8uDcRUkvv7/Ym0uPitkVMWQs1pBUvaPWiO5t8m7lTVR/skmkOe4+bcCFLxmmvHla5i8 BweRKtwyPX6cia0Myn7+eGl/f14Zd9HiX60i1J1F4/Lo1U7qyJAjtmNwDfmLay3wsS05Yo 8/AWkoxTkYEy7nS2eglFi5Tj8hKZ2ecgrvXb6IjWgBxUzLHWloNtWrqmEWGJrCoHDbnc5l haah3XbI71J1I2XI0mE6o0p7heUklqqLYcaLi1Z4dAWZKgB8Kb6XvagC/Tre8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h87Zg1ksHz1KpN for ; Mon, 27 Jul 2026 19:14:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3900b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 27 Jul 2026 19:14:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: bcabd6089f3b - stable/15 - 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/stable/15 X-Git-Reftype: branch X-Git-Commit: bcabd6089f3bb7102f32ce40a4d715d50f8093af Auto-Submitted: auto-generated Date: Mon, 27 Jul 2026 19:14:51 +0000 Message-Id: <6a67ae2b.3900b.8fc8a11@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bcabd6089f3bb7102f32ce40a4d715d50f8093af commit bcabd6089f3bb7102f32ce40a4d715d50f8093af Author: Mark Johnston AuthorDate: 2026-07-07 22:52:56 +0000 Commit: Mark Johnston CommitDate: 2026-07-27 17:34:31 +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 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;