Follow-up Comment #14, bug #17644 (project hurd): There's one thing I'm not sure how to tackle when fork()+exec()'ing: when fork()'ing, descriptors are correctly set, etc. but when exec()'ing a new program, the descriptors should probably be cleared, because else the new program will inherit them. This should probably be done in hurd/exec/exec.c:do_exec(), at the time when vm areas are cleared. However, while clearing LDT is easy (just set it all to 0), clearing GDT is not: userspace doesn't have access to the USER_GDT and USER_GDT_SLOTS macros. Making 8191 trap calls for clearing them one by one would be quite long. A heuristic would be to try clearing from 0 and then until it starts succeeding, and then continue until it fails again, at which point we can consider every user entries where cleared, but that's far from pretty.
Should we export these two macros, export a new trap call for clearing all at once, something else? _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?17644> _______________________________________________ Message posté via/par Savannah http://savannah.gnu.org/ _______________________________________________ Bug-hurd mailing list Bug-hurd@gnu.org http://lists.gnu.org/mailman/listinfo/bug-hurd