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/lib/libproc/common/P32ton.c
          +++ new/usr/src/lib/libproc/common/P32ton.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  28      -
  29   27  #include <sys/types.h>
  30   28  #include <sys/mkdev.h>
  31   29  #include <sys/regset.h>
  32   30  #include <string.h>
  33   31  
  34   32  #if defined(__amd64)
  35   33  #include <sys/fp.h>
  36   34  #include <ieeefp.h>
  37   35  #endif
  38   36  
↓ open down ↓ 325 lines elided ↑ open up ↑
 364  362          timestruc_32_to_n(&src->pr_stime, &dst->pr_stime);
 365  363          timestruc_32_to_n(&src->pr_cutime, &dst->pr_cutime);
 366  364          timestruc_32_to_n(&src->pr_cstime, &dst->pr_cstime);
 367  365  
 368  366          dst->pr_sigtrace = src->pr_sigtrace;
 369  367          dst->pr_flttrace = src->pr_flttrace;
 370  368          dst->pr_sysentry = src->pr_sysentry;
 371  369          dst->pr_sysexit = src->pr_sysexit;
 372  370          dst->pr_dmodel = src->pr_dmodel;
 373  371  
      372 +        (void) memcpy(&dst->pr_secflags, &src->pr_secflags, sizeof (psecflags_t));
      373 +
 374  374          lwpstatus_32_to_n(&src->pr_lwp, &dst->pr_lwp);
 375  375  }
 376  376  
 377  377  void
 378  378  lwpsinfo_32_to_n(const lwpsinfo32_t *src, lwpsinfo_t *dst)
 379  379  {
 380  380          dst->pr_flag = src->pr_flag;
 381  381          dst->pr_lwpid = src->pr_lwpid;
 382  382          dst->pr_addr = src->pr_addr;
 383  383          dst->pr_wchan = src->pr_wchan;
↓ open down ↓ 353 lines elided ↑ open up ↑
 737  737          timestruc_n_to_32(&src->pr_stime, &dst->pr_stime);
 738  738          timestruc_n_to_32(&src->pr_cutime, &dst->pr_cutime);
 739  739          timestruc_n_to_32(&src->pr_cstime, &dst->pr_cstime);
 740  740  
 741  741          dst->pr_sigtrace = src->pr_sigtrace;
 742  742          dst->pr_flttrace = src->pr_flttrace;
 743  743          dst->pr_sysentry = src->pr_sysentry;
 744  744          dst->pr_sysexit = src->pr_sysexit;
 745  745          dst->pr_dmodel = src->pr_dmodel;
 746  746  
      747 +        (void) memcpy(&dst->pr_secflags, &src->pr_secflags, sizeof (psecflags_t));
      748 +
 747  749          lwpstatus_n_to_32(&src->pr_lwp, &dst->pr_lwp);
 748  750  }
 749  751  
 750  752  void
 751  753  lwpsinfo_n_to_32(const lwpsinfo_t *src, lwpsinfo32_t *dst)
 752  754  {
 753  755          dst->pr_flag = src->pr_flag;
 754  756          dst->pr_lwpid = (id32_t)src->pr_lwpid;
 755  757          dst->pr_addr = (caddr32_t)src->pr_addr;
 756  758          dst->pr_wchan = (caddr32_t)src->pr_wchan;
↓ open down ↓ 65 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX