Print this page
uts: Allow for address space randomisation.
Randomise the base addresses of shared objects, non-fixed mappings, the
stack and the heap.  Introduce a service, svc:/system/process-security,
and a tool psecflags(1) to control and observe it

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/policy.c
          +++ new/usr/src/uts/common/os/policy.c
↓ open down ↓ 1720 lines elided ↑ open up ↑
1721 1721  
1722 1722  /*
1723 1723   * Processor sets, cpu configuration, resource pools.
1724 1724   */
1725 1725  int
1726 1726  secpolicy_pset(const cred_t *cr)
1727 1727  {
1728 1728          return (PRIV_POLICY(cr, PRIV_SYS_RES_CONFIG, B_FALSE, EPERM, NULL));
1729 1729  }
1730 1730  
     1731 +/* Process security flags */
     1732 +int
     1733 +secpolicy_psecflags(const cred_t *cr, proc_t *tp, proc_t *sp)
     1734 +{
     1735 +        if (PRIV_POLICY(cr, PRIV_PROC_SECFLAGS, B_FALSE, EPERM, NULL) != 0)
     1736 +                return (EPERM);
     1737 +
     1738 +        if (!prochasprocperm(tp, sp, cr))
     1739 +                return (EPERM);
     1740 +
     1741 +        return (0);
     1742 +}
     1743 +
1731 1744  /*
1732 1745   * Processor set binding.
1733 1746   */
1734 1747  int
1735 1748  secpolicy_pbind(const cred_t *cr)
1736 1749  {
1737 1750          if (PRIV_POLICY_ONLY(cr, PRIV_SYS_RES_CONFIG, B_FALSE))
1738 1751                  return (secpolicy_pset(cr));
1739 1752          return (PRIV_POLICY(cr, PRIV_SYS_RES_BIND, B_FALSE, EPERM, NULL));
1740 1753  }
↓ open down ↓ 837 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX