Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3088188pxb; Fri, 4 Feb 2022 00:36:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwl5hT2be/BneLWuOwkqGz1ovhsiYet4grUg0eMz5/cO8a1Am2nWCAX3ysTV+6vkgzrb28P X-Received: by 2002:a05:6a00:13a6:: with SMTP id t38mr2084380pfg.25.1643963781616; Fri, 04 Feb 2022 00:36:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643963781; cv=none; d=google.com; s=arc-20160816; b=h6BK2iE6AQShtdT7t/MLzYBGZzbXM94S5TPJf6buYu0vAlb9z7EvpBnuA+07YLiIRb 5IhfCHREoEgqPRLPAVOwbqyG/3mw0t9xMOg/6O901pHdYwc8xt5+Jwe8M3Yc0kR0T34A fGB1nX/mmFSPu5mk8/fEVvAKkRMLHjPVWd7QZWBO3WOq4wakHxnxxvObCz25DuSwlaEn D+MiXkJIbaeQHi/4pjDgzIMr+Ljfr9N6Xeb6gO1T2wuSz3YEwojudwy4umOTofAZek+z J64EHnbNppdbjSpnmZVQZTwYQ1fqQcd/0RO0KJI9TjnuWg0eQCsCTQOZM3sCITsUcTy9 ttNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rJYhqMITRJtbM3KT2T6wSLhvtCrPNDr0yNXeGtYyRxE=; b=qiO0K8X+/79XDGAFaN7wd4JdhkVva9YWLEc1z8WyBAyxcffVABLi13gU0jCBqt9rfd M4JiCVJUzewZJ8g6JurfM7+SZmSxEFz5MAnjjfWKgu3QzxPLFoZ8wTFBaE40otLe/yuL SQR7S3UN30SFahnvjzfhWagNGlRiXF0dQvXHvAjNFz+Wga7TYrxqwlhMYD+WvnUI4OkR i+bdBE2hY8UFUFWnUhJ9p28Tx2cOi8LeyRCAugeIJcIGXW6q5ODSjhf+JabRuJQziAzb NGG5EDWCxY7Z6YjNWc2TH9kdM0wrySdpK7mhZUe45YPUBxuQU1POj3gs6f0sFfRVyTHx qutw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="X8GRn9j/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s14si1381719plg.205.2022.02.04.00.36.09; Fri, 04 Feb 2022 00:36:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="X8GRn9j/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238598AbiBAN2y (ORCPT + 99 others); Tue, 1 Feb 2022 08:28:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238612AbiBAN2x (ORCPT ); Tue, 1 Feb 2022 08:28:53 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BC5FC061714; Tue, 1 Feb 2022 05:28:53 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 244D86154A; Tue, 1 Feb 2022 13:28:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 252C4C340EB; Tue, 1 Feb 2022 13:28:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643722132; bh=cXcPTewqmwfdy6WLzBYTm7mmiY7gQapV5gLUnxXuBJM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X8GRn9j/6VclNn2LaMi7ILPvNbU/WrXIIlXxEKwimOnwbWX9YeOOUylmsw61ESpXu pEVDMCNaVgxh1uZbW3sYgofCcZ2zIcSuq2GCl7lrU4fM65WJSONbV1PrFBn+L+eA3i fpXLXbrc0mbqhQfGIEW6Srqrnm8jYUtziPsBBRzZyMGCA90aFlUuQapvjqOvy2NT0k 9zYOwH6mwPO0EmOoUshgBFDcbaFg1mzurh6+EbcVw9lebGwFoakXr9DhdhRlZVvz4q x5MdzJGoCrl6HODSKJy9w0vrWhV8dk4ID11sxcfecfX2Xweb/rjQFiStiIfBD7ly0X yg9DwCidSsRIw== Date: Tue, 1 Feb 2022 14:28:46 +0100 From: Christian Brauner To: Kees Cook Cc: Andrew Morton , Matthew Wilcox , kernel test robot , Ariadne Conill , 0day robot , Michael Kerrisk , Rich Felker , Eric Biederman , Alexander Viro , LKML , lkp@lists.01.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org Subject: Re: [fs/exec] 80bd5afdd8: xfstests.generic.633.fail Message-ID: <20220201132846.7rrkosqyeidij47w@wittgenstein> References: <20220127000724.15106-1-ariadne@dereferenced.org> <20220131144352.GE16385@xsang-OptiPlex-9020> <20220131150819.iuqlz3rz6q7cheap@wittgenstein> <20220131153707.oe45h7tuci2cbfuv@wittgenstein> <20220131161415.wlvtsd4ecehyg3x5@wittgenstein> <20220131171344.77iifun5wdilbqdz@wittgenstein> <20220131135940.20790cff1747e79dd855aaf4@linux-foundation.org> <202201311447.4A1CCAF@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <202201311447.4A1CCAF@keescook> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 31, 2022 at 02:49:36PM -0800, Kees Cook wrote: > On Mon, Jan 31, 2022 at 01:59:40PM -0800, Andrew Morton wrote: > > On Mon, 31 Jan 2022 18:13:44 +0100 Christian Brauner wrote: > > > > > > in other words, the changes that you see CMD_ARGS[0] == NULL for > > > > execveat() seem higher than for path-based exec. > > > > > > > > To counter that we should probably at least update the execveat() > > > > manpage with a recommendation what CMD_ARGS[0] should be set to if it > > > > isn't allowed to be set to NULL anymore. This is why was asking what > > > > argv[0] is supposed to be if the binary doesn't take any arguments. > > > > > > Sent a fix to our fstests now replacing the argv[0] as NULL with "". > > > > As we hit this check so quickly, I'm thinking that Ariadne's patch > > "fs/exec: require argv[0] presence in do_execveat_common()" (which > > added the check) isn't something we'll be able to merge into mainline? > > I think the next best would be to mutate an NULL argv into { "", NULL }. > However, I still think we should do the pr_warn(). > > Thoughts? +1