Print this page
Code review comments from jeffpc
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/cmd/sgs/elfdump/common/struct_layout_i386.c
          +++ new/usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c
↓ open down ↓ 369 lines elided ↑ open up ↑
 370  370          { 28,   4,      0,      0 },            /* pr_rminor */
 371  371          { 32,   8,      0,      0 },            /* pr_ino */
 372  372          { 40,   8,      0,      0 },            /* pr_offset */
 373  373          { 48,   8,      0,      0 },            /* pr_size */
 374  374          { 56,   4,      0,      0 },            /* pr_fileflags */
 375  375          { 60,   4,      0,      0 },            /* pr_fdflags */
 376  376          { 64,   1,      1024,   0 },            /* pr_path[] */
 377  377  };
 378  378  
 379  379  
      380 +static const sl_prsecflags_layout_t prsecflags_layout = {
      381 +        { 0,    40,     0,      0 },            /* sizeof (prsecflags_t) */
      382 +        { 0,    4,      0,      0 },            /* pr_version */
      383 +        { 8,    8,      0,      0 },            /* pr_effective */
      384 +        { 16,   8,      0,      0 },            /* pr_inherit */
      385 +        { 24,   8,      0,      0 },            /* pr_lower */
      386 +        { 32,   8,      0,      0 },            /* pr_upper */
      387 +};
      388 +
      389 +
 380  390  
 381  391  
 382  392  static const sl_arch_layout_t layout_i386 = {
 383  393          &auxv_layout,
 384  394          &fltset_layout,
 385  395          &lwpsinfo_layout,
 386  396          &lwpstatus_layout,
 387  397          &prcred_layout,
 388  398          &priv_impl_info_layout,
 389  399          &prpriv_layout,
↓ open down ↓ 3 lines elided ↑ open up ↑
 393  403          &prpsinfo_layout,
 394  404          &prstatus_layout,
 395  405          &sigaction_layout,
 396  406          &siginfo_layout,
 397  407          &sigset_layout,
 398  408          &stack_layout,
 399  409          &sysset_layout,
 400  410          &timestruc_layout,
 401  411          &utsname_layout,
 402  412          &prfdinfo_layout,
      413 +        &prsecflags_layout,
 403  414  };
 404  415  
 405  416  
 406  417  const sl_arch_layout_t *
 407  418  struct_layout_i386(void)
 408  419  {
 409  420          return (&layout_i386);
 410  421  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX