Print this page
7029 want per-process exploit mitigation features (secflags)
7030 want basic address space layout randomization (aslr)
7031 noexec_user_stack should be a secflag
7032 want a means to forbid mappings around NULL.


 235 };
 236 
 237 struct zone_pkgtab {
 238         char    zone_pkg_name[MAXNAMELEN];
 239         char    zone_pkg_version[ZONE_PKG_VERSMAX];
 240 };
 241 
 242 struct zone_devpermtab {
 243         char    zone_devperm_name[MAXPATHLEN];
 244         uid_t   zone_devperm_uid;
 245         gid_t   zone_devperm_gid;
 246         mode_t  zone_devperm_mode;
 247         char    *zone_devperm_acl;
 248 };
 249 
 250 struct zone_admintab {
 251         char    zone_admin_user[MAXUSERNAME];
 252         char    zone_admin_auths[MAXAUTHS];
 253 };
 254 







 255 typedef struct zone_userauths {
 256         char                    user[MAXUSERNAME];
 257         char                    zonename[ZONENAME_MAX];
 258         struct zone_userauths   *next;
 259 } zone_userauths_t;
 260 
 261 typedef struct {
 262         uu_avl_node_t   zpe_entry;
 263         char            *zpe_name;
 264         char            *zpe_vers;
 265 } zone_pkg_entry_t;
 266 
 267 typedef enum zone_iptype {
 268         ZS_SHARED,
 269         ZS_EXCLUSIVE
 270 } zone_iptype_t;
 271 
 272 /*
 273  * Basic configuration management routines.
 274  */


 411 extern  int     zonecfg_delete_ds(zone_dochandle_t, struct zone_dstab *);
 412 extern  int     zonecfg_modify_ds(zone_dochandle_t, struct zone_dstab *,
 413     struct zone_dstab *);
 414 extern  int     zonecfg_lookup_ds(zone_dochandle_t, struct zone_dstab *);
 415 
 416 /*
 417  * cpu-set configuration.
 418  */
 419 extern  int     zonecfg_add_pset(zone_dochandle_t, struct zone_psettab *);
 420 extern  int     zonecfg_delete_pset(zone_dochandle_t);
 421 extern  int     zonecfg_modify_pset(zone_dochandle_t, struct zone_psettab *);
 422 extern  int     zonecfg_lookup_pset(zone_dochandle_t, struct zone_psettab *);
 423 
 424 /*
 425  * mem-cap configuration.
 426  */
 427 extern  int     zonecfg_delete_mcap(zone_dochandle_t);
 428 extern  int     zonecfg_modify_mcap(zone_dochandle_t, struct zone_mcaptab *);
 429 extern  int     zonecfg_lookup_mcap(zone_dochandle_t, struct zone_mcaptab *);
 430 










 431 /*
 432  * Temporary pool support functions.
 433  */
 434 extern  int     zonecfg_destroy_tmp_pool(char *, char *, int);
 435 extern  int     zonecfg_bind_tmp_pool(zone_dochandle_t, zoneid_t, char *, int);
 436 extern  int     zonecfg_bind_pool(zone_dochandle_t, zoneid_t, char *, int);
 437 extern  boolean_t zonecfg_warn_poold(zone_dochandle_t);
 438 extern  int     zonecfg_get_poolname(zone_dochandle_t, char *, char *, size_t);
 439 
 440 /*
 441  * Miscellaneous utility functions.
 442  */
 443 extern  int     zonecfg_enable_rcapd(char *, int);
 444 
 445 /*
 446  * attach/detach support.
 447  */
 448 extern  int     zonecfg_get_attach_handle(const char *, const char *,
 449     const char *, boolean_t, zone_dochandle_t);
 450 extern  int     zonecfg_attach_manifest(int, zone_dochandle_t,


 478 extern  int     zonecfg_setattrent(zone_dochandle_t);
 479 extern  int     zonecfg_getattrent(zone_dochandle_t, struct zone_attrtab *);
 480 extern  int     zonecfg_endattrent(zone_dochandle_t);
 481 extern  int     zonecfg_setrctlent(zone_dochandle_t);
 482 extern  int     zonecfg_getrctlent(zone_dochandle_t, struct zone_rctltab *);
 483 extern  int     zonecfg_endrctlent(zone_dochandle_t);
 484 extern  int     zonecfg_setdsent(zone_dochandle_t);
 485 extern  int     zonecfg_getdsent(zone_dochandle_t, struct zone_dstab *);
 486 extern  int     zonecfg_enddsent(zone_dochandle_t);
 487 extern  int     zonecfg_getpsetent(zone_dochandle_t, struct zone_psettab *);
 488 extern  int     zonecfg_getmcapent(zone_dochandle_t, struct zone_mcaptab *);
 489 extern  int     zonecfg_getpkgdata(zone_dochandle_t, uu_avl_pool_t *,
 490     uu_avl_t *);
 491 extern  int     zonecfg_setdevperment(zone_dochandle_t);
 492 extern  int     zonecfg_getdevperment(zone_dochandle_t,
 493     struct zone_devpermtab *);
 494 extern  int     zonecfg_enddevperment(zone_dochandle_t);
 495 extern  int     zonecfg_setadminent(zone_dochandle_t);
 496 extern  int     zonecfg_getadminent(zone_dochandle_t, struct zone_admintab *);
 497 extern  int     zonecfg_endadminent(zone_dochandle_t);


 498 
 499 /*
 500  * Privilege-related functions.
 501  */
 502 extern  int     zonecfg_default_privset(priv_set_t *, const char *);
 503 extern  int     zonecfg_get_privset(zone_dochandle_t, priv_set_t *,
 504     char **);
 505 extern  int     zonecfg_get_limitpriv(zone_dochandle_t, char **);
 506 extern  int     zonecfg_set_limitpriv(zone_dochandle_t, char *);
 507 
 508 /*
 509  * Higher-level routines.
 510  */
 511 extern  int     zone_get_brand(char *, char *, size_t);
 512 extern  int     zone_get_rootpath(char *, char *, size_t);
 513 extern  int     zone_get_devroot(char *, char *, size_t);
 514 extern  int     zone_get_zonepath(char *, char *, size_t);
 515 extern  int     zone_get_state(char *, zone_state_t *);
 516 extern  int     zone_set_state(char *, zone_state_t);
 517 extern  char    *zone_state_str(zone_state_t);




 235 };
 236 
 237 struct zone_pkgtab {
 238         char    zone_pkg_name[MAXNAMELEN];
 239         char    zone_pkg_version[ZONE_PKG_VERSMAX];
 240 };
 241 
 242 struct zone_devpermtab {
 243         char    zone_devperm_name[MAXPATHLEN];
 244         uid_t   zone_devperm_uid;
 245         gid_t   zone_devperm_gid;
 246         mode_t  zone_devperm_mode;
 247         char    *zone_devperm_acl;
 248 };
 249 
 250 struct zone_admintab {
 251         char    zone_admin_user[MAXUSERNAME];
 252         char    zone_admin_auths[MAXAUTHS];
 253 };
 254 
 255 #define ZONECFG_SECFLAGS_MAX    1024
 256 struct zone_secflagstab {
 257         char zone_secflags_lower[ZONECFG_SECFLAGS_MAX];
 258         char zone_secflags_upper[ZONECFG_SECFLAGS_MAX];
 259         char zone_secflags_default[ZONECFG_SECFLAGS_MAX];
 260 };
 261 
 262 typedef struct zone_userauths {
 263         char                    user[MAXUSERNAME];
 264         char                    zonename[ZONENAME_MAX];
 265         struct zone_userauths   *next;
 266 } zone_userauths_t;
 267 
 268 typedef struct {
 269         uu_avl_node_t   zpe_entry;
 270         char            *zpe_name;
 271         char            *zpe_vers;
 272 } zone_pkg_entry_t;
 273 
 274 typedef enum zone_iptype {
 275         ZS_SHARED,
 276         ZS_EXCLUSIVE
 277 } zone_iptype_t;
 278 
 279 /*
 280  * Basic configuration management routines.
 281  */


 418 extern  int     zonecfg_delete_ds(zone_dochandle_t, struct zone_dstab *);
 419 extern  int     zonecfg_modify_ds(zone_dochandle_t, struct zone_dstab *,
 420     struct zone_dstab *);
 421 extern  int     zonecfg_lookup_ds(zone_dochandle_t, struct zone_dstab *);
 422 
 423 /*
 424  * cpu-set configuration.
 425  */
 426 extern  int     zonecfg_add_pset(zone_dochandle_t, struct zone_psettab *);
 427 extern  int     zonecfg_delete_pset(zone_dochandle_t);
 428 extern  int     zonecfg_modify_pset(zone_dochandle_t, struct zone_psettab *);
 429 extern  int     zonecfg_lookup_pset(zone_dochandle_t, struct zone_psettab *);
 430 
 431 /*
 432  * mem-cap configuration.
 433  */
 434 extern  int     zonecfg_delete_mcap(zone_dochandle_t);
 435 extern  int     zonecfg_modify_mcap(zone_dochandle_t, struct zone_mcaptab *);
 436 extern  int     zonecfg_lookup_mcap(zone_dochandle_t, struct zone_mcaptab *);
 437 
 438 /* security-flags configuration */
 439 extern  int     zonecfg_add_secflags(zone_dochandle_t,
 440     struct zone_secflagstab *);
 441 extern  int     zonecfg_delete_secflags(zone_dochandle_t,
 442     struct zone_secflagstab *);
 443 extern  int     zonecfg_modify_secflags(zone_dochandle_t,
 444     struct zone_secflagstab *, struct zone_secflagstab *);
 445 extern  int     zonecfg_lookup_secflags(zone_dochandle_t,
 446     struct zone_secflagstab *);
 447 
 448 /*
 449  * Temporary pool support functions.
 450  */
 451 extern  int     zonecfg_destroy_tmp_pool(char *, char *, int);
 452 extern  int     zonecfg_bind_tmp_pool(zone_dochandle_t, zoneid_t, char *, int);
 453 extern  int     zonecfg_bind_pool(zone_dochandle_t, zoneid_t, char *, int);
 454 extern  boolean_t zonecfg_warn_poold(zone_dochandle_t);
 455 extern  int     zonecfg_get_poolname(zone_dochandle_t, char *, char *, size_t);
 456 
 457 /*
 458  * Miscellaneous utility functions.
 459  */
 460 extern  int     zonecfg_enable_rcapd(char *, int);
 461 
 462 /*
 463  * attach/detach support.
 464  */
 465 extern  int     zonecfg_get_attach_handle(const char *, const char *,
 466     const char *, boolean_t, zone_dochandle_t);
 467 extern  int     zonecfg_attach_manifest(int, zone_dochandle_t,


 495 extern  int     zonecfg_setattrent(zone_dochandle_t);
 496 extern  int     zonecfg_getattrent(zone_dochandle_t, struct zone_attrtab *);
 497 extern  int     zonecfg_endattrent(zone_dochandle_t);
 498 extern  int     zonecfg_setrctlent(zone_dochandle_t);
 499 extern  int     zonecfg_getrctlent(zone_dochandle_t, struct zone_rctltab *);
 500 extern  int     zonecfg_endrctlent(zone_dochandle_t);
 501 extern  int     zonecfg_setdsent(zone_dochandle_t);
 502 extern  int     zonecfg_getdsent(zone_dochandle_t, struct zone_dstab *);
 503 extern  int     zonecfg_enddsent(zone_dochandle_t);
 504 extern  int     zonecfg_getpsetent(zone_dochandle_t, struct zone_psettab *);
 505 extern  int     zonecfg_getmcapent(zone_dochandle_t, struct zone_mcaptab *);
 506 extern  int     zonecfg_getpkgdata(zone_dochandle_t, uu_avl_pool_t *,
 507     uu_avl_t *);
 508 extern  int     zonecfg_setdevperment(zone_dochandle_t);
 509 extern  int     zonecfg_getdevperment(zone_dochandle_t,
 510     struct zone_devpermtab *);
 511 extern  int     zonecfg_enddevperment(zone_dochandle_t);
 512 extern  int     zonecfg_setadminent(zone_dochandle_t);
 513 extern  int     zonecfg_getadminent(zone_dochandle_t, struct zone_admintab *);
 514 extern  int     zonecfg_endadminent(zone_dochandle_t);
 515 extern  int     zonecfg_getsecflagsent(zone_dochandle_t,
 516     struct zone_secflagstab *);
 517 
 518 /*
 519  * Privilege-related functions.
 520  */
 521 extern  int     zonecfg_default_privset(priv_set_t *, const char *);
 522 extern  int     zonecfg_get_privset(zone_dochandle_t, priv_set_t *,
 523     char **);
 524 extern  int     zonecfg_get_limitpriv(zone_dochandle_t, char **);
 525 extern  int     zonecfg_set_limitpriv(zone_dochandle_t, char *);
 526 
 527 /*
 528  * Higher-level routines.
 529  */
 530 extern  int     zone_get_brand(char *, char *, size_t);
 531 extern  int     zone_get_rootpath(char *, char *, size_t);
 532 extern  int     zone_get_devroot(char *, char *, size_t);
 533 extern  int     zone_get_zonepath(char *, char *, size_t);
 534 extern  int     zone_get_state(char *, zone_state_t *);
 535 extern  int     zone_set_state(char *, zone_state_t);
 536 extern  char    *zone_state_str(zone_state_t);