Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2516190pxb; Thu, 3 Feb 2022 08:13:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0DFwgZw1Yh1S41KCJWr8Fiy5jqf0XONwMy3l1wAXhfoxST8z8MHwlgdiJwkIPT3ralNKX X-Received: by 2002:a17:907:7b99:: with SMTP id ne25mr30546018ejc.42.1643904799554; Thu, 03 Feb 2022 08:13:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643904799; cv=none; d=google.com; s=arc-20160816; b=uKdVgTKJvuT5maAamV6IpEP65P/Rg+pqJae8Y/OlE73kVYKXP3+jrPWrV/GBFs5Tto Vf2INCUAfjPSiWqF6pwvFQnZ59HU4A9M03DePbnrwNSYlJcVNwZ0ABxVCgt8Ucbn61aB YMhoDAJrzAjzfSvlPWcOXqFPWbhi/FLRPNSCIczm0roQPZsjKeij4xyxpgeV5sTgGSbX dyB1xcKeTfDrQYPOYamRGHzYCruk6M7AGi9fFskJX/8zJhUU8+oaxiDziFYKAW7cCt1z yNosb9LFyGtupDPZVOkrPGpj07GrbU5/45SeI/5CWKspEFfDowC3FIekEYEg422idq6T IWzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=5ZgUDIIYZb0p0sGt1ruE6r7EKduNuE6iJPlnBrAIoKA=; b=XmRq1iQCc1rKPj7HIpKFb+BJvPElIy71oBNB1bZxKvPUar4weuYJZcJupNbwwqTqde ecK7bnhlBBcbPmWhr3z4CzMnN0FL4D+/qOADtea4uET0IfqEZNHpFQuJ8Urh2a2ZSfS5 pxXH0qevYVdM1oWK+OqRPzo2iQtY9U9uMpT7qVtDVnbY6LNTJi784j327q53pVj+YYOx FHxMBjqnIbxqJKwn2J3tRLV+9hjAeVKdw7rkBXziBnJExBHnms44vI6VTnX0yyNwzcaE ZfKZjPJ1QmdDyJ0cY0KEpCU4FSoHWORlo+HA6IofpEdhHZBvlJmQdFlMM08sg8E0ckDZ BXHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=cUKtZGME; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6si16598769edc.398.2022.02.03.08.12.52; Thu, 03 Feb 2022 08:13:19 -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=@linuxfoundation.org header.s=google header.b=cUKtZGME; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236238AbiBBRjA (ORCPT + 99 others); Wed, 2 Feb 2022 12:39:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235634AbiBBRi7 (ORCPT ); Wed, 2 Feb 2022 12:38:59 -0500 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 665A4C06173E for ; Wed, 2 Feb 2022 09:38:59 -0800 (PST) Received: by mail-io1-xd2c.google.com with SMTP id z199so26390640iof.10 for ; Wed, 02 Feb 2022 09:38:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=5ZgUDIIYZb0p0sGt1ruE6r7EKduNuE6iJPlnBrAIoKA=; b=cUKtZGMEPyShwOxkBLK4TT6kN7iU9FHiF/YbNpPfqYjw0okt5j1OVTXSJqqaOO1qic /YNUuFlCbUAaGudiS8lOBDA3wHToNsrSsxYGp1MlhN6AGhKBfd3tQ42rHsivBJ0Xao5K Ny30q3/1w0SYI7sr4pWArpxIagMxVCqYJcmwo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5ZgUDIIYZb0p0sGt1ruE6r7EKduNuE6iJPlnBrAIoKA=; b=jKuBqQPSIdPUxctvPRykX30Onn2KNlMKMwtONOhVl0xF3UT90XFQdr+La2117+gikq 6/vH1cuFYtDaJuLkB7zuKxCxRxF3HorZGUR0jvG3NZyDmV89m5fPWd4xW3QjsbdT6lqS jAMYoAigKI8Og2v1Yq2YVuzqCPcVjXFmC7sFGooiOn03uhls90Euj6ugXYOzjSd4tk3L ALtKX4o/VGvH9LJWdSzBflfnedyrYrX7Ri/9o5jLuAMAalSSaNUJPS9F2WX2Yqtl49As nEolQnbLtDXQ/k4GMpduvP68C02PyS+xtdDYNgtTFBFHfh4M26712dSWpQp33sHgI24u Vy3A== X-Gm-Message-State: AOAM530oTeneXBwSouOSf6XggDn6XY95iD64kPSn9nKMZK2T9RgvqZpe gj1Ka3PcQuHI9be6PJnKSJAgtQ== X-Received: by 2002:a05:6638:4105:: with SMTP id ay5mr16415785jab.186.1643823538745; Wed, 02 Feb 2022 09:38:58 -0800 (PST) Received: from [192.168.1.128] ([71.205.29.0]) by smtp.gmail.com with ESMTPSA id y22sm3767548iow.2.2022.02.02.09.38.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Feb 2022 09:38:58 -0800 (PST) Subject: Re: [PATCH] selftests/exec: Avoid future NULL argv execve warning To: Alexey Dobriyan , Kees Cook Cc: 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, Shuah Khan References: <20220201000807.2453486-1-keescook@chromium.org> From: Shuah Khan Message-ID: <7af32164-dbdf-26f1-1aaa-b720365f9743@linuxfoundation.org> Date: Wed, 2 Feb 2022 10:38:57 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/ thanks, -- Shuah