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/os/cred.c
          +++ new/usr/src/uts/common/os/cred.c
↓ open down ↓ 207 lines elided ↑ open up ↑
 208  208  
 209  209          bzero(kcred, crsize);
 210  210          kcred->cr_ref = 1;
 211  211  
 212  212          /* kcred is never freed, so we don't need zone_cred_hold here */
 213  213          kcred->cr_zone = &zone0;
 214  214  
 215  215          priv_fillset(&CR_LPRIV(kcred));
 216  216          CR_IPRIV(kcred) = *priv_basic;
 217  217  
      218 +        priv_addset(&CR_IPRIV(kcred), PRIV_PROC_SECFLAGS);
      219 +
 218  220          /* Not a basic privilege, if chown is not restricted add it to I0 */
 219  221          if (!rstchown)
 220  222                  priv_addset(&CR_IPRIV(kcred), PRIV_FILE_CHOWN_SELF);
 221  223  
 222  224          /* Basic privilege, if link is restricted remove it from I0 */
 223  225          if (rstlink)
 224  226                  priv_delset(&CR_IPRIV(kcred), PRIV_FILE_LINK_ANY);
 225  227  
 226  228          CR_EPRIV(kcred) = CR_PPRIV(kcred) = CR_IPRIV(kcred);
 227  229  
↓ open down ↓ 1020 lines elided ↑ open up ↑
1248 1250  }
1249 1251  
1250 1252  /*
1251 1253   * IMPORTANT.The two functions get_ephemeral_data() and set_ephemeral_data()
1252 1254   * are project private functions that are for use of the test system only and
1253 1255   * are not to be used for other purposes.
1254 1256   */
1255 1257  
1256 1258  void
1257 1259  get_ephemeral_data(zone_t *zone, uid_t *min_uid, uid_t *last_uid,
1258      -        gid_t *min_gid, gid_t *last_gid)
     1260 +    gid_t *min_gid, gid_t *last_gid)
1259 1261  {
1260 1262          ephemeral_zsd_t *eph_zsd = get_ephemeral_zsd(zone);
1261 1263  
1262 1264          ASSERT(eph_zsd != NULL);
1263 1265  
1264 1266          mutex_enter(&eph_zsd->eph_lock);
1265 1267  
1266 1268          *min_uid = eph_zsd->min_uid;
1267 1269          *last_uid = eph_zsd->last_uid;
1268 1270          *min_gid = eph_zsd->min_gid;
1269 1271          *last_gid = eph_zsd->last_gid;
1270 1272  
1271 1273          mutex_exit(&eph_zsd->eph_lock);
1272 1274  }
1273 1275  
1274 1276  
1275 1277  void
1276 1278  set_ephemeral_data(zone_t *zone, uid_t min_uid, uid_t last_uid,
1277      -        gid_t min_gid, gid_t last_gid)
     1279 +    gid_t min_gid, gid_t last_gid)
1278 1280  {
1279 1281          ephemeral_zsd_t *eph_zsd = get_ephemeral_zsd(zone);
1280 1282  
1281 1283          ASSERT(eph_zsd != NULL);
1282 1284  
1283 1285          mutex_enter(&eph_zsd->eph_lock);
1284 1286  
1285 1287          if (min_uid != 0)
1286 1288                  eph_zsd->min_uid = min_uid;
1287 1289          if (last_uid != 0)
↓ open down ↓ 191 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX