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.

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/svccfg/svccfg_libscf.c
          +++ new/usr/src/cmd/svc/svccfg/svccfg_libscf.c
↓ open down ↓ 9508 lines elided ↑ open up ↑
9509 9509           * missing if none of them are there.  Thus we can't use the
9510 9510           * convenience functions.
9511 9511           */
9512 9512          nonenv =
9513 9513              scf_pg_get_property(pg, SCF_PROPERTY_WORKING_DIRECTORY, NULL) ==
9514 9514              SCF_SUCCESS ||
9515 9515              scf_pg_get_property(pg, SCF_PROPERTY_PROJECT, NULL) ==
9516 9516              SCF_SUCCESS ||
9517 9517              scf_pg_get_property(pg, SCF_PROPERTY_RESOURCE_POOL, NULL) ==
9518 9518              SCF_SUCCESS ||
     9519 +            scf_pg_get_property(pg, SCF_PROPERTY_SECFLAGS, NULL) ==
     9520 +            SCF_SUCCESS ||
9519 9521              scf_pg_get_property(pg, SCF_PROPERTY_USE_PROFILE, NULL) ==
9520 9522              SCF_SUCCESS;
9521 9523  
9522 9524          if (nonenv) {
9523 9525                  ctxt = xmlNewNode(NULL, (xmlChar *)"method_context");
9524 9526                  if (ctxt == NULL)
9525 9527                          uu_die(emsg_create_xml);
9526 9528  
9527 9529                  if (pg_get_prop(pg, SCF_PROPERTY_WORKING_DIRECTORY, exp_prop) ==
9528 9530                      0 &&
↓ open down ↓ 4 lines elided ↑ open up ↑
9533 9535                  if (pg_get_prop(pg, SCF_PROPERTY_PROJECT, exp_prop) == 0 &&
9534 9536                      set_attr_from_prop_default(exp_prop, ctxt, "project",
9535 9537                      ":default") != 0)
9536 9538                          err = 1;
9537 9539  
9538 9540                  if (pg_get_prop(pg, SCF_PROPERTY_RESOURCE_POOL, exp_prop) ==
9539 9541                      0 &&
9540 9542                      set_attr_from_prop_default(exp_prop, ctxt,
9541 9543                      "resource_pool", ":default") != 0)
9542 9544                          err = 1;
     9545 +
     9546 +                if (pg_get_prop(pg, SCF_PROPERTY_SECFLAGS, exp_prop) == 0 &&
     9547 +                    set_attr_from_prop_default(exp_prop, ctxt,
     9548 +                    "security_flags", ":default") != 0)
     9549 +                        err = 1;
     9550 +
9543 9551                  /*
9544 9552                   * We only want to complain about profile or credential
9545 9553                   * properties if we will use them.  To determine that we must
9546 9554                   * examine USE_PROFILE.
9547 9555                   */
9548 9556                  if (pg_get_prop(pg, SCF_PROPERTY_USE_PROFILE, exp_prop) == 0 &&
9549 9557                      prop_check_type(exp_prop, SCF_TYPE_BOOLEAN) == 0 &&
9550 9558                      prop_get_val(exp_prop, exp_val) == 0) {
9551 9559                          if (scf_value_get_boolean(exp_val, &use_profile) !=
9552 9560                              SCF_SUCCESS) {
↓ open down ↓ 102 lines elided ↑ open up ↑
9655 9663                      0 ||
9656 9664                      strcmp(exp_str, SCF_PROPERTY_PROJECT) == 0 ||
9657 9665                      strcmp(exp_str, SCF_PROPERTY_RESOURCE_POOL) == 0 ||
9658 9666                      strcmp(exp_str, SCF_PROPERTY_USE_PROFILE) == 0) {
9659 9667                          if (nonenv)
9660 9668                                  continue;
9661 9669                  } else if (strcmp(exp_str, SCF_PROPERTY_USER) == 0 ||
9662 9670                      strcmp(exp_str, SCF_PROPERTY_GROUP) == 0 ||
9663 9671                      strcmp(exp_str, SCF_PROPERTY_SUPP_GROUPS) == 0 ||
9664 9672                      strcmp(exp_str, SCF_PROPERTY_PRIVILEGES) == 0 ||
9665      -                    strcmp(exp_str, SCF_PROPERTY_LIMIT_PRIVILEGES) == 0) {
     9673 +                    strcmp(exp_str, SCF_PROPERTY_LIMIT_PRIVILEGES) == 0 ||
     9674 +                    strcmp(exp_str, SCF_PROPERTY_SECFLAGS) == 0) {
9666 9675                          if (nonenv && !use_profile)
9667 9676                                  continue;
9668 9677                  } else if (strcmp(exp_str, SCF_PROPERTY_PROFILE) == 0) {
9669 9678                          if (nonenv && use_profile)
9670 9679                                  continue;
9671 9680                  } else if (strcmp(exp_str, SCF_PROPERTY_ENVIRONMENT) == 0) {
9672 9681                          if (env != NULL)
9673 9682                                  continue;
9674 9683                  }
9675 9684  
↓ open down ↓ 165 lines elided ↑ open up ↑
9841 9850                          if (set_attr_from_prop(exp_prop, n,
9842 9851                              "working_directory") != 0)
9843 9852                                  err = 1;
9844 9853                  } else if (strcmp(exp_str, SCF_PROPERTY_PROJECT) == 0) {
9845 9854                          if (set_attr_from_prop(exp_prop, n, "project") != 0)
9846 9855                                  err = 1;
9847 9856                  } else if (strcmp(exp_str, SCF_PROPERTY_RESOURCE_POOL) == 0) {
9848 9857                          if (set_attr_from_prop(exp_prop, n,
9849 9858                              "resource_pool") != 0)
9850 9859                                  err = 1;
     9860 +                } else if (strcmp(exp_str, SCF_PROPERTY_SECFLAGS) == 0) {
     9861 +                        if (set_attr_from_prop(exp_prop, n,
     9862 +                            "security_flags") != 0)
     9863 +                                err = 1;
9851 9864                  } else if (strcmp(exp_str, SCF_PROPERTY_USE_PROFILE) == 0) {
9852 9865                          /* EMPTY */
9853 9866                  } else if (strcmp(exp_str, SCF_PROPERTY_USER) == 0) {
9854 9867                          if (use_profile ||
9855 9868                              set_attr_from_prop(exp_prop, cred, "user") != 0)
9856 9869                                  err = 1;
9857 9870                  } else if (strcmp(exp_str, SCF_PROPERTY_GROUP) == 0) {
9858 9871                          if (use_profile ||
9859 9872                              set_attr_from_prop(exp_prop, cred, "group") != 0)
9860 9873                                  err = 1;
↓ open down ↓ 7755 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX