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/uts/common/fs/proc/prsubr.c
          +++ new/usr/src/uts/common/fs/proc/prsubr.c
↓ open down ↓ 3344 lines elided ↑ open up ↑
3345 3345          AS_LOCK_EXIT(as);
3346 3346  }
3347 3347  
3348 3348  /*
3349 3349   * Insert a watched area into the list of watched pages.
3350 3350   * If oflags is zero then we are adding a new watched area.
3351 3351   * Otherwise we are changing the flags of an existing watched area.
3352 3352   */
3353 3353  static int
3354 3354  set_watched_page(proc_t *p, caddr_t vaddr, caddr_t eaddr,
3355      -        ulong_t flags, ulong_t oflags)
     3355 +    ulong_t flags, ulong_t oflags)
3356 3356  {
3357 3357          struct as *as = p->p_as;
3358 3358          avl_tree_t *pwp_tree;
3359 3359          struct watched_page *pwp, *newpwp;
3360 3360          struct watched_page tpw;
3361 3361          avl_index_t where;
3362 3362          struct seg *seg;
3363 3363          uint_t prot;
3364 3364          caddr_t addr;
3365 3365  
↓ open down ↓ 464 lines elided ↑ open up ↑
3830 3830  
3831 3831          /*
3832 3832           * If this segment doesn't match one of the special types we handle,
3833 3833           * just return the size of the segment itself.
3834 3834           */
3835 3835          return (size);
3836 3836  }
3837 3837  
3838 3838  uint_t
3839 3839  pr_getprot(struct seg *seg, int reserved, void **tmp,
3840      -        caddr_t *saddrp, caddr_t *naddrp, caddr_t eaddr)
     3840 +    caddr_t *saddrp, caddr_t *naddrp, caddr_t eaddr)
3841 3841  {
3842 3842          struct as *as = seg->s_as;
3843 3843  
3844 3844          caddr_t saddr = *saddrp;
3845 3845          caddr_t naddr;
3846 3846  
3847 3847          int check_noreserve;
3848 3848          uint_t prot;
3849 3849  
3850 3850          union {
↓ open down ↓ 297 lines elided ↑ open up ↑
4148 4148   * this function because prcred_t and prcred32_t are actually the same.
4149 4149   */
4150 4150  void
4151 4151  prgetcred(proc_t *p, prcred_t *pcrp)
4152 4152  {
4153 4153          mutex_enter(&p->p_crlock);
4154 4154          cred2prcred(p->p_cred, pcrp);
4155 4155          mutex_exit(&p->p_crlock);
4156 4156  }
4157 4157  
     4158 +void
     4159 +prgetsecflags(proc_t *p, prsecflags_t *psfp)
     4160 +{
     4161 +        ASSERT(psfp != NULL);
     4162 +
     4163 +        psfp->pr_version = PRSECFLAGS_VERSION_CURRENT;
     4164 +        psfp->pr_lower = p->p_secflags.psf_lower;
     4165 +        psfp->pr_upper = p->p_secflags.psf_upper;
     4166 +        psfp->pr_effective = p->p_secflags.psf_effective;
     4167 +        psfp->pr_inherit = p->p_secflags.psf_inherit;
     4168 +}
     4169 +
4158 4170  /*
4159 4171   * Compute actual size of the prpriv_t structure.
4160 4172   */
4161 4173  
4162 4174  size_t
4163 4175  prgetprivsize(void)
4164 4176  {
4165 4177          return (priv_prgetprivsize(NULL));
4166 4178  }
4167 4179  
↓ open down ↓ 163 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX