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/fs/proc/prsubr.c
          +++ new/usr/src/uts/common/fs/proc/prsubr.c
↓ open down ↓ 885 lines elided ↑ open up ↑
 886  886                   */
 887  887                  sp->pr_ppid = curproc->p_zone->zone_zsched->p_pid;
 888  888          } else {
 889  889                  sp->pr_ppid = p->p_ppid;
 890  890          }
 891  891          sp->pr_pgid  = p->p_pgrp;
 892  892          sp->pr_sid   = p->p_sessp->s_sid;
 893  893          sp->pr_taskid = p->p_task->tk_tkid;
 894  894          sp->pr_projid = p->p_task->tk_proj->kpj_id;
 895  895          sp->pr_zoneid = p->p_zone->zone_id;
      896 +        bcopy(&p->p_secflags, &sp->pr_secflags, sizeof (psecflags_t));
 896  897          hrt2ts(mstate_aggr_state(p, LMS_USER), &sp->pr_utime);
 897  898          hrt2ts(mstate_aggr_state(p, LMS_SYSTEM), &sp->pr_stime);
 898  899          TICK_TO_TIMESTRUC(p->p_cutime, &sp->pr_cutime);
 899  900          TICK_TO_TIMESTRUC(p->p_cstime, &sp->pr_cstime);
 900  901          prassignset(&sp->pr_sigtrace, &p->p_sigmask);
 901  902          prassignset(&sp->pr_flttrace, &p->p_fltmask);
 902  903          prassignset(&sp->pr_sysentry, &PTOU(p)->u_entrymask);
 903  904          prassignset(&sp->pr_sysexit, &PTOU(p)->u_exitmask);
 904  905          switch (p->p_model) {
 905  906          case DATAMODEL_ILP32:
↓ open down ↓ 203 lines elided ↑ open up ↑
1109 1110                   */
1110 1111                  sp->pr_ppid = curproc->p_zone->zone_zsched->p_pid;
1111 1112          } else {
1112 1113                  sp->pr_ppid = p->p_ppid;
1113 1114          }
1114 1115          sp->pr_pgid  = p->p_pgrp;
1115 1116          sp->pr_sid   = p->p_sessp->s_sid;
1116 1117          sp->pr_taskid = p->p_task->tk_tkid;
1117 1118          sp->pr_projid = p->p_task->tk_proj->kpj_id;
1118 1119          sp->pr_zoneid = p->p_zone->zone_id;
     1120 +        bcopy(&p->p_secflags, &sp->pr_secflags, sizeof (psecflags_t));
1119 1121          hrt2ts32(mstate_aggr_state(p, LMS_USER), &sp->pr_utime);
1120 1122          hrt2ts32(mstate_aggr_state(p, LMS_SYSTEM), &sp->pr_stime);
1121 1123          TICK_TO_TIMESTRUC32(p->p_cutime, &sp->pr_cutime);
1122 1124          TICK_TO_TIMESTRUC32(p->p_cstime, &sp->pr_cstime);
1123 1125          prassignset(&sp->pr_sigtrace, &p->p_sigmask);
1124 1126          prassignset(&sp->pr_flttrace, &p->p_fltmask);
1125 1127          prassignset(&sp->pr_sysentry, &PTOU(p)->u_entrymask);
1126 1128          prassignset(&sp->pr_sysexit, &PTOU(p)->u_exitmask);
1127 1129          switch (p->p_model) {
1128 1130          case DATAMODEL_ILP32:
↓ open down ↓ 3202 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX