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.


 204 };
 205 
 206 #define NERRCODE        (sizeof (errcode) / sizeof (char *))
 207 
 208 
 209 const char *
 210 errname(int err)        /* return the error code name (NULL if none) */
 211 {
 212         const char *ename = NULL;
 213 
 214         if (err >= 0 && err < NERRCODE)
 215                 ename = errcode[err];
 216 
 217         return (ename);
 218 }
 219 
 220 
 221 const struct systable systable[] = {
 222 { NULL,         8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
 223 {"_exit",       1, DEC, NOV, DEC},                              /*   1 */
 224 { NULL,         8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
 225 {"read",        3, DEC, NOV, DEC, IOB, UNS},                    /*   3 */
 226 {"write",       3, DEC, NOV, DEC, IOB, UNS},                    /*   4 */
 227 {"open",        3, DEC, NOV, STG, OPN, OCT},                    /*   5 */
 228 {"close",       1, DEC, NOV, DEC},                              /*   6 */
 229 {"linkat",      5, DEC, NOV, ATC, STG, ATC, STG, SNF},          /*   7 */
 230 { NULL,         8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
 231 {"link",        2, DEC, NOV, STG, STG},                         /*   9 */
 232 {"unlink",      1, DEC, NOV, STG},                              /*  10 */
 233 {"symlinkat",   3, DEC, NOV, STG, ATC, STG},                    /*  11 */
 234 {"chdir",       1, DEC, NOV, STG},                              /*  12 */
 235 {"time",        0, DEC, NOV},                                   /*  13 */
 236 {"mknod",       3, DEC, NOV, STG, OCT, HEX},                    /*  14 */
 237 {"chmod",       2, DEC, NOV, STG, OCT},                         /*  15 */
 238 {"chown",       3, DEC, NOV, STG, DEC, DEC},                    /*  16 */
 239 {"brk",         1, DEC, NOV, HEX},                              /*  17 */
 240 {"stat",        2, DEC, NOV, STG, HEX},                         /*  18 */
 241 {"lseek",       3, DEC, NOV, DEC, DEX, WHN},                    /*  19 */
 242 {"getpid",      0, DEC, DEC},                                   /*  20 */
 243 {"mount",       8, DEC, NOV, STG, STG, MTF, MFT, HEX, DEC, HEX, DEC}, /* 21 */
 244 {"readlinkat",  4, DEC, NOV, ATC, STG, RLK, UNS},               /*  22 */




 204 };
 205 
 206 #define NERRCODE        (sizeof (errcode) / sizeof (char *))
 207 
 208 
 209 const char *
 210 errname(int err)        /* return the error code name (NULL if none) */
 211 {
 212         const char *ename = NULL;
 213 
 214         if (err >= 0 && err < NERRCODE)
 215                 ename = errcode[err];
 216 
 217         return (ename);
 218 }
 219 
 220 
 221 const struct systable systable[] = {
 222 { NULL,         8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
 223 {"_exit",       1, DEC, NOV, DEC},                              /*   1 */
 224 {"psecflags",   3, DEC, NOV, HEX, PSFW, PSDLT},                 /*   2 */
 225 {"read",        3, DEC, NOV, DEC, IOB, UNS},                    /*   3 */
 226 {"write",       3, DEC, NOV, DEC, IOB, UNS},                    /*   4 */
 227 {"open",        3, DEC, NOV, STG, OPN, OCT},                    /*   5 */
 228 {"close",       1, DEC, NOV, DEC},                              /*   6 */
 229 {"linkat",      5, DEC, NOV, ATC, STG, ATC, STG, SNF},          /*   7 */
 230 { NULL,         8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
 231 {"link",        2, DEC, NOV, STG, STG},                         /*   9 */
 232 {"unlink",      1, DEC, NOV, STG},                              /*  10 */
 233 {"symlinkat",   3, DEC, NOV, STG, ATC, STG},                    /*  11 */
 234 {"chdir",       1, DEC, NOV, STG},                              /*  12 */
 235 {"time",        0, DEC, NOV},                                   /*  13 */
 236 {"mknod",       3, DEC, NOV, STG, OCT, HEX},                    /*  14 */
 237 {"chmod",       2, DEC, NOV, STG, OCT},                         /*  15 */
 238 {"chown",       3, DEC, NOV, STG, DEC, DEC},                    /*  16 */
 239 {"brk",         1, DEC, NOV, HEX},                              /*  17 */
 240 {"stat",        2, DEC, NOV, STG, HEX},                         /*  18 */
 241 {"lseek",       3, DEC, NOV, DEC, DEX, WHN},                    /*  19 */
 242 {"getpid",      0, DEC, DEC},                                   /*  20 */
 243 {"mount",       8, DEC, NOV, STG, STG, MTF, MFT, HEX, DEC, HEX, DEC}, /* 21 */
 244 {"readlinkat",  4, DEC, NOV, ATC, STG, RLK, UNS},               /*  22 */