History

Merge git://git.infradead.org/users/eparis/audit

Pull audit updates from Eric Paris. * git://git.infradead.org/users/eparis/audit: (28 commits) AUDIT: make audit_is_compat depend on CONFIG_AUDIT_COMPAT_GENERIC audit: renumber AUDIT_FEATURE_CHANGE into the 1300 range audit: do not cast audit_rule_data pointers pointlesly AUDIT: Allow login in non-init namespaces audit: define audit_is_compat in kernel internal header kernel: Use RCU_INIT_POINTER(x, NULL) in audit.c sched: declare pid_alive as inline audit: use uapi/linux/audit.h for AUDIT_ARCH declarations syscall_get_arch: remove useless function arguments audit: remove stray newline from audit_log_execve_info() audit_panic() call audit: remove stray newlines from audit_log_lost messages audit: include subject in login records audit: remove superfluous new- prefix in AUDIT_LOGIN messages audit: allow user processes to log from another PID namespace audit: anchor all pid references in the initial pid namespace audit: convert PPIDs to the inital PID namespace. pid: get pid_t ppid of task in init_pid_ns audit: rename the misleading audit_get_context() to audit_take_context() audit: Add generic compat syscall support audit: Add CONFIG_HAVE_ARCH_AUDITSYSCALL ...

Linus Torvalds committed 12 years ago

Commit 0b747172 parents b7e70ca 312103d36 files · +351 −119Browse files

Showing the changes to kernel (5 of 36 files). Show all

Unified · Split

5 files
  1. kernel/audit.c +16 −11
  2. kernel/audit.h +6 −0
  3. kernel/auditfilter.c +25 −8
  4. kernel/auditsc.c +100 −33
  5. kernel/seccomp.c +2 −2
