| @@ -160,6 +160,7 @@ static const struct audit_nfcfgop_tab audit_nfcfgs[] = { · 159 unmodified lines |
| 160 | static int audit_match_perm(struct audit_context *ctx, int mask) | 160 | static int audit_match_perm(struct audit_context *ctx, int mask) |
| 161 | { | 161 | { |
| 162 | unsigned n; | 162 | unsigned n; |
| | 163 | |
| 163 | if (unlikely(!ctx)) | 164 | if (unlikely(!ctx)) |
| 164 | return 0; | 165 | return 0; |
| 165 | n = ctx->major; | 166 | n = ctx->major; |
| @@ -231,7 +232,7 @@ static void audit_set_auditable(struct audit_context *ctx) · 65 unmodified lines |
| 231 | { | 232 | { |
| 232 | if (!ctx->prio) { | 233 | if (!ctx->prio) { |
| 233 | ctx->prio = 1; | 234 | ctx->prio = 1; |
| 234 | ctx->current_state = AUDIT_RECORD_CONTEXT; | 235 | ctx->current_state = AUDIT_STATE_RECORD; |
| 235 | } | 236 | } |
| 236 | } | 237 | } |
| 237 | | 238 | |
| @@ -239,6 +240,7 @@ static int put_tree_ref(struct audit_context *ctx, struct audit_chunk *chunk) · 1 unmodified line |
| 239 | { | 240 | { |
| 240 | struct audit_tree_refs *p = ctx->trees; | 241 | struct audit_tree_refs *p = ctx->trees; |
| 241 | int left = ctx->tree_count; | 242 | int left = ctx->tree_count; |
| | 243 | |
| 242 | if (likely(left)) { | 244 | if (likely(left)) { |
| 243 | p->c[--left] = chunk; | 245 | p->c[--left] = chunk; |
| 244 | ctx->tree_count = left; | 246 | ctx->tree_count = left; |
| @@ -259,6 +261,7 @@ static int put_tree_ref(struct audit_context *ctx, struct audit_chunk *chunk) · 14 unmodified lines |
| 259 | static int grow_tree_refs(struct audit_context *ctx) | 261 | static int grow_tree_refs(struct audit_context *ctx) |
| 260 | { | 262 | { |
| 261 | struct audit_tree_refs *p = ctx->trees; | 263 | struct audit_tree_refs *p = ctx->trees; |
| | 264 | |
| 262 | ctx->trees = kzalloc(sizeof(struct audit_tree_refs), GFP_KERNEL); | 265 | ctx->trees = kzalloc(sizeof(struct audit_tree_refs), GFP_KERNEL); |
| 263 | if (!ctx->trees) { | 266 | if (!ctx->trees) { |
| 264 | ctx->trees = p; | 267 | ctx->trees = p; |
| @@ -277,6 +280,7 @@ static void unroll_tree_refs(struct audit_context *ctx, · 12 unmodified lines |
| 277 | { | 280 | { |
| 278 | struct audit_tree_refs *q; | 281 | struct audit_tree_refs *q; |
| 279 | int n; | 282 | int n; |
| | 283 | |
| 280 | if (!p) { | 284 | if (!p) { |
| 281 | /* we started with empty chain */ | 285 | /* we started with empty chain */ |
| 282 | p = ctx->first_trees; | 286 | p = ctx->first_trees; |
| @@ -303,6 +307,7 @@ static void unroll_tree_refs(struct audit_context *ctx, · 20 unmodified lines |
| 303 | static void free_tree_refs(struct audit_context *ctx) | 307 | static void free_tree_refs(struct audit_context *ctx) |
| 304 | { | 308 | { |
| 305 | struct audit_tree_refs *p, *q; | 309 | struct audit_tree_refs *p, *q; |
| | 310 | |
| 306 | for (p = ctx->first_trees; p; p = q) { | 311 | for (p = ctx->first_trees; p; p = q) { |
| 307 | q = p->next; | 312 | q = p->next; |
| 308 | kfree(p); | 313 | kfree(p); |
| @@ -313,6 +318,7 @@ static int match_tree_refs(struct audit_context *ctx, struct audit_tree *tree) · 4 unmodified lines |
| 313 | { | 318 | { |
| 314 | struct audit_tree_refs *p; | 319 | struct audit_tree_refs *p; |
| 315 | int n; | 320 | int n; |
| | 321 | |
| 316 | if (!tree) | 322 | if (!tree) |
| 317 | return 0; | 323 | return 0; |
| 318 | /* full ones */ | 324 | /* full ones */ |
| @@ -337,13 +343,13 @@ static int audit_compare_uid(kuid_t uid, · 18 unmodified lines |
| 337 | { | 343 | { |
| 338 | struct audit_names *n; | 344 | struct audit_names *n; |
| 339 | int rc; | 345 | int rc; |
| 340 | | 346 | |
| 341 | if (name) { | 347 | if (name) { |
| 342 | rc = audit_uid_comparator(uid, f->op, name->uid); | 348 | rc = audit_uid_comparator(uid, f->op, name->uid); |
| 343 | if (rc) | 349 | if (rc) |
| 344 | return rc; | 350 | return rc; |
| 345 | } | 351 | } |
| 346 | | 352 | |
| 347 | if (ctx) { | 353 | if (ctx) { |
| 348 | list_for_each_entry(n, &ctx->names_list, list) { | 354 | list_for_each_entry(n, &ctx->names_list, list) { |
| 349 | rc = audit_uid_comparator(uid, f->op, n->uid); | 355 | rc = audit_uid_comparator(uid, f->op, n->uid); |
| @@ -361,13 +367,13 @@ static int audit_compare_gid(kgid_t gid, · 11 unmodified lines |
| 361 | { | 367 | { |
| 362 | struct audit_names *n; | 368 | struct audit_names *n; |
| 363 | int rc; | 369 | int rc; |
| 364 | | 370 | |
| 365 | if (name) { | 371 | if (name) { |
| 366 | rc = audit_gid_comparator(gid, f->op, name->gid); | 372 | rc = audit_gid_comparator(gid, f->op, name->gid); |
| 367 | if (rc) | 373 | if (rc) |
| 368 | return rc; | 374 | return rc; |
| 369 | } | 375 | } |
| 370 | | 376 | |
| 371 | if (ctx) { | 377 | if (ctx) { |
| 372 | list_for_each_entry(n, &ctx->names_list, list) { | 378 | list_for_each_entry(n, &ctx->names_list, list) { |
| 373 | rc = audit_gid_comparator(gid, f->op, n->gid); | 379 | rc = audit_gid_comparator(gid, f->op, n->gid); |
| @@ -751,10 +757,10 @@ static int audit_filter_rules(struct task_struct *tsk, · 377 unmodified lines |
| 751 | } | 757 | } |
| 752 | switch (rule->action) { | 758 | switch (rule->action) { |
| 753 | case AUDIT_NEVER: | 759 | case AUDIT_NEVER: |
| 754 | *state = AUDIT_DISABLED; | 760 | *state = AUDIT_STATE_DISABLED; |
| 755 | break; | 761 | break; |
| 756 | case AUDIT_ALWAYS: | 762 | case AUDIT_ALWAYS: |
| 757 | *state = AUDIT_RECORD_CONTEXT; | 763 | *state = AUDIT_STATE_RECORD; |
| 758 | break; | 764 | break; |
| 759 | } | 765 | } |
| 760 | return 1; | 766 | return 1; |
| @@ -773,14 +779,14 @@ static enum audit_state audit_filter_task(struct task_struct *tsk, char **key) · 12 unmodified lines |
| 773 | list_for_each_entry_rcu(e, &audit_filter_list[AUDIT_FILTER_TASK], list) { | 779 | list_for_each_entry_rcu(e, &audit_filter_list[AUDIT_FILTER_TASK], list) { |
| 774 | if (audit_filter_rules(tsk, &e->rule, NULL, NULL, | 780 | if (audit_filter_rules(tsk, &e->rule, NULL, NULL, |
| 775 | &state, true)) { | 781 | &state, true)) { |
| 776 | if (state == AUDIT_RECORD_CONTEXT) | 782 | if (state == AUDIT_STATE_RECORD) |
| 777 | *key = kstrdup(e->rule.filterkey, GFP_ATOMIC); | 783 | *key = kstrdup(e->rule.filterkey, GFP_ATOMIC); |
| 778 | rcu_read_unlock(); | 784 | rcu_read_unlock(); |
| 779 | return state; | 785 | return state; |
| 780 | } | 786 | } |
| 781 | } | 787 | } |
| 782 | rcu_read_unlock(); | 788 | rcu_read_unlock(); |
| 783 | return AUDIT_BUILD_CONTEXT; | 789 | return AUDIT_STATE_BUILD; |
| 784 | } | 790 | } |
| 785 | | 791 | |
| 786 | static int audit_in_mask(const struct audit_krule *rule, unsigned long val) | 792 | static int audit_in_mask(const struct audit_krule *rule, unsigned long val) |
| @@ -802,7 +808,7 @@ static int audit_in_mask(const struct audit_krule *rule, unsigned long val) · 15 unmodified lines |
| 802 | /* At syscall exit time, this filter is called if the audit_state is | 808 | /* At syscall exit time, this filter is called if the audit_state is |
| 803 | * not low enough that auditing cannot take place, but is also not | 809 | * not low enough that auditing cannot take place, but is also not |
| 804 | * high enough that we already know we have to write an audit record | 810 | * high enough that we already know we have to write an audit record |
| 805 | * (i.e., the state is AUDIT_SETUP_CONTEXT or AUDIT_BUILD_CONTEXT). | 811 | * (i.e., the state is AUDIT_STATE_BUILD). |
| 806 | */ | 812 | */ |
| 807 | static void audit_filter_syscall(struct task_struct *tsk, | 813 | static void audit_filter_syscall(struct task_struct *tsk, |
| 808 | struct audit_context *ctx) | 814 | struct audit_context *ctx) |
| @@ -923,7 +929,7 @@ static inline struct audit_context *audit_alloc_context(enum audit_state state) · 114 unmodified lines |
| 923 | if (!context) | 929 | if (!context) |
| 924 | return NULL; | 930 | return NULL; |
| 925 | context->state = state; | 931 | context->state = state; |
| 926 | context->prio = state == AUDIT_RECORD_CONTEXT ? ~0ULL : 0; | 932 | context->prio = state == AUDIT_STATE_RECORD ? ~0ULL : 0; |
| 927 | INIT_LIST_HEAD(&context->killed_trees); | 933 | INIT_LIST_HEAD(&context->killed_trees); |
| 928 | INIT_LIST_HEAD(&context->names_list); | 934 | INIT_LIST_HEAD(&context->names_list); |
| 929 | context->fds[0] = -1; | 935 | context->fds[0] = -1; |
| @@ -950,7 +956,7 @@ int audit_alloc(struct task_struct *tsk) · 20 unmodified lines |
| 950 | return 0; /* Return if not auditing. */ | 956 | return 0; /* Return if not auditing. */ |
| 951 | | 957 | |
| 952 | state = audit_filter_task(tsk, &key); | 958 | state = audit_filter_task(tsk, &key); |
| 953 | if (state == AUDIT_DISABLED) { | 959 | if (state == AUDIT_STATE_DISABLED) { |
| 954 | clear_task_syscall_work(tsk, SYSCALL_AUDIT); | 960 | clear_task_syscall_work(tsk, SYSCALL_AUDIT); |
| 955 | return 0; | 961 | return 0; |
| 956 | } | 962 | } |
| @@ -1225,6 +1231,7 @@ static void show_special(struct audit_context *context, int *call_panic) · 268 unmodified lines |
| 1225 | switch (context->type) { | 1231 | switch (context->type) { |
| 1226 | case AUDIT_SOCKETCALL: { | 1232 | case AUDIT_SOCKETCALL: { |
| 1227 | int nargs = context->socketcall.nargs; | 1233 | int nargs = context->socketcall.nargs; |
| | 1234 | |
| 1228 | audit_log_format(ab, "nargs=%d", nargs); | 1235 | audit_log_format(ab, "nargs=%d", nargs); |
| 1229 | for (i = 0; i < nargs; i++) | 1236 | for (i = 0; i < nargs; i++) |
| 1230 | audit_log_format(ab, " a%d=%lx", i, | 1237 | audit_log_format(ab, " a%d=%lx", i, |
| @@ -1240,6 +1247,7 @@ static void show_special(struct audit_context *context, int *call_panic) · 9 unmodified lines |
| 1240 | if (osid) { | 1247 | if (osid) { |
| 1241 | char *ctx = NULL; | 1248 | char *ctx = NULL; |
| 1242 | u32 len; | 1249 | u32 len; |
| | 1250 | |
| 1243 | if (security_secid_to_secctx(osid, &ctx, &len)) { | 1251 | if (security_secid_to_secctx(osid, &ctx, &len)) { |
| 1244 | audit_log_format(ab, " osid=%u", osid); | 1252 | audit_log_format(ab, " osid=%u", osid); |
| 1245 | *call_panic = 1; | 1253 | *call_panic = 1; |
| @@ -1289,6 +1297,7 @@ static void show_special(struct audit_context *context, int *call_panic) · 43 unmodified lines |
| 1289 | break; | 1297 | break; |
| 1290 | case AUDIT_MQ_GETSETATTR: { | 1298 | case AUDIT_MQ_GETSETATTR: { |
| 1291 | struct mq_attr *attr = &context->mq_getsetattr.mqstat; | 1299 | struct mq_attr *attr = &context->mq_getsetattr.mqstat; |
| | 1300 | |
| 1292 | audit_log_format(ab, | 1301 | audit_log_format(ab, |
| 1293 | "mqdes=%d mq_flags=0x%lx mq_maxmsg=%ld mq_msgsize=%ld " | 1302 | "mqdes=%d mq_flags=0x%lx mq_maxmsg=%ld mq_msgsize=%ld " |
| 1294 | "mq_curmsgs=%ld ", | 1303 | "mq_curmsgs=%ld ", |
| @@ -1325,6 +1334,7 @@ static void show_special(struct audit_context *context, int *call_panic) · 30 unmodified lines |
| 1325 | static inline int audit_proctitle_rtrim(char *proctitle, int len) | 1334 | static inline int audit_proctitle_rtrim(char *proctitle, int len) |
| 1326 | { | 1335 | { |
| 1327 | char *end = proctitle + len - 1; | 1336 | char *end = proctitle + len - 1; |
| | 1337 | |
| 1328 | while (end > proctitle && !isprint(*end)) | 1338 | while (end > proctitle && !isprint(*end)) |
| 1329 | end--; | 1339 | end--; |
| 1330 | | 1340 | |
| @@ -1513,6 +1523,7 @@ static void audit_log_exit(void) · 182 unmodified lines |
| 1513 | | 1523 | |
| 1514 | case AUDIT_BPRM_FCAPS: { | 1524 | case AUDIT_BPRM_FCAPS: { |
| 1515 | struct audit_aux_data_bprm_fcaps *axs = (void *)aux; | 1525 | struct audit_aux_data_bprm_fcaps *axs = (void *)aux; |
| | 1526 | |
| 1516 | audit_log_format(ab, "fver=%x", axs->fcap_ver); | 1527 | audit_log_format(ab, "fver=%x", axs->fcap_ver); |
| 1517 | audit_log_cap(ab, "fp", &axs->fcap.permitted); | 1528 | audit_log_cap(ab, "fp", &axs->fcap.permitted); |
| 1518 | audit_log_cap(ab, "fi", &axs->fcap.inheritable); | 1529 | audit_log_cap(ab, "fi", &axs->fcap.inheritable); |
| @@ -1628,7 +1639,7 @@ void __audit_free(struct task_struct *tsk) · 109 unmodified lines |
| 1628 | | 1639 | |
| 1629 | audit_filter_syscall(tsk, context); | 1640 | audit_filter_syscall(tsk, context); |
| 1630 | audit_filter_inodes(tsk, context); | 1641 | audit_filter_inodes(tsk, context); |
| 1631 | if (context->current_state == AUDIT_RECORD_CONTEXT) | 1642 | if (context->current_state == AUDIT_STATE_RECORD) |
| 1632 | audit_log_exit(); | 1643 | audit_log_exit(); |
| 1633 | } | 1644 | } |
| 1634 | | 1645 | |
| @@ -1647,7 +1658,7 @@ void __audit_free(struct task_struct *tsk) · 12 unmodified lines |
| 1647 | * Fill in audit context at syscall entry. This only happens if the | 1658 | * Fill in audit context at syscall entry. This only happens if the |
| 1648 | * audit context was created when the task was created and the state or | 1659 | * audit context was created when the task was created and the state or |
| 1649 | * filters demand the audit context be built. If the state from the | 1660 | * filters demand the audit context be built. If the state from the |
| 1650 | * per-task filter or from the per-syscall filter is AUDIT_RECORD_CONTEXT, | 1661 | * per-task filter or from the per-syscall filter is AUDIT_STATE_RECORD, |
| 1651 | * then the record will be written at syscall exit time (otherwise, it | 1662 | * then the record will be written at syscall exit time (otherwise, it |
| 1652 | * will only be written if another part of the kernel requests that it | 1663 | * will only be written if another part of the kernel requests that it |
| 1653 | * be written). | 1664 | * be written). |
| @@ -1664,11 +1675,11 @@ void __audit_syscall_entry(int major, unsigned long a1, unsigned long a2, · 10 unmodified lines |
| 1664 | BUG_ON(context->in_syscall || context->name_count); | 1675 | BUG_ON(context->in_syscall || context->name_count); |
| 1665 | | 1676 | |
| 1666 | state = context->state; | 1677 | state = context->state; |
| 1667 | if (state == AUDIT_DISABLED) | 1678 | if (state == AUDIT_STATE_DISABLED) |
| 1668 | return; | 1679 | return; |
| 1669 | | 1680 | |
| 1670 | context->dummy = !audit_n_rules; | 1681 | context->dummy = !audit_n_rules; |
| 1671 | if (!context->dummy && state == AUDIT_BUILD_CONTEXT) { | 1682 | if (!context->dummy && state == AUDIT_STATE_BUILD) { |
| 1672 | context->prio = 0; | 1683 | context->prio = 0; |
| 1673 | if (auditd_test_task(current)) | 1684 | if (auditd_test_task(current)) |
| 1674 | return; | 1685 | return; |
| @@ -1693,7 +1704,7 @@ void __audit_syscall_entry(int major, unsigned long a1, unsigned long a2, · 18 unmodified lines |
| 1693 | * @return_code: return value of the syscall | 1704 | * @return_code: return value of the syscall |
| 1694 | * | 1705 | * |
| 1695 | * Tear down after system call. If the audit context has been marked as | 1706 | * Tear down after system call. If the audit context has been marked as |
| 1696 | * auditable (either because of the AUDIT_RECORD_CONTEXT state from | 1707 | * auditable (either because of the AUDIT_STATE_RECORD state from |
| 1697 | * filtering, or because some other part of the kernel wrote an audit | 1708 | * filtering, or because some other part of the kernel wrote an audit |
| 1698 | * message), then write out the syscall information. In call cases, | 1709 | * message), then write out the syscall information. In call cases, |
| 1699 | * free the names stored from getname(). | 1710 | * free the names stored from getname(). |
| @@ -1735,12 +1746,12 @@ void __audit_syscall_exit(int success, long return_code) · 35 unmodified lines |
| 1735 | | 1746 | |
| 1736 | audit_filter_syscall(current, context); | 1747 | audit_filter_syscall(current, context); |
| 1737 | audit_filter_inodes(current, context); | 1748 | audit_filter_inodes(current, context); |
| 1738 | if (context->current_state == AUDIT_RECORD_CONTEXT) | 1749 | if (context->current_state == AUDIT_STATE_RECORD) |
| 1739 | audit_log_exit(); | 1750 | audit_log_exit(); |
| 1740 | } | 1751 | } |
| 1741 | | 1752 | |
| 1742 | context->in_syscall = 0; | 1753 | context->in_syscall = 0; |
| 1743 | context->prio = context->state == AUDIT_RECORD_CONTEXT ? ~0ULL : 0; | 1754 | context->prio = context->state == AUDIT_STATE_RECORD ? ~0ULL : 0; |
| 1744 | | 1755 | |
| 1745 | audit_free_module(context); | 1756 | audit_free_module(context); |
| 1746 | audit_free_names(context); | 1757 | audit_free_names(context); |
| @@ -1753,7 +1764,7 @@ void __audit_syscall_exit(int success, long return_code) · 6 unmodified lines |
| 1753 | context->sockaddr_len = 0; | 1764 | context->sockaddr_len = 0; |
| 1754 | context->type = 0; | 1765 | context->type = 0; |
| 1755 | context->fds[0] = -1; | 1766 | context->fds[0] = -1; |
| 1756 | if (context->state != AUDIT_RECORD_CONTEXT) { | 1767 | if (context->state != AUDIT_STATE_RECORD) { |
| 1757 | kfree(context->filterkey); | 1768 | kfree(context->filterkey); |
| 1758 | context->filterkey = NULL; | 1769 | context->filterkey = NULL; |
| 1759 | } | 1770 | } |
| @@ -1765,6 +1776,7 @@ static inline void handle_one(const struct inode *inode) · 5 unmodified lines |
| 1765 | struct audit_tree_refs *p; | 1776 | struct audit_tree_refs *p; |
| 1766 | struct audit_chunk *chunk; | 1777 | struct audit_chunk *chunk; |
| 1767 | int count; | 1778 | int count; |
| | 1779 | |
| 1768 | if (likely(!inode->i_fsnotify_marks)) | 1780 | if (likely(!inode->i_fsnotify_marks)) |
| 1769 | return; | 1781 | return; |
| 1770 | context = audit_context(); | 1782 | context = audit_context(); |
| @@ -1806,8 +1818,10 @@ retry: · 35 unmodified lines |
| 1806 | seq = read_seqbegin(&rename_lock); | 1818 | seq = read_seqbegin(&rename_lock); |
| 1807 | for(;;) { | 1819 | for(;;) { |
| 1808 | struct inode *inode = d_backing_inode(d); | 1820 | struct inode *inode = d_backing_inode(d); |
| | 1821 | |
| 1809 | if (inode && unlikely(inode->i_fsnotify_marks)) { | 1822 | if (inode && unlikely(inode->i_fsnotify_marks)) { |
| 1810 | struct audit_chunk *chunk; | 1823 | struct audit_chunk *chunk; |
| | 1824 | |
| 1811 | chunk = audit_tree_lookup(inode); | 1825 | chunk = audit_tree_lookup(inode); |
| 1812 | if (chunk) { | 1826 | if (chunk) { |
| 1813 | if (unlikely(!put_tree_ref(context, chunk))) { | 1827 | if (unlikely(!put_tree_ref(context, chunk))) { |
| @@ -2203,7 +2217,7 @@ int auditsc_get_stamp(struct audit_context *ctx, · 389 unmodified lines |
| 2203 | *serial = ctx->serial; | 2217 | *serial = ctx->serial; |
| 2204 | if (!ctx->prio) { | 2218 | if (!ctx->prio) { |
| 2205 | ctx->prio = 1; | 2219 | ctx->prio = 1; |
| 2206 | ctx->current_state = AUDIT_RECORD_CONTEXT; | 2220 | ctx->current_state = AUDIT_STATE_RECORD; |
| 2207 | } | 2221 | } |
| 2208 | return 1; | 2222 | return 1; |
| 2209 | } | 2223 | } |
| @@ -2285,6 +2299,7 @@ void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification) · 75 unmodified lines |
| 2285 | void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat) | 2299 | void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat) |
| 2286 | { | 2300 | { |
| 2287 | struct audit_context *context = audit_context(); | 2301 | struct audit_context *context = audit_context(); |
| | 2302 | |
| 2288 | context->mq_getsetattr.mqdes = mqdes; | 2303 | context->mq_getsetattr.mqdes = mqdes; |
| 2289 | context->mq_getsetattr.mqstat = *mqstat; | 2304 | context->mq_getsetattr.mqstat = *mqstat; |
| 2290 | context->type = AUDIT_MQ_GETSETATTR; | 2305 | context->type = AUDIT_MQ_GETSETATTR; |
| @@ -2298,6 +2313,7 @@ void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat) · 7 unmodified lines |
| 2298 | void __audit_ipc_obj(struct kern_ipc_perm *ipcp) | 2313 | void __audit_ipc_obj(struct kern_ipc_perm *ipcp) |
| 2299 | { | 2314 | { |
| 2300 | struct audit_context *context = audit_context(); | 2315 | struct audit_context *context = audit_context(); |
| | 2316 | |
| 2301 | context->ipc.uid = ipcp->uid; | 2317 | context->ipc.uid = ipcp->uid; |
| 2302 | context->ipc.gid = ipcp->gid; | 2318 | context->ipc.gid = ipcp->gid; |
| 2303 | context->ipc.mode = ipcp->mode; | 2319 | context->ipc.mode = ipcp->mode; |
| @@ -2362,6 +2378,7 @@ int __audit_socketcall(int nargs, unsigned long *args) · 58 unmodified lines |
| 2362 | void __audit_fd_pair(int fd1, int fd2) | 2378 | void __audit_fd_pair(int fd1, int fd2) |
| 2363 | { | 2379 | { |
| 2364 | struct audit_context *context = audit_context(); | 2380 | struct audit_context *context = audit_context(); |
| | 2381 | |
| 2365 | context->fds[0] = fd1; | 2382 | context->fds[0] = fd1; |
| 2366 | context->fds[1] = fd2; | 2383 | context->fds[1] = fd2; |
| 2367 | } | 2384 | } |
| @@ -2379,6 +2396,7 @@ int __audit_sockaddr(int len, void *a) · 11 unmodified lines |
| 2379 | | 2396 | |
| 2380 | if (!context->sockaddr) { | 2397 | if (!context->sockaddr) { |
| 2381 | void *p = kmalloc(sizeof(struct sockaddr_storage), GFP_KERNEL); | 2398 | void *p = kmalloc(sizeof(struct sockaddr_storage), GFP_KERNEL); |
| | 2399 | |
| 2382 | if (!p) | 2400 | if (!p) |
| 2383 | return -ENOMEM; | 2401 | return -ENOMEM; |
| 2384 | context->sockaddr = p; | 2402 | context->sockaddr = p; |
| @@ -2510,6 +2528,7 @@ int __audit_log_bprm_fcaps(struct linux_binprm *bprm, · 125 unmodified lines |
| 2510 | void __audit_log_capset(const struct cred *new, const struct cred *old) | 2528 | void __audit_log_capset(const struct cred *new, const struct cred *old) |
| 2511 | { | 2529 | { |
| 2512 | struct audit_context *context = audit_context(); | 2530 | struct audit_context *context = audit_context(); |
| | 2531 | |
| 2513 | context->capset.pid = task_tgid_nr(current); | 2532 | context->capset.pid = task_tgid_nr(current); |
| 2514 | context->capset.cap.effective = new->cap_effective; | 2533 | context->capset.cap.effective = new->cap_effective; |
| 2515 | context->capset.cap.inheritable = new->cap_effective; | 2534 | context->capset.cap.inheritable = new->cap_effective; |
| @@ -2521,6 +2540,7 @@ void __audit_log_capset(const struct cred *new, const struct cred *old) · 5 unmodified lines |
| 2521 | void __audit_mmap_fd(int fd, int flags) | 2540 | void __audit_mmap_fd(int fd, int flags) |
| 2522 | { | 2541 | { |
| 2523 | struct audit_context *context = audit_context(); | 2542 | struct audit_context *context = audit_context(); |
| | 2543 | |
| 2524 | context->mmap.fd = fd; | 2544 | context->mmap.fd = fd; |
| 2525 | context->mmap.flags = flags; | 2545 | context->mmap.flags = flags; |
| 2526 | context->type = AUDIT_MMAP; | 2546 | context->type = AUDIT_MMAP; |
| @@ -2686,6 +2706,7 @@ void audit_seccomp_actions_logged(const char *names, const char *old_names, · 159 unmodified lines |
| 2686 | struct list_head *audit_killed_trees(void) | 2706 | struct list_head *audit_killed_trees(void) |
| 2687 | { | 2707 | { |
| 2688 | struct audit_context *ctx = audit_context(); | 2708 | struct audit_context *ctx = audit_context(); |
| | 2709 | |
| 2689 | if (likely(!ctx || !ctx->in_syscall)) | 2710 | if (likely(!ctx || !ctx->in_syscall)) |
| 2690 | return NULL; | 2711 | return NULL; |
| 2691 | return &ctx->killed_trees; | 2712 | return &ctx->killed_trees; |