From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D1ADC433FE for ; Mon, 31 Jan 2022 22:49:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC83F8D002F; Mon, 31 Jan 2022 17:49:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C511F8D0028; Mon, 31 Jan 2022 17:49:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ACA688D002F; Mon, 31 Jan 2022 17:49:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0138.hostedemail.com [216.40.44.138]) by kanga.kvack.org (Postfix) with ESMTP id 9AA8E8D0028 for ; Mon, 31 Jan 2022 17:49:39 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 487DF812285A for ; Mon, 31 Jan 2022 22:49:39 +0000 (UTC) X-FDA: 79092075678.27.A646335 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by imf04.hostedemail.com (Postfix) with ESMTP id 7966A40006 for ; Mon, 31 Jan 2022 22:49:38 +0000 (UTC) Received: by mail-pg1-f176.google.com with SMTP id 133so13641914pgb.0 for ; Mon, 31 Jan 2022 14:49:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=8wir+6pnMqsrQN0JTKY9MVVmL8DYWhxBrqC2WV+lKqk=; b=VjAau0dRv2pBIMNXN0K9d2B5FLQG+EVsT1VvprxIcF5tDK9444uEsuO4i8ZZ3f3K5I QHW5xDQzF277epoHtVEnx0HWFfuWYQ/iYtvG4HkMmeueTpiaVZ0MF8l6qyDfKCwg7Hcz mI9e2nloraRVjCx467VHEozrCrlc0zX7Fkpyc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=8wir+6pnMqsrQN0JTKY9MVVmL8DYWhxBrqC2WV+lKqk=; b=IPkQoTJ+FtJw3XfcwTPfP3s0L1UW28UGpN5RCdmVYMj7veDHQgzf+Whkpl4prVG6PA BmP2Ov4sWr2Pgl9jqaY+xI5xlAgd9OiBRPABQYSxzLgGGHTRNWvuwh5nYqIzSytZR3ut qRLk+c9yNhLnIsrCg+WsT4mOPdOM+5G+/yuMLbxuaGhOjkuOQ0YHoI6ZVYYL+if3ZqxY hd9v/rH4VPlgmUsurv9TuvkTOVE2qTNg0sFShKWFn2xW/gN7xXOz2TQb8q/UQL9kOEyg kJpt7MlQvR7IXqSusLXpl2fc6VGt6ee7gK962peRn9y5U6LUf4TTmS5EBeJ+CHbZyaR4 RQmg== X-Gm-Message-State: AOAM532uh4xy78SLCra7chxXFTmQsmrl1Bj3A/D4+WQCE+9w5H/EfB6r AnlWLadG8i/cOLe7owFoH1w/CQ== X-Google-Smtp-Source: ABdhPJz+YkwU7ATFKX2Qclfrkfe/Lhh1AMyaXK3ADBFnJOq28Oae1+USoXmwL894u2iu9dgheaXpCQ== X-Received: by 2002:a63:2c0c:: with SMTP id s12mr15167611pgs.331.1643669377455; Mon, 31 Jan 2022 14:49:37 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a125sm11726190pfa.205.2022.01.31.14.49.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 14:49:37 -0800 (PST) Date: Mon, 31 Jan 2022 14:49:36 -0800 From: Kees Cook To: Andrew Morton Cc: Christian Brauner , 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: <202201311447.4A1CCAF@keescook> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220131135940.20790cff1747e79dd855aaf4@linux-foundation.org> X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 7966A40006 X-Stat-Signature: dada9baxozzkjddo5csaepzbdgtqumpn X-Rspam-User: nil Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=VjAau0dR; spf=pass (imf04.hostedemail.com: domain of keescook@chromium.org designates 209.85.215.176 as permitted sender) smtp.mailfrom=keescook@chromium.org; dmarc=pass (policy=none) header.from=chromium.org X-HE-Tag: 1643669378-178265 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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? -- Kees Cook