From nobody Fri Jun 17 19:37:11 2022 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 3700985A5DD; Fri, 17 Jun 2022 19:37:12 +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 4LPq7D0ffbz3PKs; Fri, 17 Jun 2022 19:37:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494632; 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=YothgKKnL0gBV2xfS6M0jFE4X0+2K/c0FVe8hPowTM0=; b=INUgE/jx+a107zHn3SSYNiQBwq44FwWC76zzGrjEJ2MQOwX48baonoC1oxBDI+4WRTmupa Sf0gtK1sWOkeDDMKBjqADSsdrHKEFq+pctsw5qGss2tVJkyeafvNGedpy9FeekzaeuD923 tzvl7MHu+TN92i6N6CvkIJBldCwYP/+LHLkCkf42EWhQ7tCtchq/Xxl0rfMYgOUhgV2/Kg 25cxocjwGi6SSvDMxkaECwuU5a3+QF50WaCBq1pUR4vAEtDHb68cahdnK7oI4P9lcKk7s4 ki3j2BUOjHUN8WbCqE8YMQRgaiUoSKihsuPqzWxwRlXiIVnomYRDjfqdOhUj5Q== 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 EA6F12557D; Fri, 17 Jun 2022 19:37:11 +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 25HJbB69013033; Fri, 17 Jun 2022 19:37:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJbBTf013032; Fri, 17 Jun 2022 19:37:11 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:37:11 GMT Message-Id: <202206171937.25HJbBTf013032@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: acb45ac680f7 - stable/13 - linux(4): Prevent an endless loop. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: acb45ac680f70ce5083d2275a6f40a8c116205ba Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494632; 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=YothgKKnL0gBV2xfS6M0jFE4X0+2K/c0FVe8hPowTM0=; b=Vy77X0nMtrHmhP7KLgh0WSkmL0WUNdLnovLz93wVOON5h+oDw1z4DSe16TSzA13RaC6tZq iMOl2+pdyjXamRtJc1fv2uzxpYLTpU8WB/QWz+POmBFSoz5P6h5FKoYfRBuf7DVqhL3nvd 2Sr9oMdNhRoNkLd0oGNWvjwBwzVg7M6ngnHTRupU86M6I82ZiRMOIq713eQrd1Ak9EW1+Y 1bEq+A+vUfPBqBUOLDaCkY8JxcCdcSs/cNe5BGccQzsGwaTeqdYcXz/Tp6+69iX7HMp4TI cF+pazeTsybTmttYc43zYJlr7yQFQvd6BqzwyXcGVJ1rD5Mv4JsJvtXGFpXO/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494632; a=rsa-sha256; cv=none; b=CkfAz88tVqX1zo9jAJG0/9PT95DVIJRCHKQ8NgQMnzPGSu1Ie7VKUj9bgHLE5+i1J7iqUq F0EYP2m46+05+iaMfR4+qUAI+mH2LJbmFlARoCBSG3zQp0OofOh2+L0q/fhqcfQjkv+pbh 6AcoZerbR+zury3TWO8Q9yjepobYo6mOa7GTb7CWzQ0HfP0aUT1nCQmbxWk3yH5G2oTNck rWuLVoB5Xkm7YtMSTEzag5vjECCYSlLiuhbY2raa5Tqgsx4woMgbNgYDcz77d2/Sl5GO+p tQ4CQMvJ+UYroDCom3oMcYTJxAV4qCelaW/644UrppeJOpK5IiIQxEyxDmx1iw== 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=acb45ac680f70ce5083d2275a6f40a8c116205ba commit acb45ac680f70ce5083d2275a6f40a8c116205ba Author: Dmitry Chagin AuthorDate: 2021-07-20 11:40:08 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:12 +0000 linux(4): Prevent an endless loop. In the futex_atomic_op() the encoded_op is a user-supplied parameter. If the user specifies an incorrect value for this parameter paired with a valid *uaddr parameter the caller will go into the endless loop. To prevent this check futex_atomic_op() result and break the loop in case of ENOSYS. MFC after: 2 weeks (cherry picked from commit ef4251e271486227f577494b8cc48623772a74ab) --- sys/compat/linux/linux_futex.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index f69b13585022..a32542b16a8a 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -845,6 +845,8 @@ retry: if (f2 != NULL) futex_put(f2, NULL); futex_put(f, NULL); + if (op_ret == -ENOSYS) + return (ENOSYS); error = copyin(args->uaddr2, &val, sizeof(val)); if (error == 0) goto retry;