From nobody Thu Mar 31 17:50:37 2022 X-Original-To: dev-commits-src-main@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 60CA81A568C3; Thu, 31 Mar 2022 17:50:38 +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 4KTrSG10mKz4rwt; Thu, 31 Mar 2022 17:50:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648749038; 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=vqk+AkXZJybRY7QfSLSTjQrf3nbJjrrmBPHfwcivby0=; b=EWfbkDIGFzuOoSe01rlOEb0uviZkoilmMScAjNfwxGnZEYVJGdhj8y9a4M9RjTrZvXZKvU +gav8HBSA8fO9RpsIyAyoaK5ggvCOU6cXPZcHP7jFuO7VR3Nyq99IWoPmeLimdNOlinp5M cMkTcfE/QyKzvcZZp50mfItDRPZFsiBt/zx/vPVThrXBR+HKHVHpf0C95skzgdfk5bFSRq ommEZ8XO3ziYQy87pVYJFddjGGiTnGCkfz5gldD+JI71BlY6tS9d7VmemhRiH2UTwCakme sYLJ87El1VUs80JawCI5BXGdeeqKTrYt4NI/DtqZz4PuKNeadz6/fSbcWqkzaQ== 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 EBFC12BEEA; Thu, 31 Mar 2022 17:50:37 +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 22VHob8B038649; Thu, 31 Mar 2022 17:50:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22VHobut038648; Thu, 31 Mar 2022 17:50:37 GMT (envelope-from git) Date: Thu, 31 Mar 2022 17:50:37 GMT Message-Id: <202203311750.22VHobut038648@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: d7e1e138ec66 - main - linux(4): Fixup options value validation in linux_waitid(). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: d7e1e138ec66e410f525413b0caed089139f3cc0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648749038; 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=vqk+AkXZJybRY7QfSLSTjQrf3nbJjrrmBPHfwcivby0=; b=RFij+6qbmMoLX8pXJBBzIGCXdldzzBfLAPrmp7HKTcqiSt+CbWmi8UdFmCzXhuNM8RCufE 6TOqnaEOVxtf1Horfeg2zlFG6rt82+FqEGn1nnoZhDDSDMkGTF93iu9EaFFP8BNI0PLf5a xPYl0HSGMtABl7dfK3IwpQzrI19l4V16SPkoTOYGc/YWLehGK4MeJGtFR7GrX5w5vvcitX blO/LFIk70obMzsoG0h/O9mTmtPT7lkwUYo4CqVbRRrn6dUm3d3/vvmHYsSsLNbqid84WQ 5+7MPvn7yPiF6toOFalPHU6HfguyXtTtBbMN8Q2vLk1xwgAIDTdM07EVofQJGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648749038; a=rsa-sha256; cv=none; b=uFvTE7joOG8wGy8Nns/CkJl83CMzknrELyfhNkcO9LQrwCuc5u9XyQkvXNNoVXAqc/ZIaZ Kd0zrZVPgiGjax8Q9SZfcT9gDmDbSgx6BS8uZdYbBMm16z9cUyEsv6rq52E/wh5mvs+nt7 tv3kSt0x3qOFf6qls4Nt0xP2X19FcpFoFraE8Tb2J//AI6XVTVKZentUoVnaiu1UbFP8yC 8ackuw6SlEeLpVOxeXgvAJeh1ehQRFNMFcAPuYZ7aNR8hBd9mcl9jHsqsM3Xbne/O/VR2g fXRx56K4rwlwuWTn7gFX4oxwVieICUca+Cyw2U+yiFO0hmof1+BzSaZLB45k4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=d7e1e138ec66e410f525413b0caed089139f3cc0 commit d7e1e138ec66e410f525413b0caed089139f3cc0 Author: Dmitry Chagin AuthorDate: 2022-03-31 17:41:19 +0000 Commit: Dmitry Chagin CommitDate: 2022-03-31 17:41:19 +0000 linux(4): Fixup options value validation in linux_waitid(). Reviewed by: emaste Differential revision: https://reviews.freebsd.org/D31554 MFC after: 2 weeks --- sys/compat/linux/linux_misc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 0d7f9b156f9b..e2c231ed3460 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1090,12 +1090,13 @@ linux_waitid(struct thread *td, struct linux_waitid_args *args) idtype_t idtype; int error, options; + if (args->options & ~(LINUX_WNOHANG | LINUX_WNOWAIT | LINUX_WEXITED | + LINUX_WSTOPPED | LINUX_WCONTINUED | __WCLONE | __WNOTHREAD | __WALL)) + return (EINVAL); + options = 0; linux_to_bsd_waitopts(args->options, &options); - if (options & ~(WNOHANG | WNOWAIT | WEXITED | WUNTRACED | WCONTINUED)) - return (EINVAL); - switch (args->idtype) { case LINUX_P_ALL: idtype = P_ALL;