public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadentplace.org.uk>
To: Dave Korn <dave.korn@artimi.com>
Cc: insight@sources.redhat.com
Subject: RE: Possible security flaw in Insight
Date: Tue, 01 Nov 2005 15:11:00 -0000	[thread overview]
Message-ID: <1130857884.1994.24.camel@localhost> (raw)
In-Reply-To: <SERRANO1E9GQvnbEG1000000071@SERRANO.CAM.ARTIMI.COM>

[-- Attachment #1: Type: text/plain, Size: 1396 bytes --]

[I'm not subscribed to the mailing list, so please continue to cc
replies to me.]

Dave Korn wrote:
> Ben Hutchings wrote:
> > This security advisory explains a bug in some versions of Tcl, which
> > may affect Insight.
> > 
> > Ben.
> > 
> > readdir_r considered harmful
> > ============================
> 
> 
>   Well, readdir_r is used in tcl/unix/tclUnixThrd.c as follows:
> 
> --------------------------------snip--------------------------------
> typedef struct ThreadSpecificData {
>     char	    	nabuf[16];
>     struct tm   	gtbuf;
>     struct tm   	ltbuf;
>     struct {
> 	Tcl_DirEntry ent;
> 	char name[PATH_MAX+1];
>     } rdbuf;
> } ThreadSpecificData;

In some versions of Tcl (8.4.2 to 8.5a2 inclusive), the dimension of the
name field is MAXNAMLEN+1, not PATH_MAX+1.

<snip>
>   I'm with Zaraza (sp?) on this one.  What's wrong with statically sizing it
> to NAME_MAX+1, in accordance with the demands of the posix spec?
<snip>

NAME_MAX isn't required to be defined (and MAXNAMLEN isn't even
mentioned by POSIX, though it is equivalent on many systems).  GNU/Hurd
doesn't define it, for example, because there is no practical limit on
name lengths there.

Ben.

-- 
Ben Hutchings
When you say `I wrote a program that crashed Windows', people just stare ...
and say `Hey, I got those with the system, *for free*'. - Linus Torvalds

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-11-01 15:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-01  3:59 Ben Hutchings
2005-11-01 14:53 ` Dave Korn
2005-11-01 15:11   ` Ben Hutchings [this message]
2005-11-01 18:34     ` Dave Korn
2005-11-01 20:11       ` Ben Hutchings

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=1130857884.1994.24.camel@localhost \
    --to=ben@decadentplace.org.uk \
    --cc=dave.korn@artimi.com \
    --cc=insight@sources.redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).