cnbird1999 / seccompsandbox

Automatically exported from code.google.com/p/seccompsandbox
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Change syscallTable to be filled out at run time #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently syscallTable is filled out statically in syscall_table.c.
This has to be done in C to make it read-only because of a limitation
in g++.

An alternative would be to fill out the table at run time.

From http://codereview.chromium.org/3414016/show:
  "syscall_table.c is only saving us 4k of memory vs. populating at
  runtime, and only for non-PIC code.  Building this into a PIE or a
  library would lose the saving.

  Populating the table at runtime would make it easier to define
  policies or have alternate syscall handlers.  e.g. NaCl requires
  modify_ldt(), but it would be good to disable this for other
  processes just in case.  Plash would like to intercept open() to
  operate purely via message passing."

Another advantage would be that the table can be filled out in C++.
The asm("playground$foo") tricks we use to mix C and C++ wouldn't be
needed any more.

Original issue reported on code.google.com by mseaborn@chromium.org on 30 Oct 2010 at 1:38

GoogleCodeExporter commented 9 years ago
Markus implemented this in r160.

Original comment by mseaborn@chromium.org on 27 Jul 2011 at 3:18