From nobody Fri Jun 17 19:38:45 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 AF5CB85B5D9; Fri, 17 Jun 2022 19:38:45 +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 4LPq913hdWz3QkG; Fri, 17 Jun 2022 19:38:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494725; 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=su20sHETFoeLOHA6M74zFsrysNmYUmft8LnhjMzNIN0=; b=MJHyiUGmujGV2CMD4r3bbIj1TjDbjPx2+hjPRidVLq9NO39GhXS8nYu3aJYR9xkUG8THzV VZeEy6zRTuNCN016IkcSOI4WFqNkOy9Bmj4vOexf+VIkD1BXfhxmF3OIyrToNG9993+gq/ rvazl/x+nPpT6QKX0Implj1w+M4hobPqMncVLKP+b6ysamKTpjLa6s3eiIIwLw7nwQGtUF CBUoeCxvD5Y7fCsyPQ9D2dHT2iw3J6KFaYf1YtqqJ+mY2HLJ48qj6iaqCE+6KtjpCKHpf4 5hAxcHsHKfjYuxA2953gvr3RfCqFc10aSSQUXFlOhxhCZLklo0aj9sIdOPNmlg== 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 5DF4625D87; Fri, 17 Jun 2022 19:38:45 +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 25HJcjxP015103; Fri, 17 Jun 2022 19:38:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJcji5015102; Fri, 17 Jun 2022 19:38:45 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:38:45 GMT Message-Id: <202206171938.25HJcji5015102@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: 7df3421cb6e2 - stable/13 - linux(4): Fixup options value validation in linux_waitid(). 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: 7df3421cb6e2178fbf92ed54f5990702de285cd3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494725; 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=su20sHETFoeLOHA6M74zFsrysNmYUmft8LnhjMzNIN0=; b=Lb8xOTD2aIYmmoHZaMQusjey/IMsuiBs+uaH60gGikQZzbjxG0iGu18bIgJAX/VCdXqBhr TykNg70B10B+7IxHJSm4435Ai6kopjT97PTdzgXxYf9g5ejbWgvNTK1uinN8gf4NuJ00Cz djMvHNzGvpfp58L0bmZI5SJ59gsmn7WCHaeFwrJ65+oJqjfOK3O+DJodiQgVXLFmc+qBW3 9Mh8RF+fK+7ze0SI92CC2bs/jDT4KDW7yZBeKlYtzIQlWm3XHAYQfv6BmUsx78B57ybZAV Z2GUbmNa2b4IrkZnrh6Sy02prLHprEAZ8mkt9OUmravwoUhLN19GwteS3zLChQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494725; a=rsa-sha256; cv=none; b=WWr5D8bsTlsU+9oEs+Gv7r6j/vw/0SBa4kdBYWhktyLodzblUHt0g7YzsrVv15huWQiwJi hkiCy5G+7iavunwTyw6Npv8IIALYP4NROteRiFoyefSRAFGy57fO2N5GuIhNHs0Pxe9rsz 3860LAcAGfYqKUvC2IdS9jHs9lTEn5YVtSgndChNeiOyxKaXhBHk/uqBR/l3OEyPYC33JV cVhogjmu5iHZev3P4a/NmtMqnZtZpuPWLQg7yJJrkDCBgCw5RgGrDyZcCKg+oQJXOnHQjw /e8/HLkg4aIvboW6C40qleGwMMF7gceCkmFCl4icDtUUDH4S8AOlaLWbtBRiyg== 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=7df3421cb6e2178fbf92ed54f5990702de285cd3 commit 7df3421cb6e2178fbf92ed54f5990702de285cd3 Author: Dmitry Chagin AuthorDate: 2022-03-31 17:41:19 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:44 +0000 linux(4): Fixup options value validation in linux_waitid(). Reviewed by: emaste Differential revision: https://reviews.freebsd.org/D31554 MFC after: 2 weeks (cherry picked from commit d7e1e138ec66e410f525413b0caed089139f3cc0) --- 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 ffebf9cd2e20..00783091175c 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;