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/cmd/sgs/elfdump/common/struct_layout_i386.c
          +++ new/usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c
↓ open down ↓ 96 lines elided ↑ open up ↑
  97   97          { 88,   8,      0,      0 },            /* pr_cstime */
  98   98          { 96,   16,     0,      0 },            /* pr_sigtrace */
  99   99          { 112,  16,     0,      0 },            /* pr_flttrace */
 100  100          { 128,  64,     0,      0 },            /* pr_sysentry */
 101  101          { 192,  64,     0,      0 },            /* pr_sysexit */
 102  102          { 256,  1,      0,      0 },            /* pr_dmodel */
 103  103          { 260,  4,      0,      1 },            /* pr_taskid */
 104  104          { 264,  4,      0,      1 },            /* pr_projid */
 105  105          { 268,  4,      0,      1 },            /* pr_nzomb */
 106  106          { 272,  4,      0,      1 },            /* pr_zoneid */
      107 +        { 276,  8,      0,      0 },            /* pr_secflags */
 107  108          { 336,  800,    0,      0 },            /* pr_lwp */
 108  109  };
 109  110  
 110  111  
 111  112  static const sl_prstatus_layout_t prstatus_layout = {
 112  113          { 0,    432,    0,      0 },            /* sizeof (prstatus_t) */
 113  114          { 0,    4,      0,      1 },            /* pr_flags */
 114  115          { 4,    2,      0,      1 },            /* pr_why */
 115  116          { 6,    2,      0,      1 },            /* pr_what */
 116  117          { 8,    128,    0,      0 },            /* pr_info */
↓ open down ↓ 253 lines elided ↑ open up ↑
 370  371          { 28,   4,      0,      0 },            /* pr_rminor */
 371  372          { 32,   8,      0,      0 },            /* pr_ino */
 372  373          { 40,   8,      0,      0 },            /* pr_offset */
 373  374          { 48,   8,      0,      0 },            /* pr_size */
 374  375          { 56,   4,      0,      0 },            /* pr_fileflags */
 375  376          { 60,   4,      0,      0 },            /* pr_fdflags */
 376  377          { 64,   1,      1024,   0 },            /* pr_path[] */
 377  378  };
 378  379  
 379  380  
      381 +static const sl_psecflags_layout_t psecflags_layout = {
      382 +        { 0,    8,      0,      0 },            /* sizeof (psecflags_t) */
      383 +        { 0,    4,      0,      0 },            /* psf_effective */
      384 +        { 4,    4,      0,      0 },            /* psf_inherit */
      385 +};
      386 +
      387 +
 380  388  
 381  389  
 382  390  static const sl_arch_layout_t layout_i386 = {
 383  391          &auxv_layout,
 384  392          &fltset_layout,
 385  393          &lwpsinfo_layout,
 386  394          &lwpstatus_layout,
 387  395          &prcred_layout,
 388  396          &priv_impl_info_layout,
 389  397          &prpriv_layout,
↓ open down ↓ 3 lines elided ↑ open up ↑
 393  401          &prpsinfo_layout,
 394  402          &prstatus_layout,
 395  403          &sigaction_layout,
 396  404          &siginfo_layout,
 397  405          &sigset_layout,
 398  406          &stack_layout,
 399  407          &sysset_layout,
 400  408          &timestruc_layout,
 401  409          &utsname_layout,
 402  410          &prfdinfo_layout,
      411 +        &psecflags_layout,
 403  412  };
 404  413  
 405  414  
 406  415  const sl_arch_layout_t *
 407  416  struct_layout_i386(void)
 408  417  {
 409  418          return (&layout_i386);
 410  419  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX