Print this page
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/uts/common/c2/audit_event.c
          +++ new/usr/src/uts/common/c2/audit_event.c
↓ open down ↓ 69 lines elided ↑ open up ↑
  70   70  #include <sys/strsubr.h>
  71   71  #include <sys/stropts.h>
  72   72  #include <sys/tihdr.h>
  73   73  #include <sys/socket.h>
  74   74  #include <sys/socketvar.h>
  75   75  #include <sys/vfs_opreg.h>
  76   76  #include <fs/sockfs/sockcommon.h>
  77   77  #include <netinet/in.h>
  78   78  #include <sys/ddi.h>
  79   79  #include <sys/port_impl.h>
       80 +#include <sys/secflags.h>
  80   81  
  81   82  static au_event_t       aui_fchownat(au_event_t);
  82   83  static au_event_t       aui_fchmodat(au_event_t);
  83   84  static au_event_t       aui_open(au_event_t);
  84   85  static au_event_t       aui_openat(au_event_t);
  85   86  static au_event_t       aui_unlinkat(au_event_t);
  86   87  static au_event_t       aui_fstatat(au_event_t);
  87   88  static au_event_t       aui_msgsys(au_event_t);
  88   89  static au_event_t       aui_shmsys(au_event_t);
  89   90  static au_event_t       aui_semsys(au_event_t);
↓ open down ↓ 5 lines elided ↑ open up ↑
  95   96  static au_event_t       aui_portfs(au_event_t);
  96   97  static au_event_t       aui_auditsys(au_event_t);
  97   98  static au_event_t       aui_modctl(au_event_t);
  98   99  static au_event_t       aui_acl(au_event_t);
  99  100  static au_event_t       aui_doorfs(au_event_t);
 100  101  static au_event_t       aui_privsys(au_event_t);
 101  102  static au_event_t       aui_forksys(au_event_t);
 102  103  static au_event_t       aui_labelsys(au_event_t);
 103  104  static au_event_t       aui_setpgrp(au_event_t);
 104  105  
      106 +
 105  107  static void     aus_exit(struct t_audit_data *);
 106  108  static void     aus_open(struct t_audit_data *);
 107  109  static void     aus_openat(struct t_audit_data *);
 108  110  static void     aus_acl(struct t_audit_data *);
 109  111  static void     aus_acct(struct t_audit_data *);
 110  112  static void     aus_chown(struct t_audit_data *);
 111  113  static void     aus_fchown(struct t_audit_data *);
 112  114  static void     aus_lchown(struct t_audit_data *);
 113  115  static void     aus_fchownat(struct t_audit_data *);
 114  116  static void     aus_chmod(struct t_audit_data *);
↓ open down ↓ 82 lines elided ↑ open up ↑
 197  199   * PROCESSING   EVENT           PROCESSING      CALL
 198  200   * ----------   ----------      ----------      -----------
 199  201   *              FINISH          EVENT
 200  202   *              PROCESSING      CONTROL
 201  203   * ----------------------------------------------------------
 202  204   */
 203  205  aui_null,       AUE_NULL,       aus_null,       /* 0 unused (indirect) */
 204  206                  auf_null,       0,
 205  207  aui_null,       AUE_EXIT,       aus_exit,       /* 1 exit */
 206  208                  auf_null,       S2E_NPT,
 207      -aui_null,       AUE_NULL,       aus_null,       /* 2 (loadable) was forkall */
      209 +aui_null,       AUE_PSECFLAGS,  aus_null,       /* 2 psecflags */
 208  210                  auf_null,       0,
 209  211  aui_null,       AUE_READ,       aus_null,       /* 3 read */
 210  212                  auf_read,       S2E_PUB,
 211  213  aui_null,       AUE_WRITE,      aus_null,       /* 4 write */
 212  214                  auf_write,      0,
 213  215  aui_open,       AUE_OPEN,       aus_open,       /* 5 open */
 214  216                  auf_null,       S2E_SP,
 215  217  aui_null,       AUE_CLOSE,      aus_close,      /* 6 close */
 216  218                  auf_null,       0,
 217  219  aui_null,       AUE_LINK,       aus_null,       /* 7 linkat */
↓ open down ↓ 518 lines elided ↑ open up ↑
 736  738  {
 737  739          uint32_t rval;
 738  740          struct a {
 739  741                  long rval;
 740  742          } *uap = (struct a *)ttolwp(curthread)->lwp_ap;
 741  743  
 742  744          rval = (uint32_t)uap->rval;
 743  745          au_uwrite(au_to_arg32(1, "exit status", rval));
 744  746  }
 745  747  
      748 +
 746  749  /* acct start function */
 747  750  /*ARGSUSED*/
 748  751  static void
 749  752  aus_acct(struct t_audit_data *tad)
 750  753  {
 751  754          klwp_t *clwp = ttolwp(curthread);
 752  755          uintptr_t fname;
 753  756  
 754  757          struct a {
 755  758                  long    fname;          /* char * */
↓ open down ↓ 5113 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX