From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 3B587BCA7 for ; Wed, 16 Feb 2005 23:55:38 +0100 (CET) Received: from first.in-berlin.de (dialin-145-254-053-209.arcor-ip.net [145.254.53.209]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1GMtb90026966 for ; Wed, 16 Feb 2005 23:55:37 +0100 Received: by first.in-berlin.de (Postfix, from userid 501) id AF25CACCE8; Wed, 16 Feb 2005 23:55:34 +0100 (CET) Date: Wed, 16 Feb 2005 23:55:34 +0100 From: Oliver Bandel To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Safe marshall? Message-ID: <20050216225534.GA556@first.in-berlin.de> References: <059442cb47f5e19bca230316a6ae6261@fas.harvard.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <059442cb47f5e19bca230316a6ae6261@fas.harvard.edu> User-Agent: Mutt/1.5.6i X-Miltered: at nez-perce with ID 4213CF69.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; oliver:01 bandel:01 oliver:01 in-berlin:01 caml-list:01 wrote:01 type-safe:01 marshaling:01 marshaled:01 computed:01 c-interface:01 ocaml:01 imho:01 ....:98 arbitrary:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: On Wed, Feb 16, 2005 at 05:07:55PM -0500, Mike Hamburg wrote: > Is there any way to call Marshall in a type-safe way? I need to use > marshaling for a networking program, and I'd rather not leave Marshal > as an arbitrary code execution vulnerability (which it is as far as I > can tell: switching on a Marshaled value should produce a computed > jump, which can be set by an attacker to point to an arbitrary place). > Am I stuck writing my own marshal function? Is it possible to say a C-function *anything* about a datastructure's structure? Via the C-interface of OCaml?! If so.... at least under Mac OS-X it should be possible to solve that task with Objective-C. It can dump objects completely. So this - at least on this platform - would be possible then. But IMHO this may not be possible with all Objective-C implementations. Ciao, Oliver