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


  87         { 24,   4,      0,      1 },            /* pr_aslwpid */
  88         { 28,   4,      0,      1 },            /* pr_agentid */
  89         { 32,   16,     0,      0 },            /* pr_sigpend */
  90         { 48,   8,      0,      0 },            /* pr_brkbase */
  91         { 56,   8,      0,      0 },            /* pr_brksize */
  92         { 64,   8,      0,      0 },            /* pr_stkbase */
  93         { 72,   8,      0,      0 },            /* pr_stksize */
  94         { 80,   16,     0,      0 },            /* pr_utime */
  95         { 96,   16,     0,      0 },            /* pr_stime */
  96         { 112,  16,     0,      0 },            /* pr_cutime */
  97         { 128,  16,     0,      0 },            /* pr_cstime */
  98         { 144,  16,     0,      0 },            /* pr_sigtrace */
  99         { 160,  16,     0,      0 },            /* pr_flttrace */
 100         { 176,  64,     0,      0 },            /* pr_sysentry */
 101         { 240,  64,     0,      0 },            /* pr_sysexit */
 102         { 304,  1,      0,      0 },            /* pr_dmodel */
 103         { 308,  4,      0,      1 },            /* pr_taskid */
 104         { 312,  4,      0,      1 },            /* pr_projid */
 105         { 316,  4,      0,      1 },            /* pr_nzomb */
 106         { 320,  4,      0,      1 },            /* pr_zoneid */

 107         { 384,  1296,   0,      0 },            /* pr_lwp */
 108 };
 109 
 110 
 111 static const sl_prstatus_layout_t prstatus_layout = {
 112         { 0,    824,    0,      0 },            /* sizeof (prstatus_t) */
 113         { 0,    4,      0,      1 },            /* pr_flags */
 114         { 4,    2,      0,      1 },            /* pr_why */
 115         { 6,    2,      0,      1 },            /* pr_what */
 116         { 8,    256,    0,      0 },            /* pr_info */
 117         { 264,  2,      0,      1 },            /* pr_cursig */
 118         { 266,  2,      0,      0 },            /* pr_nlwp */
 119         { 268,  16,     0,      0 },            /* pr_sigpend */
 120         { 284,  16,     0,      0 },            /* pr_sighold */
 121         { 304,  24,     0,      0 },            /* pr_altstack */
 122         { 328,  32,     0,      0 },            /* pr_action */
 123         { 360,  4,      0,      0 },            /* pr_pid */
 124         { 364,  4,      0,      0 },            /* pr_ppid */
 125         { 368,  4,      0,      0 },            /* pr_pgrp */
 126         { 372,  4,      0,      0 },            /* pr_sid */


 360 
 361 static const sl_prfdinfo_layout_t prfdinfo_layout = {
 362         { 0,    1088,   0,      0 },            /* sizeof (prfdinfo_t) */
 363         { 0,    4,      0,      0 },            /* pr_fd */
 364         { 4,    4,      0,      0 },            /* pr_mode */
 365         { 8,    4,      0,      0 },            /* pr_uid */
 366         { 12,   4,      0,      0 },            /* pr_gid */
 367         { 16,   4,      0,      0 },            /* pr_major */
 368         { 20,   4,      0,      0 },            /* pr_minor */
 369         { 24,   4,      0,      0 },            /* pr_rmajor */
 370         { 28,   4,      0,      0 },            /* pr_rminor */
 371         { 32,   8,      0,      0 },            /* pr_ino */
 372         { 40,   8,      0,      0 },            /* pr_offset */
 373         { 48,   8,      0,      0 },            /* pr_size */
 374         { 56,   4,      0,      0 },            /* pr_fileflags */
 375         { 60,   4,      0,      0 },            /* pr_fdflags */
 376         { 64,   1,      1024,   0 },            /* pr_path[] */
 377 };
 378 
 379 







 380 
 381 
 382 static const sl_arch_layout_t layout_amd64 = {
 383         &auxv_layout,
 384         &fltset_layout,
 385         &lwpsinfo_layout,
 386         &lwpstatus_layout,
 387         &prcred_layout,
 388         &priv_impl_info_layout,
 389         &prpriv_layout,
 390         &psinfo_layout,
 391         &pstatus_layout,
 392         &prgregset_layout,
 393         &prpsinfo_layout,
 394         &prstatus_layout,
 395         &sigaction_layout,
 396         &siginfo_layout,
 397         &sigset_layout,
 398         &stack_layout,
 399         &sysset_layout,
 400         &timestruc_layout,
 401         &utsname_layout,
 402         &prfdinfo_layout,

 403 };
 404 
 405 
 406 const sl_arch_layout_t *
 407 struct_layout_amd64(void)
 408 {
 409         return (&layout_amd64);
 410 }


  87         { 24,   4,      0,      1 },            /* pr_aslwpid */
  88         { 28,   4,      0,      1 },            /* pr_agentid */
  89         { 32,   16,     0,      0 },            /* pr_sigpend */
  90         { 48,   8,      0,      0 },            /* pr_brkbase */
  91         { 56,   8,      0,      0 },            /* pr_brksize */
  92         { 64,   8,      0,      0 },            /* pr_stkbase */
  93         { 72,   8,      0,      0 },            /* pr_stksize */
  94         { 80,   16,     0,      0 },            /* pr_utime */
  95         { 96,   16,     0,      0 },            /* pr_stime */
  96         { 112,  16,     0,      0 },            /* pr_cutime */
  97         { 128,  16,     0,      0 },            /* pr_cstime */
  98         { 144,  16,     0,      0 },            /* pr_sigtrace */
  99         { 160,  16,     0,      0 },            /* pr_flttrace */
 100         { 176,  64,     0,      0 },            /* pr_sysentry */
 101         { 240,  64,     0,      0 },            /* pr_sysexit */
 102         { 304,  1,      0,      0 },            /* pr_dmodel */
 103         { 308,  4,      0,      1 },            /* pr_taskid */
 104         { 312,  4,      0,      1 },            /* pr_projid */
 105         { 316,  4,      0,      1 },            /* pr_nzomb */
 106         { 320,  4,      0,      1 },            /* pr_zoneid */
 107         { 324,  8,      0,      0 },            /* pr_secflags */
 108         { 384,  1296,   0,      0 },            /* pr_lwp */
 109 };
 110 
 111 
 112 static const sl_prstatus_layout_t prstatus_layout = {
 113         { 0,    824,    0,      0 },            /* sizeof (prstatus_t) */
 114         { 0,    4,      0,      1 },            /* pr_flags */
 115         { 4,    2,      0,      1 },            /* pr_why */
 116         { 6,    2,      0,      1 },            /* pr_what */
 117         { 8,    256,    0,      0 },            /* pr_info */
 118         { 264,  2,      0,      1 },            /* pr_cursig */
 119         { 266,  2,      0,      0 },            /* pr_nlwp */
 120         { 268,  16,     0,      0 },            /* pr_sigpend */
 121         { 284,  16,     0,      0 },            /* pr_sighold */
 122         { 304,  24,     0,      0 },            /* pr_altstack */
 123         { 328,  32,     0,      0 },            /* pr_action */
 124         { 360,  4,      0,      0 },            /* pr_pid */
 125         { 364,  4,      0,      0 },            /* pr_ppid */
 126         { 368,  4,      0,      0 },            /* pr_pgrp */
 127         { 372,  4,      0,      0 },            /* pr_sid */


 361 
 362 static const sl_prfdinfo_layout_t prfdinfo_layout = {
 363         { 0,    1088,   0,      0 },            /* sizeof (prfdinfo_t) */
 364         { 0,    4,      0,      0 },            /* pr_fd */
 365         { 4,    4,      0,      0 },            /* pr_mode */
 366         { 8,    4,      0,      0 },            /* pr_uid */
 367         { 12,   4,      0,      0 },            /* pr_gid */
 368         { 16,   4,      0,      0 },            /* pr_major */
 369         { 20,   4,      0,      0 },            /* pr_minor */
 370         { 24,   4,      0,      0 },            /* pr_rmajor */
 371         { 28,   4,      0,      0 },            /* pr_rminor */
 372         { 32,   8,      0,      0 },            /* pr_ino */
 373         { 40,   8,      0,      0 },            /* pr_offset */
 374         { 48,   8,      0,      0 },            /* pr_size */
 375         { 56,   4,      0,      0 },            /* pr_fileflags */
 376         { 60,   4,      0,      0 },            /* pr_fdflags */
 377         { 64,   1,      1024,   0 },            /* pr_path[] */
 378 };
 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 
 388 
 389 
 390 static const sl_arch_layout_t layout_amd64 = {
 391         &auxv_layout,
 392         &fltset_layout,
 393         &lwpsinfo_layout,
 394         &lwpstatus_layout,
 395         &prcred_layout,
 396         &priv_impl_info_layout,
 397         &prpriv_layout,
 398         &psinfo_layout,
 399         &pstatus_layout,
 400         &prgregset_layout,
 401         &prpsinfo_layout,
 402         &prstatus_layout,
 403         &sigaction_layout,
 404         &siginfo_layout,
 405         &sigset_layout,
 406         &stack_layout,
 407         &sysset_layout,
 408         &timestruc_layout,
 409         &utsname_layout,
 410         &prfdinfo_layout,
 411         &psecflags_layout,
 412 };
 413 
 414 
 415 const sl_arch_layout_t *
 416 struct_layout_amd64(void)
 417 {
 418         return (&layout_amd64);
 419 }