[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a05d4cd3366e4047ba42663738e12198@AcuMS.aculab.com>
Date: Thu, 24 Jun 2021 07:21:15 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Kees Cook' <keescook@...omium.org>
CC: 'Guillaume Tucker' <guillaume.tucker@...labora.com>,
Shuah Khan <shuah@...nel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2] selftests/lkdtm: Use /bin/sh not $SHELL
From: Kees Cook
> Sent: 23 June 2021 23:47
>
> On Wed, Jun 23, 2021 at 04:27:47PM +0000, David Laight wrote:
...
> > You can probably even do:
> >
> > echo "$test" | /bin/sh -c cat >$TRIGGER || true
> >
> > (moving the redirect to the outer shell).
>
> Actually, it looks like the "write" is already happening in the exec'd
> process, so this can just be:
>
> echo "$test" | cat >$TRIGGER || true
>
> But it still can't be:
>
> echo "$test" >$TRIGGER
>
> which is what I had over-engineered a solution to. :)
That one fails because echo is the shell builtin.
But:
/bin/echo "$test" >$TRIGGER
should be fine.
Quite where the original came from I not sure I want to find out.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists