Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2015318pxb; Wed, 2 Feb 2022 18:54:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiAUGdaE7KXwASjDOKTymCWuGkOuXiR83Q2VCwtSa0tlGPlEQimktP3WmTIFTbXZpCMRvk X-Received: by 2002:a17:90b:390f:: with SMTP id ob15mr11651414pjb.195.1643856882591; Wed, 02 Feb 2022 18:54:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643856882; cv=none; d=google.com; s=arc-20160816; b=bQ7gJZ1TIMTYg4eAYBDO0CfpM8qQZkiD4JTOi4VJoLc6yNd/kw1ka1472GArBfIoF2 zRHxmbLvASspxf9sS4RlEyqrx8SlLrUEkFFU6LPqCg51E6amd0bytLIYSTEJGlOr6Etl afEzD+SW5TyiF82V5Mkbnr1EhLnngwlw7wYAB5XKIYez4KVbY93d+pXTOLaX1i9QEgtN 2uV9dHu1l9z61FKmj6op30iXtnKKPefAZuiICl2+suZGORTM6FNeCNiYmofk2dLSb+qT l+/XOf2u0ZXHqWwsFFKvrjJK2aYGZc+eS+8+3BM9wisCAPtmyT9r8BXA532/uf3iOS25 CG5g== 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=7OLSMx2LWSD7WsWcsdtwVZjsVIo2l+VXQLS4NW/dV3s=; b=eYQr4w6RTQu3adCsVc+XfMRYLYwiWsep9iWuAJ2J/vqzsKqe978sXbEVTk1pPGExyu R1pLPCiqD3YgdaKKIKG3ST7DKKdpoK49n5+iO24vLh/JojvisUD27KPE1OZR9hV3lHvU YV9kYV3XiCQ8eNUSjG88TTwF9/b6hsMX3SHqSCzWfKWX95zTQ87vHBNP2vQW6nJomNJ7 uzuA8/WzuBSPJigpU2vjnoSIwrCv/Lz2LzADqxW9w4WgB6kXhk0xDjoJ/cWiiuMb7V9a YJMFkPVnfGW9TLZSfaHNuYa2OryJjLOYWb3xqpKuxgrBtxrqbT3CeB/VgMACAh3zOgZu jCOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eFLJLpFY; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g14si22102483pfc.253.2022.02.02.18.54.20; Wed, 02 Feb 2022 18:54:42 -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=@gmail.com header.s=20210112 header.b=eFLJLpFY; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347355AbiBBVAi (ORCPT + 99 others); Wed, 2 Feb 2022 16:00:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347368AbiBBVAh (ORCPT ); Wed, 2 Feb 2022 16:00:37 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9AACC061714; Wed, 2 Feb 2022 13:00:36 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id k18so840912wrg.11; Wed, 02 Feb 2022 13:00:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7OLSMx2LWSD7WsWcsdtwVZjsVIo2l+VXQLS4NW/dV3s=; b=eFLJLpFYFhHEofxCZUnGM50cphxmqi3TKrpCx+wcfetrsnhrHvhxr4vOJE7lYB9ZmT /elrTIKpSpkNXbqzxpdrXO2XLx2iEBrHH6xoHjDn+FbU4BKv6zKwNVN21CO+5xc3Q3Wf 8JKqHd/l5LZtx1UNv6k/TCXVkNZGL6v3a4kNko+voY2evS+gEb46C0pQ8OzSTtQs7eRe TnD0irmM9NqYkKyUvBgrOjQkKwLVCIrCjj2Ic8XUshmvRRkPVspCOJU2ZB0Y+O8xoyCf aEzKh+7sGJIbiGcAOtsLd45+WZlD/YL3t9Af/XVy46iejsEd+O6bWOu0HMrzUUxWtaaP TRYA== 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=7OLSMx2LWSD7WsWcsdtwVZjsVIo2l+VXQLS4NW/dV3s=; b=5tHP4qXhBSqYZV0QAAEf3J2QVGn/2kGyD/AasRlG/uQClMur1NKvQ179+75mPm9lJ6 SvjWkiMXi77NlkFXgdpItQHIJYzoKFxCj2DAq39ojLJo0+nXgGgxh7cPWPrdTJzCMhDz Dj9knsKOAHKNG6y8Pu65HNvH1/dzltQFuP3zsT1dcH3XBCdUVsxBghLMXMs/1BV6m9dg qOc90AnW5YJhvMhc1OAByftpV6BUhSpVIRlXFKLuF+Zi7rqSC9xyB92trWZV20bLwqli QAsGrxy4tdoRwIw2yyxQGnRfjMhFlRcMyRGCOhLbMuJH88pbcK4nCFCvgt1ow853AwLn 5/SA== X-Gm-Message-State: AOAM533gaI2oGgdc6xQDx8jijjWlmAcprRuuGn+axjuSVj1gkWekJJ53 77CsZxfMGMgpkSOodskLaw== X-Received: by 2002:a5d:494b:: with SMTP id r11mr27085816wrs.626.1643835635248; Wed, 02 Feb 2022 13:00:35 -0800 (PST) Received: from localhost.localdomain ([46.53.252.48]) by smtp.gmail.com with ESMTPSA id j19sm6464929wmq.17.2022.02.02.13.00.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 13:00:34 -0800 (PST) Date: Thu, 3 Feb 2022 00:00:32 +0300 From: Alexey Dobriyan To: Shuah Khan Cc: Kees Cook , Eric Biederman , Shuah Khan , linux-kselftest@vger.kernel.org, Ariadne Conill , Michael Kerrisk , Matthew Wilcox , Christian Brauner , Rich Felker , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] selftests/exec: Avoid future NULL argv execve warning Message-ID: References: <20220201000807.2453486-1-keescook@chromium.org> <7af32164-dbdf-26f1-1aaa-b720365f9743@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7af32164-dbdf-26f1-1aaa-b720365f9743@linuxfoundation.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 02, 2022 at 10:38:57AM -0700, Shuah Khan wrote: > On 2/2/22 8:13 AM, Alexey Dobriyan wrote: > > On Mon, Jan 31, 2022 at 04:08:07PM -0800, Kees Cook wrote: > > > Build actual argv for launching recursion test to avoid future warning > > > about using an empty argv in execve(). > > > > > --- a/tools/testing/selftests/exec/recursion-depth.c > > > +++ b/tools/testing/selftests/exec/recursion-depth.c > > > @@ -24,8 +24,14 @@ > > > #include > > > #include > > > +#define FILENAME "/tmp/1" > > > +#define HASHBANG "#!" FILENAME "\n" > > > + > > > int main(void) > > > { > > > + char * const argv[] = { FILENAME, NULL }; > > > + int rv; > > > > Can we move out of -Wdeclaration-after-statement mentality in tests at least? > > selftest like the rest of the kernel follows the same coding guidelines. > It will follow the moving "-Wdeclaration-after-statement mentality" when > the rest of the kernel does. > > Looks like this topic was discussed in the following: > https://patchwork.kernel.org/project/linux-kbuild/patch/c6fda26e8d134264b04fadc3386d6c32@gmail.com/ The only real argument is "gcc miscompiles /proc" to which adding -Wdeclaration-after-statement looks like a too big hammer. Why can't we have nice things?