From nobody Fri Jan 28 22:49:57 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 C0939197C27E; Fri, 28 Jan 2022 22:49:57 +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 4Jlt2F4s9Bz4cD0; Fri, 28 Jan 2022 22:49:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643410197; 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=VSCYwIvB6ZjRfW6T6DuDiN9Dvjk1ekrAPEowT9GOrkc=; b=Uk5ZYo72Zdk2V7qvix4ot9/24OObExVRX3sJfD6l9gWhSORLzm8WvpNQaX0gIUmuLrUlII hBkhD1D685jAoUTa6Wcwmnn+T+t/m9VOjHLHq1bwXmY0GV3d4NjzsdqJbeZhsIEFt7z/K4 xBvDQpy6GwSkSRs62qhrh5wcNtKeeERuRSMYvhyOeuLZNTK85CRcEoMZBqHZrP0rsZhkNw d4hJ20FaXwULCCXVt2ThYol2r7jDDV36dgneceb/lYYgIxPJkmXHYGS/3u8LX0xhh+X2BJ TPcCi5Ta/LoaHo+kW6hR+012gkU1ExO6W/UoSKOpKtYrD4w9nCVhx+gSALMksg== 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 81C2D2954; Fri, 28 Jan 2022 22:49:57 +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 20SMnvwO039506; Fri, 28 Jan 2022 22:49:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20SMnvVO039505; Fri, 28 Jan 2022 22:49:57 GMT (envelope-from git) Date: Fri, 28 Jan 2022 22:49:57 GMT Message-Id: <202201282249.20SMnvVO039505@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 1c91aedf25bc - main - dma: exit if invoked with invalid (zero) argc 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c91aedf25bce879a8aced6439200e46601eb8a4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643410197; 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=VSCYwIvB6ZjRfW6T6DuDiN9Dvjk1ekrAPEowT9GOrkc=; b=FygDxEjepyrN9eJ2yo07wIg7hOvN/PRnuViCCuITv9C70d/R0MpO41/pVRbLsqsidVpiLO O9CGfpc2hxxbMmU2PA6TWjFTuIY7JFtoJwEz+mPRqbP3NdStfpEJbwPvj4gYNf6LL37F46 eIOtnnICoPFkyuJXo0D/fWQ1fMwBds3EwQvcxhfGhVWWUg0gV5atIRsazhBgZMscYc3nXI /I6qlU4klkUBbLhAVVdGt+OkXYU0Yb1qqCzJw/Ig6Fo0+yXYnWIsux+TMAqvnXHDn/XFhq U+0N0KbxHqGCAKInJWu/FWeXmTZBQqDNv2ZG8eLH93AauxgeSMaGDTO/DQQRzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643410197; a=rsa-sha256; cv=none; b=fHnfhnclR0kv9yaWrXEX6Wd8ei5cUAzFra1e1Xt76lf5RgZIBBMnZhsN6x4bRgU4B+UQ3E +EbhEWoKFnfplUfScT8xrUVR5tYTeJ7gorDwBd0KlIbMe45N0rxqa5NgHU5y/QICv1Erzr /HIlCyT8kz0fe5+Vpzisfzdu5F2pchXCJFp6Em6Wrb3tb/bIKjIL7ZvWLACcWNVjR2cAs/ RihIbJchKundSqcy7suganlsAD3LuAFNdzX186P56F03f1rk3txEby3O1GnJlGzMR/AB1a bexHwmOEKTBCZu8K4kyQEFsKGKrwOAMVoCF9UXF2KQkDrsjHM2r1NHQCfqe7/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1c91aedf25bce879a8aced6439200e46601eb8a4 commit 1c91aedf25bce879a8aced6439200e46601eb8a4 Author: Ed Maste AuthorDate: 2022-01-28 22:15:02 +0000 Commit: Ed Maste CommitDate: 2022-01-28 22:49:45 +0000 dma: exit if invoked with invalid (zero) argc This was prompted by the recent pkexec vulnerability (CVE-2021-4034). This change is being made on general principle for setuid/setgid binaries and is not in response to an actual issue. Reviewed by: kevans, markj (both earlier) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34087 --- contrib/dma/dma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/dma/dma.c b/contrib/dma/dma.c index 72115ae2b55e..7cad25a214ee 100644 --- a/contrib/dma/dma.c +++ b/contrib/dma/dma.c @@ -428,6 +428,9 @@ main(int argc, char **argv) int nodot = 0, showq = 0, queue_only = 0, newaliases = 0; int recp_from_header = 0; + if (argc == 0) + errx(EX_OSERR, "invalid argc"); + set_username(); /*