linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Shuah Khan <skhan@linuxfoundation.org>
Cc: Kees Cook <keescook@chromium.org>,
	Eric Biederman <ebiederm@xmission.com>,
	Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org,
	Ariadne Conill <ariadne@dereferenced.org>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Matthew Wilcox <willy@infradead.org>,
	Christian Brauner <brauner@kernel.org>,
	Rich Felker <dalias@libc.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	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
Date: Thu, 3 Feb 2022 00:00:32 +0300	[thread overview]
Message-ID: <Yfrw8GREVRgN76tF@localhost.localdomain> (raw)
In-Reply-To: <7af32164-dbdf-26f1-1aaa-b720365f9743@linuxfoundation.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 <sys/mount.h>
> > >   #include <unistd.h>
> > > +#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?

  reply	other threads:[~2022-02-02 21:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01  0:08 [PATCH] selftests/exec: Avoid future NULL argv execve warning Kees Cook
2022-02-02 15:13 ` Alexey Dobriyan
2022-02-02 17:38   ` Shuah Khan
2022-02-02 21:00     ` Alexey Dobriyan [this message]
2022-02-04 16:11       ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yfrw8GREVRgN76tF@localhost.localdomain \
    --to=adobriyan@gmail.com \
    --cc=ariadne@dereferenced.org \
    --cc=brauner@kernel.org \
    --cc=dalias@libc.org \
    --cc=ebiederm@xmission.com \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).