zsh-workers
 help / color / mirror / code / Atom feed
From: Han Pingtian <hanpt@linux.vnet.ibm.com>
To: zsh-workers@zsh.org
Subject: Re: zsh 5.0.5-dev-2
Date: Mon, 18 Aug 2014 10:56:20 +0800	[thread overview]
Message-ID: <20140818025620.GA4198@localhost.localdomain> (raw)
In-Reply-To: <140817103030.ZM12944@torch.brasslantern.com>

On Sun, Aug 17, 2014 at 10:30:30AM -0700, Bart Schaefer wrote:
> On Aug 16,  8:35am, Han Pingtian wrote:
> }
> } I have tried PATH_MAX*3 and PATH_MAX*3 - 1, they both can fix the
> } buffer overflow here. I also tried PATH_MAX*2 + 1/2/3, they don't 
> } fix this problem. 
> 
> I suspect Fortify is reporting a potential error rather than a real
> one, because we'd presumably have seen other problems before this if
> "cd .." actually caused an 8kb buffer on the stack to overflow.
> 
> The whole symlink-chasing code is probably ripe to be rewritten with
> zsh-heap (or even malloc + static pointers) allocation unless we have
> reason to beleive that's a serious performance issue.
> 
> For the nonce I'll just commit xbuf2[PATH_MAX*3].

FYI.

I have tried to print the length of xbuf and *pp before the sprintf(). Looks
like when overflow being triggered, the length of xbuf is 8188, and the
length of *pp is 10. 

After changing xbuf2's length to PATH_MAX*3, the result is the same:
when zsh print 

zsh: path expansion failed, using root directory

the length of xbuf is 8188 and length of *pp is 10.

All the tests was performed on top of 2be0d8bdef401b6bca0c80a7bd78d658e862e38e,
I haven't yet merged your new commit.

Thanks.


  reply	other threads:[~2014-08-18  3:06 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-12 20:29 Peter Stephenson
2014-08-12 22:36 ` Axel Beckert
2014-08-13 14:04   ` zsh 5.0.5-dev-2 / Occassional hangs on Test/A05execution.ztst Axel Beckert
2014-08-13 19:08     ` Bart Schaefer
2014-08-14  8:48       ` Axel Beckert
2014-08-14  8:50       ` Peter Stephenson
2014-08-14 16:25         ` Bart Schaefer
2014-08-14 16:31           ` Axel Beckert
2014-08-14 17:34             ` Axel Beckert
2014-08-15  4:50               ` Bart Schaefer
2014-08-15  9:32                 ` Axel Beckert
2014-08-15 17:33                   ` Bart Schaefer
2014-08-15 19:42                     ` Axel Beckert
2014-08-16 18:12                       ` zsh 5.0.5/6 Peter Stephenson
2014-08-13 17:28   ` zsh 5.0.5-dev-2 Dominic Hopf
2014-08-13 22:34 ` Oliver Kiddle
2014-08-14  8:34   ` Peter Stephenson
2014-08-14  9:32     ` Peter Stephenson
2014-08-14 16:20       ` Bart Schaefer
2014-08-14 19:54         ` Peter Stephenson
2014-08-15  4:44           ` Bart Schaefer
2014-08-15  8:38             ` Peter Stephenson
2014-08-15 11:23             ` Han Pingtian
2014-08-15 17:17               ` Bart Schaefer
2014-08-16  0:35                 ` Han Pingtian
2014-08-17 17:30                   ` Bart Schaefer
2014-08-18  2:56                     ` Han Pingtian [this message]
2014-08-18  6:36                       ` Bart Schaefer
2014-08-18 14:02                         ` Han Pingtian
2014-08-23 17:51                     ` Symlink chasing Peter Stephenson

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=20140818025620.GA4198@localhost.localdomain \
    --to=hanpt@linux.vnet.ibm.com \
    --cc=zsh-workers@zsh.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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