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.


  28  * Copyright (c) 2013 by Delphix. All rights reserved.
  29  */
  30 
  31 #ifndef _PCONTROL_H
  32 #define _PCONTROL_H
  33 
  34 /*
  35  * Implemention-specific include file for libproc process management.
  36  * This is not to be seen by the clients of libproc.
  37  */
  38 
  39 #include <stdio.h>
  40 #include <gelf.h>
  41 #include <synch.h>
  42 #include <procfs.h>
  43 #include <rtld_db.h>
  44 #include <libproc.h>
  45 #include <libctf.h>
  46 #include <limits.h>
  47 #include <libproc.h>

  48 
  49 #ifdef  __cplusplus
  50 extern "C" {
  51 #endif
  52 
  53 #include "Putil.h"
  54 
  55 /*
  56  * Definitions of the process control structures, internal to libproc.
  57  * These may change without affecting clients of libproc.
  58  */
  59 
  60 /*
  61  * sym_tbl_t contains a primary and an (optional) auxiliary symbol table, which
  62  * we wish to treat as a single logical symbol table. In this logical table,
  63  * the data from the auxiliary table preceeds that from the primary. Symbol
  64  * indices start at [0], which is the first item in the auxiliary table
  65  * if there is one. The sole purpose for this is so that we can treat the
  66  * combination of .SUNW_ldynsym and .dynsym sections as a logically single
  67  * entity without having to violate the public interface to libelf.


 147         prfdinfo_t fd_info;     /* fd info */
 148 } fd_info_t;
 149 
 150 typedef struct core_info {      /* information specific to core files */
 151         char core_dmodel;       /* data model for core file */
 152         char core_osabi;        /* ELF OS ABI */
 153         int core_errno;         /* error during initialization if != 0 */
 154         plist_t core_lwp_head;  /* head of list of lwp info */
 155         lwp_info_t *core_lwp;   /* current lwp information */
 156         uint_t core_nlwp;       /* number of lwp's in list */
 157         off64_t core_size;      /* size of core file in bytes */
 158         char *core_platform;    /* platform string from core file */
 159         struct utsname *core_uts;       /* uname(2) data from core file */
 160         prcred_t *core_cred;    /* process credential from core file */
 161         core_content_t core_content;    /* content dumped to core file */
 162         prpriv_t *core_priv;    /* process privileges from core file */
 163         size_t core_priv_size;  /* size of the privileges */
 164         void *core_privinfo;    /* system privileges info from core file */
 165         priv_impl_info_t *core_ppii;    /* NOTE entry for core_privinfo */
 166         char *core_zonename;    /* zone name from core file */

 167 #if defined(__i386) || defined(__amd64)
 168         struct ssd *core_ldt;   /* LDT entries from core file */
 169         uint_t core_nldt;       /* number of LDT entries in core file */
 170 #endif
 171 } core_info_t;
 172 
 173 typedef struct elf_file_header { /* extended ELF header */
 174         unsigned char e_ident[EI_NIDENT];
 175         Elf64_Half e_type;
 176         Elf64_Half e_machine;
 177         Elf64_Word e_version;
 178         Elf64_Addr e_entry;
 179         Elf64_Off e_phoff;
 180         Elf64_Off e_shoff;
 181         Elf64_Word e_flags;
 182         Elf64_Half e_ehsize;
 183         Elf64_Half e_phentsize;
 184         Elf64_Half e_shentsize;
 185         Elf64_Word e_phnum;     /* phdr count extended to 32 bits */
 186         Elf64_Word e_shnum;     /* shdr count extended to 32 bits */




  28  * Copyright (c) 2013 by Delphix. All rights reserved.
  29  */
  30 
  31 #ifndef _PCONTROL_H
  32 #define _PCONTROL_H
  33 
  34 /*
  35  * Implemention-specific include file for libproc process management.
  36  * This is not to be seen by the clients of libproc.
  37  */
  38 
  39 #include <stdio.h>
  40 #include <gelf.h>
  41 #include <synch.h>
  42 #include <procfs.h>
  43 #include <rtld_db.h>
  44 #include <libproc.h>
  45 #include <libctf.h>
  46 #include <limits.h>
  47 #include <libproc.h>
  48 #include <sys/secflags.h>
  49 
  50 #ifdef  __cplusplus
  51 extern "C" {
  52 #endif
  53 
  54 #include "Putil.h"
  55 
  56 /*
  57  * Definitions of the process control structures, internal to libproc.
  58  * These may change without affecting clients of libproc.
  59  */
  60 
  61 /*
  62  * sym_tbl_t contains a primary and an (optional) auxiliary symbol table, which
  63  * we wish to treat as a single logical symbol table. In this logical table,
  64  * the data from the auxiliary table preceeds that from the primary. Symbol
  65  * indices start at [0], which is the first item in the auxiliary table
  66  * if there is one. The sole purpose for this is so that we can treat the
  67  * combination of .SUNW_ldynsym and .dynsym sections as a logically single
  68  * entity without having to violate the public interface to libelf.


 148         prfdinfo_t fd_info;     /* fd info */
 149 } fd_info_t;
 150 
 151 typedef struct core_info {      /* information specific to core files */
 152         char core_dmodel;       /* data model for core file */
 153         char core_osabi;        /* ELF OS ABI */
 154         int core_errno;         /* error during initialization if != 0 */
 155         plist_t core_lwp_head;  /* head of list of lwp info */
 156         lwp_info_t *core_lwp;   /* current lwp information */
 157         uint_t core_nlwp;       /* number of lwp's in list */
 158         off64_t core_size;      /* size of core file in bytes */
 159         char *core_platform;    /* platform string from core file */
 160         struct utsname *core_uts;       /* uname(2) data from core file */
 161         prcred_t *core_cred;    /* process credential from core file */
 162         core_content_t core_content;    /* content dumped to core file */
 163         prpriv_t *core_priv;    /* process privileges from core file */
 164         size_t core_priv_size;  /* size of the privileges */
 165         void *core_privinfo;    /* system privileges info from core file */
 166         priv_impl_info_t *core_ppii;    /* NOTE entry for core_privinfo */
 167         char *core_zonename;    /* zone name from core file */
 168         prsecflags_t *core_secflags; /* secflags from core file */
 169 #if defined(__i386) || defined(__amd64)
 170         struct ssd *core_ldt;   /* LDT entries from core file */
 171         uint_t core_nldt;       /* number of LDT entries in core file */
 172 #endif
 173 } core_info_t;
 174 
 175 typedef struct elf_file_header { /* extended ELF header */
 176         unsigned char e_ident[EI_NIDENT];
 177         Elf64_Half e_type;
 178         Elf64_Half e_machine;
 179         Elf64_Word e_version;
 180         Elf64_Addr e_entry;
 181         Elf64_Off e_phoff;
 182         Elf64_Off e_shoff;
 183         Elf64_Word e_flags;
 184         Elf64_Half e_ehsize;
 185         Elf64_Half e_phentsize;
 186         Elf64_Half e_shentsize;
 187         Elf64_Word e_phnum;     /* phdr count extended to 32 bits */
 188         Elf64_Word e_shnum;     /* shdr count extended to 32 bits */