Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 9e838cb0e3e34eb74590226c2ae5e504d1bd1026
Ticket: 1119369fffffffffffffffffffffffffffffffff
segfault in Tcl_EvalObjv (from Tcl_EvalObjEx call)
User & Date: pcmacdon on 2005-02-10 03:48:42
Changes

  1. icomment:
    Logged In: YES 
    user_id=190660
    
    I've verified the proposed patch is insufficient.  It is
    still exposed to execution leave traces accessing an invalid
    objv.
    Below is another exploit script based on Tcl8.4 execution
    leave trace.
    I interpret this to mean that TclEvalObjvInternal also needs
    the objPtr arg.
    Moreover, the check probably needs to be expanded to
    something like:
    
      (((List *) objPtr->internalRep.twoPtrValue.ptr1)->elements
    == objv) &&
      /* same check for objc here.  */
    
    Ironically, objv could theoretically be freed and
    reallocatted to the same block and size (ie. back to a list
    again) but although not correct, the
    execution path would at least be safeguarded from segfaulting.
    
    
    
    
      
    ###### SCRIPT BEGIN
    
    set SRC [list Foo 1]
    set N 0
    proc ::Foo str {
      puts "FOO: $str"
      if {[incr ::N]<3} {
        namespace eval :: $::SRC
      } else {
        error "BAD CALL"
      }
    }
    proc ::Trc args { puts "Trc: $args" }
    trace add execution Foo leave Trc
    uplevel #0 $SRC
    
    ###### SCRIPT END
    
    
  2. login: "pcmacdon"
  3. mimetype: "text/plain"
  4. username: "pcmacdon"