caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Sand-boxing
@ 2007-05-29  2:01 Jon Harrop
  2007-05-29  2:38 ` [Caml-list] Sand-boxing skaller
  2007-05-29  2:45 ` pierre chambart
  0 siblings, 2 replies; 5+ messages in thread
From: Jon Harrop @ 2007-05-29  2:01 UTC (permalink / raw)
  To: caml-list


We're gearing up for the release of our hardware-accelerated vector graphics 
engine, Smoke. As our foray into web programming, I'd like to create a new 
kind of browser that allows content to be scripted in OCaml.

What is the best way to execute downloaded OCaml code safely?

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The F#.NET Journal
http://www.ffconsultancy.com/products/fsharp_journal/?e


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Sand-boxing
  2007-05-29  2:01 Sand-boxing Jon Harrop
@ 2007-05-29  2:38 ` skaller
  2007-05-29  2:45 ` pierre chambart
  1 sibling, 0 replies; 5+ messages in thread
From: skaller @ 2007-05-29  2:38 UTC (permalink / raw)
  To: Jon Harrop; +Cc: caml-list

On Tue, 2007-05-29 at 03:01 +0100, Jon Harrop wrote:
> We're gearing up for the release of our hardware-accelerated vector graphics 
> engine, Smoke. As our foray into web programming, I'd like to create a new 
> kind of browser that allows content to be scripted in OCaml.
> 
> What is the best way to execute downloaded OCaml code safely?

The same way Flash works (or, in my case, doesn't work).
On Firefox this uses a plugin which can be installed by 
the client on demand (only the Flash vendors are
rather stupid and don't provide a 64 bit version
so you can't run Flash on AMD64 or ia64 Linux)

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Sand-boxing
  2007-05-29  2:01 Sand-boxing Jon Harrop
  2007-05-29  2:38 ` [Caml-list] Sand-boxing skaller
@ 2007-05-29  2:45 ` pierre chambart
  2007-05-29  5:12   ` Alain Frisch
  1 sibling, 1 reply; 5+ messages in thread
From: pierre chambart @ 2007-05-29  2:45 UTC (permalink / raw)
  To: caml-list

Jon Harrop wrote :
> We're gearing up for the release of our hardware-accelerated vector graphics 
> engine, Smoke. As our foray into web programming, I'd like to create a new 
> kind of browser that allows content to be scripted in OCaml.
>
> What is the best way to execute downloaded OCaml code safely
You can use the dynlink library.
When you load module with that, you can specify the modules that can't
be accessed from the loaded code.

http://caml.inria.fr/pub/docs/manual-ocaml/libref/Dynlink.html#6_Accesscontrol


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Sand-boxing
  2007-05-29  2:45 ` pierre chambart
@ 2007-05-29  5:12   ` Alain Frisch
  2007-05-29  5:47     ` Jon Harrop
  0 siblings, 1 reply; 5+ messages in thread
From: Alain Frisch @ 2007-05-29  5:12 UTC (permalink / raw)
  To: pierre chambart; +Cc: caml-list

pierre chambart wrote:
> You can use the dynlink library.
> When you load module with that, you can specify the modules that can't
> be accessed from the loaded code.

This can catch some errors, but it is not a real security
mechanism! The "security model" relies on the assumption that the loaded
modules have been produced by ocamlc from well-typed programs that don't
use unsafe features. The bytecode interpreter does not try to protect
itself against ill-behaved code at all.

  Alain


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Sand-boxing
  2007-05-29  5:12   ` Alain Frisch
@ 2007-05-29  5:47     ` Jon Harrop
  0 siblings, 0 replies; 5+ messages in thread
From: Jon Harrop @ 2007-05-29  5:47 UTC (permalink / raw)
  To: caml-list

On Tuesday 29 May 2007 06:12:15 Alain Frisch wrote:
> pierre chambart wrote:
> > You can use the dynlink library.
> > When you load module with that, you can specify the modules that can't
> > be accessed from the loaded code.
>
> This can catch some errors, but it is not a real security
> mechanism! The "security model" relies on the assumption that the loaded
> modules have been produced by ocamlc from well-typed programs that don't
> use unsafe features. The bytecode interpreter does not try to protect
> itself against ill-behaved code at all.

But if the browser downloads the OCaml source code from the server, compiles 
it using ocamlc with restrictions on the client and then dynlinks it, 
everything should work safely? This was actually Francois Rouaix's idea. I 
think it will be much more user-friendly to put OCaml source code on your web 
server. The only problem I can think of now is malicious sites exploiting 
exponential type growth to hang the client's ocamlc. :-)

I assume I can ban the code from accessing LablGL directly (it is unsafe) but 
I can allow it to access our library that uses LablGL (which is safe)?

I think this is a killer idea! Instead of writing a web page in HTML, you 
write it in OCaml and call our library to generate a scene graph for your 
entire site.

Incidentally, I'm uploading our vector graphics library:

  http://www.ffconsultancy.com/products/smoke_vector_graphics/

The Linux demos should all work now and I'm working on the free edition 
downloads. I'm particularly keen to know if the x86 Linux demos work because 
they were built in a 32-bit chroot on my AMD64...

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The F#.NET Journal
http://www.ffconsultancy.com/products/fsharp_journal/?e


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-05-29  5:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-29  2:01 Sand-boxing Jon Harrop
2007-05-29  2:38 ` [Caml-list] Sand-boxing skaller
2007-05-29  2:45 ` pierre chambart
2007-05-29  5:12   ` Alain Frisch
2007-05-29  5:47     ` Jon Harrop

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