kernel/audit.c+16−11
@@ -182,7 +182,7 @@ struct audit_buffer { · 181 unmodified lines
182182
183183 struct audit_reply {
184184 __u32 portid;
185− struct net *net;
185+ struct net *net;
186186 struct sk_buff *skb;
187187 };
188188
@@ -396,7 +396,7 @@ static void audit_printk_skb(struct sk_buff *skb) · 207 unmodified lines
396396 if (printk_ratelimit())
397397 pr_notice("type=%d %s\n", nlh->nlmsg_type, data);
398398 else
399− audit_log_lost("printk limit exceeded\n");
399+ audit_log_lost("printk limit exceeded");
400400 }
401401
402402 audit_hold_skb(skb);
@@ -412,7 +412,7 @@ static void kauditd_send_skb(struct sk_buff *skb) · 9 unmodified lines
412412 BUG_ON(err != -ECONNREFUSED); /* Shouldn't happen */
413413 if (audit_pid) {
414414 pr_err("*NO* daemon at audit_pid=%d\n", audit_pid);
415− audit_log_lost("auditd disappeared\n");
415+ audit_log_lost("auditd disappeared");
416416 audit_pid = 0;
417417 audit_sock = NULL;
418418 }
@@ -607,7 +607,7 @@ static int audit_netlink_ok(struct sk_buff *skb, u16 msg_type) · 188 unmodified lines
607607 {
608608 int err = 0;
609609
610− /* Only support the initial namespaces for now. */
610+ /* Only support initial user namespace for now. */
611611 /*
612612 * We return ECONNREFUSED because it tricks userspace into thinking
613613 * that audit was not configured into the kernel. Lots of users
@@ -618,8 +618,7 @@ static int audit_netlink_ok(struct sk_buff *skb, u16 msg_type) · 4 unmodified lines
618618 * userspace will reject all logins. This should be removed when we
619619 * support non init namespaces!!
620620 */
621− if ((current_user_ns() != &init_user_ns) ||
622− (task_active_pid_ns(current) != &init_pid_ns))
621+ if (current_user_ns() != &init_user_ns)
623622 return -ECONNREFUSED;
624623
625624 switch (msg_type) {
@@ -639,6 +638,11 @@ static int audit_netlink_ok(struct sk_buff *skb, u16 msg_type) · 13 unmodified lines
639638 case AUDIT_TTY_SET:
640639 case AUDIT_TRIM:
641640 case AUDIT_MAKE_EQUIV:
641+ /* Only support auditd and auditctl in initial pid namespace
642+ * for now. */
643+ if ((task_active_pid_ns(current) != &init_pid_ns))
644+ return -EPERM;
645+
642646 if (!capable(CAP_AUDIT_CONTROL))
643647 err = -EPERM;
644648 break;
@@ -659,6 +663,7 @@ static int audit_log_common_recv_msg(struct audit_buffer **ab, u16 msg_type) · 14 unmodified lines
659663 {
660664 int rc = 0;
661665 uid_t uid = from_kuid(&init_user_ns, current_uid());
666+ pid_t pid = task_tgid_nr(current);
662667
663668 if (!audit_enabled && msg_type != AUDIT_USER_AVC) {
664669 *ab = NULL;
@@ -668,7 +673,7 @@ static int audit_log_common_recv_msg(struct audit_buffer **ab, u16 msg_type) · 3 unmodified lines
668673 *ab = audit_log_start(NULL, GFP_KERNEL, msg_type);
669674 if (unlikely(!*ab))
670675 return rc;
671− audit_log_format(*ab, "pid=%d uid=%u", task_tgid_vnr(current), uid);
676+ audit_log_format(*ab, "pid=%d uid=%u", pid, uid);
672677 audit_log_session_info(*ab);
673678 audit_log_task_context(*ab);
674679
@@ -1097,7 +1102,7 @@ static void __net_exit audit_net_exit(struct net *net) · 422 unmodified lines
10971102 audit_sock = NULL;
10981103 }
10991104
1100− rcu_assign_pointer(aunet->nlsk, NULL);
1105+ RCU_INIT_POINTER(aunet->nlsk, NULL);
11011106 synchronize_net();
11021107 netlink_kernel_release(sock);
11031108 }
@@ -1829,11 +1834,11 @@ void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk) · 725 unmodified lines
18291834 spin_unlock_irq(&tsk->sighand->siglock);
18301835
18311836 audit_log_format(ab,
1832− " ppid=%ld pid=%d auid=%u uid=%u gid=%u"
1837+ " ppid=%d pid=%d auid=%u uid=%u gid=%u"
18331838 " euid=%u suid=%u fsuid=%u"
18341839 " egid=%u sgid=%u fsgid=%u tty=%s ses=%u",
1835− sys_getppid(),
1836− tsk->pid,
1840+ task_ppid_nr(tsk),
1841+ task_pid_nr(tsk),
18371842 from_kuid(&init_user_ns, audit_get_loginuid(tsk)),
18381843 from_kuid(&init_user_ns, cred->uid),
18391844 from_kgid(&init_user_ns, cred->gid),
kernel/audit.h+6−0
@@ -106,6 +106,11 @@ struct audit_names { · 105 unmodified lines
106106 bool should_free;
107107 };
108108
109+struct audit_proctitle {
110+ int len; /* length of the cmdline field. */
111+ char *value; /* the cmdline field */
112+};
113+
109114 /* The per-task audit context. */
110115 struct audit_context {
111116 int dummy; /* must be the first element */
@@ -202,6 +207,7 @@ struct audit_context { · 90 unmodified lines
202207 } execve;
203208 };
204209 int fds[2];
210+ struct audit_proctitle proctitle;
205211
206212 #if AUDIT_DEBUG
207213 int put_count;
kernel/auditfilter.c+25−8
@@ -19,6 +19,8 @@ · 18 unmodified lines
1919 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2020 */
2121
22+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
23+
2224 #include <linux/kernel.h>
2325 #include <linux/audit.h>
2426 #include <linux/kthread.h>
@@ -226,7 +228,7 @@ static int audit_match_signal(struct audit_entry *entry) · 201 unmodified lines
226228 #endif
227229
228230 /* Common user-space to kernel rule translation. */
229−static inline struct audit_entry *audit_to_entry_common(struct audit_rule *rule)
231+static inline struct audit_entry *audit_to_entry_common(struct audit_rule_data *rule)
230232 {
231233 unsigned listnr;
232234 struct audit_entry *entry;
@@ -249,7 +251,7 @@ static inline struct audit_entry *audit_to_entry_common(struct audit_rule *rule) · 16 unmodified lines
249251 ;
250252 }
251253 if (unlikely(rule->action == AUDIT_POSSIBLE)) {
252− printk(KERN_ERR "AUDIT_POSSIBLE is deprecated\n");
254+ pr_err("AUDIT_POSSIBLE is deprecated\n");
253255 goto exit_err;
254256 }
255257 if (rule->action != AUDIT_NEVER && rule->action != AUDIT_ALWAYS)
@@ -403,7 +405,7 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data, · 147 unmodified lines
403405 int i;
404406 char *str;
405407
406− entry = audit_to_entry_common((struct audit_rule *)data);
408+ entry = audit_to_entry_common(data);
407409 if (IS_ERR(entry))
408410 goto exit_nofree;
409411
@@ -431,6 +433,19 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data, · 21 unmodified lines
431433 f->val = 0;
432434 }
433435
436+ if ((f->type == AUDIT_PID) || (f->type == AUDIT_PPID)) {
437+ struct pid *pid;
438+ rcu_read_lock();
439+ pid = find_vpid(f->val);
440+ if (!pid) {
441+ rcu_read_unlock();
442+ err = -ESRCH;
443+ goto exit_free;
444+ }
445+ f->val = pid_nr(pid);
446+ rcu_read_unlock();
447+ }
448+
434449 err = audit_field_valid(entry, f);
435450 if (err)
436451 goto exit_free;
@@ -479,8 +494,8 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data, · 42 unmodified lines
479494 /* Keep currently invalid fields around in case they
480495 * become valid after a policy reload. */
481496 if (err == -EINVAL) {
482− printk(KERN_WARNING "audit rule for LSM "
483− "\'%s\' is invalid\n", str);
497+ pr_warn("audit rule for LSM \'%s\' is invalid\n",
498+ str);
484499 err = 0;
485500 }
486501 if (err) {
@@ -709,8 +724,8 @@ static inline int audit_dupe_lsm_field(struct audit_field *df, · 222 unmodified lines
709724 /* Keep currently invalid fields around in case they
710725 * become valid after a policy reload. */
711726 if (ret == -EINVAL) {
712− printk(KERN_WARNING "audit rule for LSM \'%s\' is "
713− "invalid\n", df->lsm_str);
727+ pr_warn("audit rule for LSM \'%s\' is invalid\n",
728+ df->lsm_str);
714729 ret = 0;
715730 }
716731
@@ -1240,12 +1255,14 @@ static int audit_filter_user_rules(struct audit_krule *rule, int type, · 523 unmodified lines
12401255
12411256 for (i = 0; i < rule->field_count; i++) {
12421257 struct audit_field *f = &rule->fields[i];
1258+ pid_t pid;
12431259 int result = 0;
12441260 u32 sid;
12451261
12461262 switch (f->type) {
12471263 case AUDIT_PID:
1248− result = audit_comparator(task_pid_vnr(current), f->op, f->val);
1264+ pid = task_pid_nr(current);
1265+ result = audit_comparator(pid, f->op, f->val);
12491266 break;
12501267 case AUDIT_UID:
12511268 result = audit_uid_comparator(current_uid(), f->op, f->uid);
kernel/auditsc.c+100−33
@@ -42,6 +42,8 @@ · 41 unmodified lines
4242 * and <dustin.kirkland@us.ibm.com> for LSPP certification compliance.
4343 */
4444
45+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
46+
4547 #include <linux/init.h>
4648 #include <asm/types.h>
4749 #include <linux/atomic.h>
@@ -68,6 +70,7 @@ · 20 unmodified lines
6870 #include <linux/capability.h>
6971 #include <linux/fs_struct.h>
7072 #include <linux/compat.h>
73+#include <linux/ctype.h>
7174
7275 #include "audit.h"
7376
@@ -79,6 +82,9 @@ · 5 unmodified lines
7982 /* no execve audit message should be longer than this (userspace limits) */
8083 #define MAX_EXECVE_AUDIT_LEN 7500
8184
85+/* max length to print of cmdline/proctitle value during audit */
86+#define MAX_PROCTITLE_AUDIT_LEN 128
87+
8288 /* number of audit rules */
8389 int audit_n_rules;
8490
@@ -451,15 +457,17 @@ static int audit_filter_rules(struct task_struct *tsk, · 366 unmodified lines
451457 struct audit_field *f = &rule->fields[i];
452458 struct audit_names *n;
453459 int result = 0;
460+ pid_t pid;
454461
455462 switch (f->type) {
456463 case AUDIT_PID:
457− result = audit_comparator(tsk->pid, f->op, f->val);
464+ pid = task_pid_nr(tsk);
465+ result = audit_comparator(pid, f->op, f->val);
458466 break;
459467 case AUDIT_PPID:
460468 if (ctx) {
461469 if (!ctx->ppid)
462− ctx->ppid = sys_getppid();
470+ ctx->ppid = task_ppid_nr(tsk);
463471 result = audit_comparator(ctx->ppid, f->op, f->val);
464472 }
465473 break;
@@ -805,7 +813,8 @@ void audit_filter_inodes(struct task_struct *tsk, struct audit_context *ctx) · 339 unmodified lines
805813 rcu_read_unlock();
806814 }
807815
808−static inline struct audit_context *audit_get_context(struct task_struct *tsk,
816+/* Transfer the audit context pointer to the caller, clearing it in the tsk's struct */
817+static inline struct audit_context *audit_take_context(struct task_struct *tsk,
809818 int return_valid,
810819 long return_code)
811820 {
@@ -842,6 +851,13 @@ static inline struct audit_context *audit_get_context(struct task_struct *tsk, · 30 unmodified lines
842851 return context;
843852 }
844853
854+static inline void audit_proctitle_free(struct audit_context *context)
855+{
856+ kfree(context->proctitle.value);
857+ context->proctitle.value = NULL;
858+ context->proctitle.len = 0;
859+}
860+
845861 static inline void audit_free_names(struct audit_context *context)
846862 {
847863 struct audit_names *n, *next;
@@ -850,16 +866,15 @@ static inline void audit_free_names(struct audit_context *context) · 2 unmodified lines
850866 if (context->put_count + context->ino_count != context->name_count) {
851867 int i = 0;
852868
853− printk(KERN_ERR "%s:%d(:%d): major=%d in_syscall=%d"
854− " name_count=%d put_count=%d"
855− " ino_count=%d [NOT freeing]\n",
856− __FILE__, __LINE__,
869+ pr_err("%s:%d(:%d): major=%d in_syscall=%d"
870+ " name_count=%d put_count=%d ino_count=%d"
871+ " [NOT freeing]\n", __FILE__, __LINE__,
857872 context->serial, context->major, context->in_syscall,
858873 context->name_count, context->put_count,
859874 context->ino_count);
860875 list_for_each_entry(n, &context->names_list, list) {
861− printk(KERN_ERR "names[%d] = %p = %s\n", i++,
862− n->name, n->name->name ?: "(null)");
876+ pr_err("names[%d] = %p = %s\n", i++, n->name,
877+ n->name->name ?: "(null)");
863878 }
864879 dump_stack();
865880 return;
@@ -955,6 +970,7 @@ static inline void audit_free_context(struct audit_context *context) · 89 unmodified lines
955970 audit_free_aux(context);
956971 kfree(context->filterkey);
957972 kfree(context->sockaddr);
973+ audit_proctitle_free(context);
958974 kfree(context);
959975 }
960976
@@ -1157,7 +1173,7 @@ static void audit_log_execve_info(struct audit_context *context, · 196 unmodified lines
11571173 */
11581174 buf = kmalloc(MAX_EXECVE_AUDIT_LEN + 1, GFP_KERNEL);
11591175 if (!buf) {
1160− audit_panic("out of memory for argv string\n");
1176+ audit_panic("out of memory for argv string");
11611177 return;
11621178 }
11631179
@@ -1271,6 +1287,59 @@ static void show_special(struct audit_context *context, int *call_panic) · 107 unmodified lines
12711287 audit_log_end(ab);
12721288 }
12731289
1290+static inline int audit_proctitle_rtrim(char *proctitle, int len)
1291+{
1292+ char *end = proctitle + len - 1;
1293+ while (end > proctitle && !isprint(*end))
1294+ end--;
1295+
1296+ /* catch the case where proctitle is only 1 non-print character */
1297+ len = end - proctitle + 1;
1298+ len -= isprint(proctitle[len-1]) == 0;
1299+ return len;
1300+}
1301+
1302+static void audit_log_proctitle(struct task_struct *tsk,
1303+ struct audit_context *context)
1304+{
1305+ int res;
1306+ char *buf;
1307+ char *msg = "(null)";
1308+ int len = strlen(msg);
1309+ struct audit_buffer *ab;
1310+
1311+ ab = audit_log_start(context, GFP_KERNEL, AUDIT_PROCTITLE);
1312+ if (!ab)
1313+ return; /* audit_panic or being filtered */
1314+
1315+ audit_log_format(ab, "proctitle=");
1316+
1317+ /* Not cached */
1318+ if (!context->proctitle.value) {
1319+ buf = kmalloc(MAX_PROCTITLE_AUDIT_LEN, GFP_KERNEL);
1320+ if (!buf)
1321+ goto out;
1322+ /* Historically called this from procfs naming */
1323+ res = get_cmdline(tsk, buf, MAX_PROCTITLE_AUDIT_LEN);
1324+ if (res == 0) {
1325+ kfree(buf);
1326+ goto out;
1327+ }
1328+ res = audit_proctitle_rtrim(buf, res);
1329+ if (res == 0) {
1330+ kfree(buf);
1331+ goto out;
1332+ }
1333+ context->proctitle.value = buf;
1334+ context->proctitle.len = res;
1335+ }
1336+ msg = context->proctitle.value;
1337+ len = context->proctitle.len;
1338+out:
1339+ audit_log_n_untrustedstring(ab, msg, len);
1340+ audit_log_end(ab);
1341+}
1342+
12741343 static void audit_log_exit(struct audit_context *context, struct task_struct *tsk)
12751344 {
12761345 int i, call_panic = 0;
@@ -1388,6 +1457,8 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts · 111 unmodified lines
13881457 audit_log_name(context, n, NULL, i++, &call_panic);
13891458 }
13901459
1460+ audit_log_proctitle(tsk, context);
1461+
13911462 /* Send end of event record to help user space know we are finished */
13921463 ab = audit_log_start(context, GFP_KERNEL, AUDIT_EOE);
13931464 if (ab)
@@ -1406,7 +1477,7 @@ void __audit_free(struct task_struct *tsk) · 12 unmodified lines
14061477 {
14071478 struct audit_context *context;
14081479
1409− context = audit_get_context(tsk, 0, 0);
1480+ context = audit_take_context(tsk, 0, 0);
14101481 if (!context)
14111482 return;
14121483
@@ -1500,7 +1571,7 @@ void __audit_syscall_exit(int success, long return_code) · 87 unmodified lines
15001571 else
15011572 success = AUDITSC_FAILURE;
15021573
1503− context = audit_get_context(tsk, success, return_code);
1574+ context = audit_take_context(tsk, success, return_code);
15041575 if (!context)
15051576 return;
15061577
@@ -1550,7 +1621,7 @@ static inline void handle_one(const struct inode *inode) · 43 unmodified lines
15501621 if (likely(put_tree_ref(context, chunk)))
15511622 return;
15521623 if (unlikely(!grow_tree_refs(context))) {
1553− printk(KERN_WARNING "out of memory, audit has lost a tree reference\n");
1624+ pr_warn("out of memory, audit has lost a tree reference\n");
15541625 audit_set_auditable(context);
15551626 audit_put_chunk(chunk);
15561627 unroll_tree_refs(context, p, count);
@@ -1609,8 +1680,7 @@ retry: · 52 unmodified lines
16091680 goto retry;
16101681 }
16111682 /* too bad */
1612− printk(KERN_WARNING
1613− "out of memory, audit has lost a tree reference\n");
1683+ pr_warn("out of memory, audit has lost a tree reference\n");
16141684 unroll_tree_refs(context, p, count);
16151685 audit_set_auditable(context);
16161686 return;
@@ -1682,7 +1752,7 @@ void __audit_getname(struct filename *name) · 65 unmodified lines
16821752
16831753 if (!context->in_syscall) {
16841754 #if AUDIT_DEBUG == 2
1685− printk(KERN_ERR "%s:%d(:%d): ignoring getname(%p)\n",
1755+ pr_err("%s:%d(:%d): ignoring getname(%p)\n",
16861756 __FILE__, __LINE__, context->serial, name);
16871757 dump_stack();
16881758 #endif
@@ -1721,15 +1791,15 @@ void audit_putname(struct filename *name) · 32 unmodified lines
17211791 BUG_ON(!context);
17221792 if (!name->aname || !context->in_syscall) {
17231793 #if AUDIT_DEBUG == 2
1724− printk(KERN_ERR "%s:%d(:%d): final_putname(%p)\n",
1794+ pr_err("%s:%d(:%d): final_putname(%p)\n",
17251795 __FILE__, __LINE__, context->serial, name);
17261796 if (context->name_count) {
17271797 struct audit_names *n;
17281798 int i = 0;
17291799
17301800 list_for_each_entry(n, &context->names_list, list)
1731− printk(KERN_ERR "name[%d] = %p = %s\n", i++,
1732− n->name, n->name->name ?: "(null)");
1801+ pr_err("name[%d] = %p = %s\n", i++, n->name,
1802+ n->name->name ?: "(null)");
17331803 }
17341804 #endif
17351805 final_putname(name);
@@ -1738,9 +1808,8 @@ void audit_putname(struct filename *name) · 2 unmodified lines
17381808 else {
17391809 ++context->put_count;
17401810 if (context->put_count > context->name_count) {
1741− printk(KERN_ERR "%s:%d(:%d): major=%d"
1742− " in_syscall=%d putname(%p) name_count=%d"
1743− " put_count=%d\n",
1811+ pr_err("%s:%d(:%d): major=%d in_syscall=%d putname(%p)"
1812+ " name_count=%d put_count=%d\n",
17441813 __FILE__, __LINE__,
17451814 context->serial, context->major,
17461815 context->in_syscall, name->name,
@@ -1981,12 +2050,10 @@ static void audit_log_set_loginuid(kuid_t koldloginuid, kuid_t kloginuid, · 234 unmodified lines
19812050 ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_LOGIN);
19822051 if (!ab)
19832052 return;
1984− audit_log_format(ab, "pid=%d uid=%u"
1985− " old-auid=%u new-auid=%u old-ses=%u new-ses=%u"
1986− " res=%d",
1987− current->pid, uid,
1988− oldloginuid, loginuid, oldsessionid, sessionid,
1989− !rc);
2053+ audit_log_format(ab, "pid=%d uid=%u", task_pid_nr(current), uid);
2054+ audit_log_task_context(ab);
2055+ audit_log_format(ab, " old-auid=%u auid=%u old-ses=%u ses=%u res=%d",
2056+ oldloginuid, loginuid, oldsessionid, sessionid, !rc);
19902057 audit_log_end(ab);
19912058 }
19922059
@@ -2208,7 +2275,7 @@ void __audit_ptrace(struct task_struct *t) · 215 unmodified lines
22082275 {
22092276 struct audit_context *context = current->audit_context;
22102277
2211− context->target_pid = t->pid;
2278+ context->target_pid = task_pid_nr(t);
22122279 context->target_auid = audit_get_loginuid(t);
22132280 context->target_uid = task_uid(t);
22142281 context->target_sessionid = audit_get_sessionid(t);
@@ -2233,7 +2300,7 @@ int __audit_signal_info(int sig, struct task_struct *t) · 18 unmodified lines
22332300
22342301 if (audit_pid && t->tgid == audit_pid) {
22352302 if (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1 || sig == SIGUSR2) {
2236− audit_sig_pid = tsk->pid;
2303+ audit_sig_pid = task_pid_nr(tsk);
22372304 if (uid_valid(tsk->loginuid))
22382305 audit_sig_uid = tsk->loginuid;
22392306 else
@@ -2247,7 +2314,7 @@ int __audit_signal_info(int sig, struct task_struct *t) · 7 unmodified lines
22472314 /* optimize the common case by putting first signal recipient directly
22482315 * in audit_context */
22492316 if (!ctx->target_pid) {
2250− ctx->target_pid = t->tgid;
2317+ ctx->target_pid = task_tgid_nr(t);
22512318 ctx->target_auid = audit_get_loginuid(t);
22522319 ctx->target_uid = t_uid;
22532320 ctx->target_sessionid = audit_get_sessionid(t);
@@ -2268,7 +2335,7 @@ int __audit_signal_info(int sig, struct task_struct *t) · 14 unmodified lines
22682335 }
22692336 BUG_ON(axp->pid_count >= AUDIT_AUX_PIDS);
22702337
2271− axp->target_pid[axp->pid_count] = t->tgid;
2338+ axp->target_pid[axp->pid_count] = task_tgid_nr(t);
22722339 axp->target_auid[axp->pid_count] = audit_get_loginuid(t);
22732340 axp->target_uid[axp->pid_count] = t_uid;
22742341 axp->target_sessionid[axp->pid_count] = audit_get_sessionid(t);
@@ -2368,7 +2435,7 @@ static void audit_log_task(struct audit_buffer *ab) · 93 unmodified lines
23682435 from_kgid(&init_user_ns, gid),
23692436 sessionid);
23702437 audit_log_task_context(ab);
2371− audit_log_format(ab, " pid=%d comm=", current->pid);
2438+ audit_log_format(ab, " pid=%d comm=", task_pid_nr(current));
23722439 audit_log_untrustedstring(ab, current->comm);
23732440 if (mm) {
23742441 down_read(&mm->mmap_sem);
kernel/seccomp.c+2−2
@@ -71,7 +71,7 @@ static void populate_seccomp_data(struct seccomp_data *sd) · 70 unmodified lines
7171 struct pt_regs *regs = task_pt_regs(task);
7272
7373 sd->nr = syscall_get_nr(task, regs);
74− sd->arch = syscall_get_arch(task, regs);
74+ sd->arch = syscall_get_arch();
7575
7676 /* Unroll syscall_get_args to help gcc on arm. */
7777 syscall_get_arguments(task, regs, 0, 1, (unsigned long *) &sd->args[0]);
@@ -348,7 +348,7 @@ static void seccomp_send_sigsys(int syscall, int reason) · 270 unmodified lines
348348 info.si_code = SYS_SECCOMP;
349349 info.si_call_addr = (void __user *)KSTK_EIP(current);
350350 info.si_errno = reason;
351− info.si_arch = syscall_get_arch(current, task_pt_regs(current));
351+ info.si_arch = syscall_get_arch();
352352 info.si_syscall = syscall;
353353 force_sig_info(SIGSYS, &info, current);
354354 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t