dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harald van Dijk <harald@gigawatt.nl>
To: Denys Vlasenko <vda.linux@googlemail.com>,
	Martijn Dekker <martijn@inlv.org>,
	Herbert Xu <herbert@gondor.apana.org.au>
Cc: dash@vger.kernel.org, busybox <busybox@busybox.net>
Subject: Re: [BUG] Interactive (d)ash exits on assigning to readonly from 'command eval'
Date: Sat, 29 Oct 2016 20:22:00 +0200	[thread overview]
Message-ID: <501f83a0-9a46-f4af-dc56-ba8db958bad1@gigawatt.nl> (raw)
In-Reply-To: <CAK1hOcO25fYP71DRxk=Dga5UZ6=FfmdDHTj6AWNNGSu_J0B+Dw@mail.gmail.com>

On 28/10/16 15:55, Denys Vlasenko wrote:
> This will probably be mangled by gmail, but here is the proposed fix:

This looks about the right approach, but it causes problems in 
subshells, a double free:

$ ./busybox ash -c 'readonly x; echo $(command eval x=2)'
ash: eval: line 1: x: is read only
*** Error in `./busybox': free(): invalid pointer: 0x000055a784c1c300 ***
[...]

That's with busybox checked out from git (commit 
9db74e49e5b462089c6eec0182d819c0d4708e57), where your patch is applied, 
completely unpatched and completely default config.

I omitted the backtrace output, but it's popfile() getting called, after 
popallfiles() has already been called.

Cheers,
Harald van Dijk

  reply	other threads:[~2016-10-29 18:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-27 21:40 Martijn Dekker
2016-10-28 13:55 ` Denys Vlasenko
2016-10-29 18:22   ` Harald van Dijk [this message]
2016-10-30 17:32     ` Denys Vlasenko

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=501f83a0-9a46-f4af-dc56-ba8db958bad1@gigawatt.nl \
    --to=harald@gigawatt.nl \
    --cc=busybox@busybox.net \
    --cc=dash@vger.kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=martijn@inlv.org \
    --cc=vda.linux@googlemail.com \
    --subject='Re: [BUG] Interactive (d)ash exits on assigning to readonly from '\''command eval'\''' \
    /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

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).