From nobody Fri Jun 17 19:37:49 2022 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 50F1A85ACC7; Fri, 17 Jun 2022 19:37:51 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LPq7y4QVjz3PxJ; Fri, 17 Jun 2022 19:37:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494670; 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=hBIaCnclIUuqIkhkIzAtCtp64u2FFx7pWVe80PqKk/4=; b=pRDGHXcKt8SpPEzgxE8COTkofgO5ayePxFVS7dF6Sn1fZN52t62hgEHNnm4cg6FWxGwNBh ZF2DcbtUHIWUYYPNCxjAmWsKDgxiQkRzgGFZw9gr9eBvlOB/YECmO2Akl5XEeA9MCPdVX9 TYbnsxen8A6A25WdIilxNxm1FnVlbSGPNSOm7hflfQl/1XKU9ZQKLBbERdvvO6FpJPkiel pJbyylFAdJDHLoO4X4ZD4J1YIA+hS/Mc3qJ9Yt5IHXhXKeJKRTdBsYpfRWbT/oYQKTgE2g HmAl6Y5S73uUgIOTqaU5Rakb07zkRRv0GwtJ/XHr77XZQIUqTb+Go6279BbnRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 97AB425A36; Fri, 17 Jun 2022 19:37:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25HJbnDS013863; Fri, 17 Jun 2022 19:37:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJbn2B013862; Fri, 17 Jun 2022 19:37:49 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:37:49 GMT Message-Id: <202206171937.25HJbn2B013862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 7e8aeb42e488 - stable/13 - linux(4): Handle incorrect FUTEX_CLOCK_REALTIME option bit. 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7e8aeb42e4881b1ba39d92cf12fc646c63a0b832 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494670; 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=hBIaCnclIUuqIkhkIzAtCtp64u2FFx7pWVe80PqKk/4=; b=sDYYfPRvPf/WA4bMiokDyVG/t4Sl2GUxCidZon/1p7V/+8+wM7+7O34zmoajRjicnAsCwQ zA7r9CTIyrfUJkJbF3QkZgNVkUQboLLLahtVYKXa18+lbbS3yCN+DD0Qt20OvL4lcn42jS X8DeFS1dj6OrxorTuunyO1zF3hsPQmAokHRe1ctMNK0tHBirzOaTgh/CRfGUHleOBGIvq9 Ez24KJHQfAgyoyEV2qRhZr/d2CKRg89SKqs+KYGlnvozPFEQul1uvmfX0LZJp1JCmCp7A5 42HQzvqm3U64bznXHfLNr0YBIMEmsjFFdv6yLvnBk8jEaF23TyfMuJ/UG1tPrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494670; a=rsa-sha256; cv=none; b=x7UTpPHgw7thckIsNMXjjL71LFrwMJUeqLud0xL6uiG/644OzhoekXbzc7FeCTZrmkRC52 85GDddyOpYO+6Q3XNczW9EKaXckRl0MvTqa8gKs+AfpFJB/tfufxCgKhxphhnX6D3aam5l nHHeOEPD5GttJFZhrZs71ljK+bIjJYaVm3ig7dTdMILoKnVGcli8Msq8/ECz+qzxsWxaSi drvBfs3Dif26HXFsINsxnLE2sE7Sl5rr9nOstCKyhjv7ldkIdoOS91NiDtjfpKCDtVn1WK lY3xq6P4+xm1wBrSXtV8YuWircKDjZ6hfhIK5TRe+7Sm61wcXTBYvEkQT9GA1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=7e8aeb42e4881b1ba39d92cf12fc646c63a0b832 commit 7e8aeb42e4881b1ba39d92cf12fc646c63a0b832 Author: Dmitry Chagin AuthorDate: 2021-07-29 09:55:33 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:24 +0000 linux(4): Handle incorrect FUTEX_CLOCK_REALTIME option bit. Return ENOSYS if the FUTEX_CLOCK_REALTIME option bit is specified for an inappropriate futex operation. MFC after: 2 weeks (cherry picked from commit 626cbd4648141929502b953111dc8a71d550c7e8) --- sys/compat/linux/linux_futex.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index fcac2eba4956..5f18c93b0988 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -224,6 +224,12 @@ linux_futex(struct thread *td, struct linux_futex_args *args) args->clockrt = args->op & LINUX_FUTEX_CLOCK_REALTIME; args->op = args->op & ~LINUX_FUTEX_CLOCK_REALTIME; + if (args->clockrt && + args->op != LINUX_FUTEX_WAIT_BITSET && + args->op != LINUX_FUTEX_WAIT_REQUEUE_PI && + args->op != LINUX_FUTEX_LOCK_PI2) + return (ENOSYS); + switch (args->op) { case LINUX_FUTEX_WAIT: args->val3 = FUTEX_BITSET_MATCH_ANY;