diff options
| -rw-r--r-- | drivers/tty/tty_audit.c | 14 | ||||
| -rw-r--r-- | fs/proc/base.c | 12 | ||||
| -rw-r--r-- | include/linux/audit.h | 6 | ||||
| -rw-r--r-- | include/linux/init_task.h | 2 | ||||
| -rw-r--r-- | include/linux/sched.h | 2 | ||||
| -rw-r--r-- | include/linux/tty.h | 4 | ||||
| -rw-r--r-- | include/net/netlabel.h | 2 | ||||
| -rw-r--r-- | include/net/xfrm.h | 23 | ||||
| -rw-r--r-- | kernel/audit.c | 20 | ||||
| -rw-r--r-- | kernel/audit_watch.c | 2 | ||||
| -rw-r--r-- | kernel/auditfilter.c | 7 | ||||
| -rw-r--r-- | kernel/auditsc.c | 20 | ||||
| -rw-r--r-- | net/core/dev.c | 2 | ||||
| -rw-r--r-- | net/netlabel/netlabel_unlabeled.c | 2 | ||||
| -rw-r--r-- | net/netlabel/netlabel_user.c | 2 | ||||
| -rw-r--r-- | net/xfrm/xfrm_policy.c | 8 | ||||
| -rw-r--r-- | net/xfrm/xfrm_state.c | 6 | ||||
| -rw-r--r-- | net/xfrm/xfrm_user.c | 12 |
18 files changed, 80 insertions, 66 deletions
diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c index 7c5866920622..5b59bd7f4227 100644 --- a/drivers/tty/tty_audit.c +++ b/drivers/tty/tty_audit.c | |||
| @@ -61,7 +61,7 @@ static void tty_audit_buf_put(struct tty_audit_buf *buf) | |||
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | static void tty_audit_log(const char *description, struct task_struct *tsk, | 63 | static void tty_audit_log(const char *description, struct task_struct *tsk, |
| 64 | uid_t loginuid, unsigned sessionid, int major, | 64 | kuid_t loginuid, unsigned sessionid, int major, |
| 65 | int minor, unsigned char *data, size_t size) | 65 | int minor, unsigned char *data, size_t size) |
| 66 | { | 66 | { |
| 67 | struct audit_buffer *ab; | 67 | struct audit_buffer *ab; |
| @@ -73,7 +73,9 @@ static void tty_audit_log(const char *description, struct task_struct *tsk, | |||
| 73 | 73 | ||
| 74 | audit_log_format(ab, "%s pid=%u uid=%u auid=%u ses=%u " | 74 | audit_log_format(ab, "%s pid=%u uid=%u auid=%u ses=%u " |
| 75 | "major=%d minor=%d comm=", description, | 75 | "major=%d minor=%d comm=", description, |
| 76 | tsk->pid, uid, loginuid, sessionid, | 76 | tsk->pid, uid, |
| 77 | from_kuid(&init_user_ns, loginuid), | ||
| 78 | sessionid, | ||
| 77 | major, minor); | 79 | major, minor); |
| 78 | get_task_comm(name, tsk); | 80 | get_task_comm(name, tsk); |
| 79 | audit_log_untrustedstring(ab, name); | 81 | audit_log_untrustedstring(ab, name); |
| @@ -89,7 +91,7 @@ static void tty_audit_log(const char *description, struct task_struct *tsk, | |||
| 89 | * Generate an audit message from the contents of @buf, which is owned by | 91 | * Generate an audit message from the contents of @buf, which is owned by |
| 90 | * @tsk with @loginuid. @buf->mutex must be locked. | 92 | * @tsk with @loginuid. @buf->mutex must be locked. |
| 91 | */ | 93 | */ |
| 92 | static void tty_audit_buf_push(struct task_struct *tsk, uid_t loginuid, | 94 | static void tty_audit_buf_push(struct task_struct *tsk, kuid_t loginuid, |
| 93 | unsigned int sessionid, | 95 | unsigned int sessionid, |
| 94 | struct tty_audit_buf *buf) | 96 | struct tty_audit_buf *buf) |
| 95 | { | 97 | { |
| @@ -112,7 +114,7 @@ static void tty_audit_buf_push(struct task_struct *tsk, uid_t loginuid, | |||
| 112 | */ | 114 | */ |
| 113 | static void tty_audit_buf_push_current(struct tty_audit_buf *buf) | 115 | static void tty_audit_buf_push_current(struct tty_audit_buf *buf) |
| 114 | { | 116 | { |
| 115 | uid_t auid = audit_get_loginuid(current); | 117 | kuid_t auid = audit_get_loginuid(current); |
| 116 | unsigned int sessionid = audit_get_sessionid(current); | 118 | unsigned int sessionid = audit_get_sessionid(current); |
| 117 | tty_audit_buf_push(current, auid, sessionid, buf); | 119 | tty_audit_buf_push(current, auid, sessionid, buf); |
| 118 | } | 120 | } |
| @@ -179,7 +181,7 @@ void tty_audit_tiocsti(struct tty_struct *tty, char ch) | |||
| 179 | } | 181 | } |
| 180 | 182 | ||
| 181 | if (should_audit && audit_enabled) { | 183 | if (should_audit && audit_enabled) { |
| 182 | uid_t auid; | 184 | kuid_t auid; |
| 183 | unsigned int sessionid; | 185 | unsigned int sessionid; |
| 184 | 186 | ||
| 185 | auid = audit_get_loginuid(current); | 187 | auid = audit_get_loginuid(current); |
| @@ -199,7 +201,7 @@ void tty_audit_tiocsti(struct tty_struct *tty, char ch) | |||
| 199 | * reference to the tty audit buffer if available. | 201 | * reference to the tty audit buffer if available. |
| 200 | * Flush the buffer or return an appropriate error code. | 202 | * Flush the buffer or return an appropriate error code. |
| 201 | */ | 203 | */ |
| 202 | int tty_audit_push_task(struct task_struct *tsk, uid_t loginuid, u32 sessionid) | 204 | int tty_audit_push_task(struct task_struct *tsk, kuid_t loginuid, u32 sessionid) |
| 203 | { | 205 | { |
| 204 | struct tty_audit_buf *buf = ERR_PTR(-EPERM); | 206 | struct tty_audit_buf *buf = ERR_PTR(-EPERM); |
| 205 | unsigned long flags; | 207 | unsigned long flags; |
diff --git a/fs/proc/base.c b/fs/proc/base.c index 1b6c84cbdb73..138cff4b05dd 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
| @@ -1089,7 +1089,8 @@ static ssize_t proc_loginuid_read(struct file * file, char __user * buf, | |||
| 1089 | if (!task) | 1089 | if (!task) |
| 1090 | return -ESRCH; | 1090 | return -ESRCH; |
| 1091 | length = scnprintf(tmpbuf, TMPBUFLEN, "%u", | 1091 | length = scnprintf(tmpbuf, TMPBUFLEN, "%u", |
| 1092 | audit_get_loginuid(task)); | 1092 | from_kuid(file->f_cred->user_ns, |
| 1093 | audit_get_loginuid(task))); | ||
| 1093 | put_task_struct(task); | 1094 | put_task_struct(task); |
| 1094 | return simple_read_from_buffer(buf, count, ppos, tmpbuf, length); | 1095 | return simple_read_from_buffer(buf, count, ppos, tmpbuf, length); |
| 1095 | } | 1096 | } |
| @@ -1101,6 +1102,7 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf, | |||
| 1101 | char *page, *tmp; | 1102 | char *page, *tmp; |
| 1102 | ssize_t length; | 1103 | ssize_t length; |
| 1103 | uid_t loginuid; | 1104 | uid_t loginuid; |
| 1105 | kuid_t kloginuid; | ||
| 1104 | 1106 | ||
| 1105 | rcu_read_lock(); | 1107 | rcu_read_lock(); |
| 1106 | if (current != pid_task(proc_pid(inode), PIDTYPE_PID)) { | 1108 | if (current != pid_task(proc_pid(inode), PIDTYPE_PID)) { |
| @@ -1130,7 +1132,13 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf, | |||
| 1130 | goto out_free_page; | 1132 | goto out_free_page; |
| 1131 | 1133 | ||
| 1132 | } | 1134 | } |
| 1133 | length = audit_set_loginuid(loginuid); | 1135 | kloginuid = make_kuid(file->f_cred->user_ns, loginuid); |
| 1136 | if (!uid_valid(kloginuid)) { | ||
| 1137 | length = -EINVAL; | ||
| 1138 | goto out_free_page; | ||
| 1139 | } | ||
| 1140 | |||
| 1141 | length = audit_set_loginuid(kloginuid); | ||
| 1134 | if (likely(length == 0)) | 1142 | if (likely(length == 0)) |
| 1135 | length = count; | 1143 | length = count; |
| 1136 | 1144 | ||
diff --git a/include/linux/audit.h b/include/linux/audit.h index ca019bb74da3..12367cbadfe1 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -527,7 +527,7 @@ static inline void audit_ptrace(struct task_struct *t) | |||
| 527 | extern unsigned int audit_serial(void); | 527 | extern unsigned int audit_serial(void); |
| 528 | extern int auditsc_get_stamp(struct audit_context *ctx, | 528 | extern int auditsc_get_stamp(struct audit_context *ctx, |
| 529 | struct timespec *t, unsigned int *serial); | 529 | struct timespec *t, unsigned int *serial); |
| 530 | extern int audit_set_loginuid(uid_t loginuid); | 530 | extern int audit_set_loginuid(kuid_t loginuid); |
| 531 | #define audit_get_loginuid(t) ((t)->loginuid) | 531 | #define audit_get_loginuid(t) ((t)->loginuid) |
| 532 | #define audit_get_sessionid(t) ((t)->sessionid) | 532 | #define audit_get_sessionid(t) ((t)->sessionid) |
| 533 | extern void audit_log_task_context(struct audit_buffer *ab); | 533 | extern void audit_log_task_context(struct audit_buffer *ab); |
| @@ -639,7 +639,7 @@ extern int audit_signals; | |||
| 639 | #define audit_core_dumps(i) do { ; } while (0) | 639 | #define audit_core_dumps(i) do { ; } while (0) |
| 640 | #define audit_seccomp(i,s,c) do { ; } while (0) | 640 | #define audit_seccomp(i,s,c) do { ; } while (0) |
| 641 | #define auditsc_get_stamp(c,t,s) (0) | 641 | #define auditsc_get_stamp(c,t,s) (0) |
| 642 | #define audit_get_loginuid(t) (-1) | 642 | #define audit_get_loginuid(t) (INVALID_UID) |
| 643 | #define audit_get_sessionid(t) (-1) | 643 | #define audit_get_sessionid(t) (-1) |
| 644 | #define audit_log_task_context(b) do { ; } while (0) | 644 | #define audit_log_task_context(b) do { ; } while (0) |
| 645 | #define audit_ipc_obj(i) ((void)0) | 645 | #define audit_ipc_obj(i) ((void)0) |
| @@ -705,7 +705,7 @@ extern int audit_update_lsm_rules(void); | |||
| 705 | extern int audit_filter_user(void); | 705 | extern int audit_filter_user(void); |
| 706 | extern int audit_filter_type(int type); | 706 | extern int audit_filter_type(int type); |
| 707 | extern int audit_receive_filter(int type, int pid, int seq, | 707 | extern int audit_receive_filter(int type, int pid, int seq, |
| 708 | void *data, size_t datasz, uid_t loginuid, | 708 | void *data, size_t datasz, kuid_t loginuid, |
| 709 | u32 sessionid, u32 sid); | 709 | u32 sessionid, u32 sid); |
| 710 | extern int audit_enabled; | 710 | extern int audit_enabled; |
| 711 | #else | 711 | #else |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 89f1cb1056f0..6d087c5f57f7 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
| @@ -92,7 +92,7 @@ extern struct group_info init_groups; | |||
| 92 | 92 | ||
| 93 | #ifdef CONFIG_AUDITSYSCALL | 93 | #ifdef CONFIG_AUDITSYSCALL |
| 94 | #define INIT_IDS \ | 94 | #define INIT_IDS \ |
| 95 | .loginuid = -1, \ | 95 | .loginuid = INVALID_UID, \ |
| 96 | .sessionid = -1, | 96 | .sessionid = -1, |
| 97 | #else | 97 | #else |
| 98 | #define INIT_IDS | 98 | #define INIT_IDS |
diff --git a/include/linux/sched.h b/include/linux/sched.h index c147e7024f11..f64d092f2bed 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1426,7 +1426,7 @@ struct task_struct { | |||
| 1426 | 1426 | ||
| 1427 | struct audit_context *audit_context; | 1427 | struct audit_context *audit_context; |
| 1428 | #ifdef CONFIG_AUDITSYSCALL | 1428 | #ifdef CONFIG_AUDITSYSCALL |
| 1429 | uid_t loginuid; | 1429 | kuid_t loginuid; |
| 1430 | unsigned int sessionid; | 1430 | unsigned int sessionid; |
| 1431 | #endif | 1431 | #endif |
| 1432 | struct seccomp seccomp; | 1432 | struct seccomp seccomp; |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 9f47ab540f65..7298385815e6 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -553,7 +553,7 @@ extern void tty_audit_fork(struct signal_struct *sig); | |||
| 553 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); | 553 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); |
| 554 | extern void tty_audit_push(struct tty_struct *tty); | 554 | extern void tty_audit_push(struct tty_struct *tty); |
| 555 | extern int tty_audit_push_task(struct task_struct *tsk, | 555 | extern int tty_audit_push_task(struct task_struct *tsk, |
| 556 | uid_t loginuid, u32 sessionid); | 556 | kuid_t loginuid, u32 sessionid); |
| 557 | #else | 557 | #else |
| 558 | static inline void tty_audit_add_data(struct tty_struct *tty, | 558 | static inline void tty_audit_add_data(struct tty_struct *tty, |
| 559 | unsigned char *data, size_t size) | 559 | unsigned char *data, size_t size) |
| @@ -572,7 +572,7 @@ static inline void tty_audit_push(struct tty_struct *tty) | |||
| 572 | { | 572 | { |
| 573 | } | 573 | } |
| 574 | static inline int tty_audit_push_task(struct task_struct *tsk, | 574 | static inline int tty_audit_push_task(struct task_struct *tsk, |
| 575 | uid_t loginuid, u32 sessionid) | 575 | kuid_t loginuid, u32 sessionid) |
| 576 | { | 576 | { |
| 577 | return 0; | 577 | return 0; |
| 578 | } | 578 | } |
diff --git a/include/net/netlabel.h b/include/net/netlabel.h index f67440970d7e..2c95d55f7914 100644 --- a/include/net/netlabel.h +++ b/include/net/netlabel.h | |||
| @@ -110,7 +110,7 @@ struct cipso_v4_doi; | |||
| 110 | /* NetLabel audit information */ | 110 | /* NetLabel audit information */ |
| 111 | struct netlbl_audit { | 111 | struct netlbl_audit { |
| 112 | u32 secid; | 112 | u32 secid; |
| 113 | uid_t loginuid; | 113 | kuid_t loginuid; |
| 114 | u32 sessionid; | 114 | u32 sessionid; |
| 115 | }; | 115 | }; |
| 116 | 116 | ||
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index d9509eb29b80..1f217e2c5d82 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -662,7 +662,7 @@ struct xfrm_spi_skb_cb { | |||
| 662 | /* Audit Information */ | 662 | /* Audit Information */ |
| 663 | struct xfrm_audit { | 663 | struct xfrm_audit { |
| 664 | u32 secid; | 664 | u32 secid; |
| 665 | uid_t loginuid; | 665 | kuid_t loginuid; |
| 666 | u32 sessionid; | 666 | u32 sessionid; |
| 667 | }; | 667 | }; |
| 668 | 668 | ||
| @@ -681,13 +681,14 @@ static inline struct audit_buffer *xfrm_audit_start(const char *op) | |||
| 681 | return audit_buf; | 681 | return audit_buf; |
| 682 | } | 682 | } |
| 683 | 683 | ||
| 684 | static inline void xfrm_audit_helper_usrinfo(uid_t auid, u32 ses, u32 secid, | 684 | static inline void xfrm_audit_helper_usrinfo(kuid_t auid, u32 ses, u32 secid, |
| 685 | struct audit_buffer *audit_buf) | 685 | struct audit_buffer *audit_buf) |
| 686 | { | 686 | { |
| 687 | char *secctx; | 687 | char *secctx; |
| 688 | u32 secctx_len; | 688 | u32 secctx_len; |
| 689 | 689 | ||
| 690 | audit_log_format(audit_buf, " auid=%u ses=%u", auid, ses); | 690 | audit_log_format(audit_buf, " auid=%u ses=%u", |
| 691 | from_kuid(&init_user_ns, auid), ses); | ||
| 691 | if (secid != 0 && | 692 | if (secid != 0 && |
| 692 | security_secid_to_secctx(secid, &secctx, &secctx_len) == 0) { | 693 | security_secid_to_secctx(secid, &secctx, &secctx_len) == 0) { |
| 693 | audit_log_format(audit_buf, " subj=%s", secctx); | 694 | audit_log_format(audit_buf, " subj=%s", secctx); |
| @@ -697,13 +698,13 @@ static inline void xfrm_audit_helper_usrinfo(uid_t auid, u32 ses, u32 secid, | |||
| 697 | } | 698 | } |
| 698 | 699 | ||
| 699 | extern void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, | 700 | extern void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, |
| 700 | u32 auid, u32 ses, u32 secid); | 701 | kuid_t auid, u32 ses, u32 secid); |
| 701 | extern void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, | 702 | extern void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, |
| 702 | u32 auid, u32 ses, u32 secid); | 703 | kuid_t auid, u32 ses, u32 secid); |
| 703 | extern void xfrm_audit_state_add(struct xfrm_state *x, int result, | 704 | extern void xfrm_audit_state_add(struct xfrm_state *x, int result, |
| 704 | u32 auid, u32 ses, u32 secid); | 705 | kuid_t auid, u32 ses, u32 secid); |
| 705 | extern void xfrm_audit_state_delete(struct xfrm_state *x, int result, | 706 | extern void xfrm_audit_state_delete(struct xfrm_state *x, int result, |
| 706 | u32 auid, u32 ses, u32 secid); | 707 | kuid_t auid, u32 ses, u32 secid); |
| 707 | extern void xfrm_audit_state_replay_overflow(struct xfrm_state *x, | 708 | extern void xfrm_audit_state_replay_overflow(struct xfrm_state *x, |
| 708 | struct sk_buff *skb); | 709 | struct sk_buff *skb); |
| 709 | extern void xfrm_audit_state_replay(struct xfrm_state *x, | 710 | extern void xfrm_audit_state_replay(struct xfrm_state *x, |
| @@ -716,22 +717,22 @@ extern void xfrm_audit_state_icvfail(struct xfrm_state *x, | |||
| 716 | #else | 717 | #else |
| 717 | 718 | ||
| 718 | static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, | 719 | static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, |
| 719 | u32 auid, u32 ses, u32 secid) | 720 | kuid_t auid, u32 ses, u32 secid) |
| 720 | { | 721 | { |
| 721 | } | 722 | } |
| 722 | 723 | ||
| 723 | static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, | 724 | static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, |
| 724 | u32 auid, u32 ses, u32 secid) | 725 | kuid_t auid, u32 ses, u32 secid) |
| 725 | { | 726 | { |
| 726 | } | 727 | } |
| 727 | 728 | ||
| 728 | static inline void xfrm_audit_state_add(struct xfrm_state *x, int result, | 729 | static inline void xfrm_audit_state_add(struct xfrm_state *x, int result, |
| 729 | u32 auid, u32 ses, u32 secid) | 730 | kuid_t auid, u32 ses, u32 secid) |
| 730 | { | 731 | { |
| 731 | } | 732 | } |
| 732 | 733 | ||
| 733 | static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result, | 734 | static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result, |
| 734 | u32 auid, u32 ses, u32 secid) | 735 | kuid_t auid, u32 ses, u32 secid) |
| 735 | { | 736 | { |
| 736 | } | 737 | } |
| 737 | 738 | ||
diff --git a/kernel/audit.c b/kernel/audit.c index 2e0dd5edf69b..44a4b13c9f00 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
| @@ -265,7 +265,7 @@ void audit_log_lost(const char *message) | |||
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | static int audit_log_config_change(char *function_name, int new, int old, | 267 | static int audit_log_config_change(char *function_name, int new, int old, |
| 268 | uid_t loginuid, u32 sessionid, u32 sid, | 268 | kuid_t loginuid, u32 sessionid, u32 sid, |
| 269 | int allow_changes) | 269 | int allow_changes) |
| 270 | { | 270 | { |
| 271 | struct audit_buffer *ab; | 271 | struct audit_buffer *ab; |
| @@ -273,7 +273,7 @@ static int audit_log_config_change(char *function_name, int new, int old, | |||
| 273 | 273 | ||
| 274 | ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE); | 274 | ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE); |
| 275 | audit_log_format(ab, "%s=%d old=%d auid=%u ses=%u", function_name, new, | 275 | audit_log_format(ab, "%s=%d old=%d auid=%u ses=%u", function_name, new, |
| 276 | old, loginuid, sessionid); | 276 | old, from_kuid(&init_user_ns, loginuid), sessionid); |
| 277 | if (sid) { | 277 | if (sid) { |
| 278 | char *ctx = NULL; | 278 | char *ctx = NULL; |
| 279 | u32 len; | 279 | u32 len; |
| @@ -293,7 +293,7 @@ static int audit_log_config_change(char *function_name, int new, int old, | |||
| 293 | } | 293 | } |
| 294 | 294 | ||
| 295 | static int audit_do_config_change(char *function_name, int *to_change, | 295 | static int audit_do_config_change(char *function_name, int *to_change, |
| 296 | int new, uid_t loginuid, u32 sessionid, | 296 | int new, kuid_t loginuid, u32 sessionid, |
| 297 | u32 sid) | 297 | u32 sid) |
| 298 | { | 298 | { |
| 299 | int allow_changes, rc = 0, old = *to_change; | 299 | int allow_changes, rc = 0, old = *to_change; |
| @@ -320,21 +320,21 @@ static int audit_do_config_change(char *function_name, int *to_change, | |||
| 320 | return rc; | 320 | return rc; |
| 321 | } | 321 | } |
| 322 | 322 | ||
| 323 | static int audit_set_rate_limit(int limit, uid_t loginuid, u32 sessionid, | 323 | static int audit_set_rate_limit(int limit, kuid_t loginuid, u32 sessionid, |
| 324 | u32 sid) | 324 | u32 sid) |
| 325 | { | 325 | { |
| 326 | return audit_do_config_change("audit_rate_limit", &audit_rate_limit, | 326 | return audit_do_config_change("audit_rate_limit", &audit_rate_limit, |
| 327 | limit, loginuid, sessionid, sid); | 327 | limit, loginuid, sessionid, sid); |
| 328 | } | 328 | } |
| 329 | 329 | ||
| 330 | static int audit_set_backlog_limit(int limit, uid_t loginuid, u32 sessionid, | 330 | static int audit_set_backlog_limit(int limit, kuid_t loginuid, u32 sessionid, |
| 331 | u32 sid) | 331 | u32 sid) |
| 332 | { | 332 | { |
| 333 | return audit_do_config_change("audit_backlog_limit", &audit_backlog_limit, | 333 | return audit_do_config_change("audit_backlog_limit", &audit_backlog_limit, |
| 334 | limit, loginuid, sessionid, sid); | 334 | limit, loginuid, sessionid, sid); |
| 335 | } | 335 | } |
| 336 | 336 | ||
| 337 | static int audit_set_enabled(int state, uid_t loginuid, u32 sessionid, u32 sid) | 337 | static int audit_set_enabled(int state, kuid_t loginuid, u32 sessionid, u32 sid) |
| 338 | { | 338 | { |
| 339 | int rc; | 339 | int rc; |
| 340 | if (state < AUDIT_OFF || state > AUDIT_LOCKED) | 340 | if (state < AUDIT_OFF || state > AUDIT_LOCKED) |
| @@ -349,7 +349,7 @@ static int audit_set_enabled(int state, uid_t loginuid, u32 sessionid, u32 sid) | |||
| 349 | return rc; | 349 | return rc; |
| 350 | } | 350 | } |
| 351 | 351 | ||
| 352 | static int audit_set_failure(int state, uid_t loginuid, u32 sessionid, u32 sid) | 352 | static int audit_set_failure(int state, kuid_t loginuid, u32 sessionid, u32 sid) |
| 353 | { | 353 | { |
| 354 | if (state != AUDIT_FAIL_SILENT | 354 | if (state != AUDIT_FAIL_SILENT |
| 355 | && state != AUDIT_FAIL_PRINTK | 355 | && state != AUDIT_FAIL_PRINTK |
| @@ -607,7 +607,7 @@ static int audit_netlink_ok(struct sk_buff *skb, u16 msg_type) | |||
| 607 | } | 607 | } |
| 608 | 608 | ||
| 609 | static int audit_log_common_recv_msg(struct audit_buffer **ab, u16 msg_type, | 609 | static int audit_log_common_recv_msg(struct audit_buffer **ab, u16 msg_type, |
| 610 | uid_t auid, u32 ses, u32 sid) | 610 | kuid_t auid, u32 ses, u32 sid) |
| 611 | { | 611 | { |
| 612 | int rc = 0; | 612 | int rc = 0; |
| 613 | char *ctx = NULL; | 613 | char *ctx = NULL; |
| @@ -622,7 +622,7 @@ static int audit_log_common_recv_msg(struct audit_buffer **ab, u16 msg_type, | |||
| 622 | audit_log_format(*ab, "pid=%d uid=%u auid=%u ses=%u", | 622 | audit_log_format(*ab, "pid=%d uid=%u auid=%u ses=%u", |
| 623 | task_tgid_vnr(current), | 623 | task_tgid_vnr(current), |
| 624 | from_kuid(&init_user_ns, current_uid()), | 624 | from_kuid(&init_user_ns, current_uid()), |
| 625 | auid, ses); | 625 | from_kuid(&init_user_ns, auid), ses); |
| 626 | if (sid) { | 626 | if (sid) { |
| 627 | rc = security_secid_to_secctx(sid, &ctx, &len); | 627 | rc = security_secid_to_secctx(sid, &ctx, &len); |
| 628 | if (rc) | 628 | if (rc) |
| @@ -644,7 +644,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
| 644 | int err; | 644 | int err; |
| 645 | struct audit_buffer *ab; | 645 | struct audit_buffer *ab; |
| 646 | u16 msg_type = nlh->nlmsg_type; | 646 | u16 msg_type = nlh->nlmsg_type; |
| 647 | uid_t loginuid; /* loginuid of sender */ | 647 | kuid_t loginuid; /* loginuid of sender */ |
| 648 | u32 sessionid; | 648 | u32 sessionid; |
| 649 | struct audit_sig_info *sig_data; | 649 | struct audit_sig_info *sig_data; |
| 650 | char *ctx = NULL; | 650 | char *ctx = NULL; |
diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c index 3823281401b5..1c22ec3d87bc 100644 --- a/kernel/audit_watch.c +++ b/kernel/audit_watch.c | |||
| @@ -241,7 +241,7 @@ static void audit_watch_log_rule_change(struct audit_krule *r, struct audit_watc | |||
| 241 | struct audit_buffer *ab; | 241 | struct audit_buffer *ab; |
| 242 | ab = audit_log_start(NULL, GFP_NOFS, AUDIT_CONFIG_CHANGE); | 242 | ab = audit_log_start(NULL, GFP_NOFS, AUDIT_CONFIG_CHANGE); |
| 243 | audit_log_format(ab, "auid=%u ses=%u op=", | 243 | audit_log_format(ab, "auid=%u ses=%u op=", |
| 244 | audit_get_loginuid(current), | 244 | from_kuid(&init_user_ns, audit_get_loginuid(current)), |
| 245 | audit_get_sessionid(current)); | 245 | audit_get_sessionid(current)); |
| 246 | audit_log_string(ab, op); | 246 | audit_log_string(ab, op); |
| 247 | audit_log_format(ab, " path="); | 247 | audit_log_format(ab, " path="); |
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index b30320cea26f..c4bcdbaf4d4d 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c | |||
| @@ -1109,7 +1109,7 @@ static void audit_list_rules(int pid, int seq, struct sk_buff_head *q) | |||
| 1109 | } | 1109 | } |
| 1110 | 1110 | ||
| 1111 | /* Log rule additions and removals */ | 1111 | /* Log rule additions and removals */ |
| 1112 | static void audit_log_rule_change(uid_t loginuid, u32 sessionid, u32 sid, | 1112 | static void audit_log_rule_change(kuid_t loginuid, u32 sessionid, u32 sid, |
| 1113 | char *action, struct audit_krule *rule, | 1113 | char *action, struct audit_krule *rule, |
| 1114 | int res) | 1114 | int res) |
| 1115 | { | 1115 | { |
| @@ -1121,7 +1121,8 @@ static void audit_log_rule_change(uid_t loginuid, u32 sessionid, u32 sid, | |||
| 1121 | ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE); | 1121 | ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE); |
| 1122 | if (!ab) | 1122 | if (!ab) |
| 1123 | return; | 1123 | return; |
| 1124 | audit_log_format(ab, "auid=%u ses=%u", loginuid, sessionid); | 1124 | audit_log_format(ab, "auid=%u ses=%u", |
| 1125 | from_kuid(&init_user_ns, loginuid), sessionid); | ||
| 1125 | if (sid) { | 1126 | if (sid) { |
| 1126 | char *ctx = NULL; | 1127 | char *ctx = NULL; |
| 1127 | u32 len; | 1128 | u32 len; |
| @@ -1152,7 +1153,7 @@ static void audit_log_rule_change(uid_t loginuid, u32 sessionid, u32 sid, | |||
| 1152 | * @sid: SE Linux Security ID of sender | 1153 | * @sid: SE Linux Security ID of sender |
| 1153 | */ | 1154 | */ |
| 1154 | int audit_receive_filter(int type, int pid, int seq, void *data, | 1155 | int audit_receive_filter(int type, int pid, int seq, void *data, |
| 1155 | size_t datasz, uid_t loginuid, u32 sessionid, u32 sid) | 1156 | size_t datasz, kuid_t loginuid, u32 sessionid, u32 sid) |
| 1156 | { | 1157 | { |
| 1157 | struct task_struct *tsk; | 1158 | struct task_struct *tsk; |
| 1158 | struct audit_netlink_list *dest; | 1159 | struct audit_netlink_list *dest; |
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 0b5b8a232b55..26fdfc092e35 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
| @@ -149,7 +149,7 @@ struct audit_aux_data_execve { | |||
| 149 | struct audit_aux_data_pids { | 149 | struct audit_aux_data_pids { |
| 150 | struct audit_aux_data d; | 150 | struct audit_aux_data d; |
| 151 | pid_t target_pid[AUDIT_AUX_PIDS]; | 151 | pid_t target_pid[AUDIT_AUX_PIDS]; |
| 152 | uid_t target_auid[AUDIT_AUX_PIDS]; | 152 | kuid_t target_auid[AUDIT_AUX_PIDS]; |
| 153 | uid_t target_uid[AUDIT_AUX_PIDS]; | 153 | uid_t target_uid[AUDIT_AUX_PIDS]; |
| 154 | unsigned int target_sessionid[AUDIT_AUX_PIDS]; | 154 | unsigned int target_sessionid[AUDIT_AUX_PIDS]; |
| 155 | u32 target_sid[AUDIT_AUX_PIDS]; | 155 | u32 target_sid[AUDIT_AUX_PIDS]; |
| @@ -214,7 +214,7 @@ struct audit_context { | |||
| 214 | int arch; | 214 | int arch; |
| 215 | 215 | ||
| 216 | pid_t target_pid; | 216 | pid_t target_pid; |
| 217 | uid_t target_auid; | 217 | kuid_t target_auid; |
| 218 | uid_t target_uid; | 218 | uid_t target_uid; |
| 219 | unsigned int target_sessionid; | 219 | unsigned int target_sessionid; |
| 220 | u32 target_sid; | 220 | u32 target_sid; |
| @@ -1176,7 +1176,7 @@ static void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk | |||
| 1176 | } | 1176 | } |
| 1177 | 1177 | ||
| 1178 | static int audit_log_pid_context(struct audit_context *context, pid_t pid, | 1178 | static int audit_log_pid_context(struct audit_context *context, pid_t pid, |
| 1179 | uid_t auid, uid_t uid, unsigned int sessionid, | 1179 | kuid_t auid, uid_t uid, unsigned int sessionid, |
| 1180 | u32 sid, char *comm) | 1180 | u32 sid, char *comm) |
| 1181 | { | 1181 | { |
| 1182 | struct audit_buffer *ab; | 1182 | struct audit_buffer *ab; |
| @@ -1188,7 +1188,8 @@ static int audit_log_pid_context(struct audit_context *context, pid_t pid, | |||
| 1188 | if (!ab) | 1188 | if (!ab) |
| 1189 | return rc; | 1189 | return rc; |
| 1190 | 1190 | ||
| 1191 | audit_log_format(ab, "opid=%d oauid=%d ouid=%d oses=%d", pid, auid, | 1191 | audit_log_format(ab, "opid=%d oauid=%d ouid=%d oses=%d", pid, |
| 1192 | from_kuid(&init_user_ns, auid), | ||
| 1192 | uid, sessionid); | 1193 | uid, sessionid); |
| 1193 | if (security_secid_to_secctx(sid, &ctx, &len)) { | 1194 | if (security_secid_to_secctx(sid, &ctx, &len)) { |
| 1194 | audit_log_format(ab, " obj=(none)"); | 1195 | audit_log_format(ab, " obj=(none)"); |
| @@ -1630,7 +1631,7 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts | |||
| 1630 | context->name_count, | 1631 | context->name_count, |
| 1631 | context->ppid, | 1632 | context->ppid, |
| 1632 | context->pid, | 1633 | context->pid, |
| 1633 | tsk->loginuid, | 1634 | from_kuid(&init_user_ns, tsk->loginuid), |
| 1634 | context->uid, | 1635 | context->uid, |
| 1635 | context->gid, | 1636 | context->gid, |
| 1636 | context->euid, context->suid, context->fsuid, | 1637 | context->euid, context->suid, context->fsuid, |
| @@ -2291,14 +2292,14 @@ static atomic_t session_id = ATOMIC_INIT(0); | |||
| 2291 | * | 2292 | * |
| 2292 | * Called (set) from fs/proc/base.c::proc_loginuid_write(). | 2293 | * Called (set) from fs/proc/base.c::proc_loginuid_write(). |
| 2293 | */ | 2294 | */ |
| 2294 | int audit_set_loginuid(uid_t loginuid) | 2295 | int audit_set_loginuid(kuid_t loginuid) |
| 2295 | { | 2296 | { |
| 2296 | struct task_struct *task = current; | 2297 | struct task_struct *task = current; |
| 2297 | struct audit_context *context = task->audit_context; | 2298 | struct audit_context *context = task->audit_context; |
| 2298 | unsigned int sessionid; | 2299 | unsigned int sessionid; |
| 2299 | 2300 | ||
| 2300 | #ifdef CONFIG_AUDIT_LOGINUID_IMMUTABLE | 2301 | #ifdef CONFIG_AUDIT_LOGINUID_IMMUTABLE |
| 2301 | if (task->loginuid != -1) | 2302 | if (uid_valid(task->loginuid)) |
| 2302 | return -EPERM; | 2303 | return -EPERM; |
| 2303 | #else /* CONFIG_AUDIT_LOGINUID_IMMUTABLE */ | 2304 | #else /* CONFIG_AUDIT_LOGINUID_IMMUTABLE */ |
| 2304 | if (!capable(CAP_AUDIT_CONTROL)) | 2305 | if (!capable(CAP_AUDIT_CONTROL)) |
| @@ -2315,7 +2316,8 @@ int audit_set_loginuid(uid_t loginuid) | |||
| 2315 | "old auid=%u new auid=%u" | 2316 | "old auid=%u new auid=%u" |
| 2316 | " old ses=%u new ses=%u", | 2317 | " old ses=%u new ses=%u", |
| 2317 | task->pid, task_uid(task), | 2318 | task->pid, task_uid(task), |
| 2318 | task->loginuid, loginuid, | 2319 | from_kuid(&init_user_ns, task->loginuid), |
| 2320 | from_kuid(&init_user_ns, loginuid), | ||
| 2319 | task->sessionid, sessionid); | 2321 | task->sessionid, sessionid); |
| 2320 | audit_log_end(ab); | 2322 | audit_log_end(ab); |
| 2321 | } | 2323 | } |
| @@ -2543,7 +2545,7 @@ int __audit_signal_info(int sig, struct task_struct *t) | |||
| 2543 | if (audit_pid && t->tgid == audit_pid) { | 2545 | if (audit_pid && t->tgid == audit_pid) { |
| 2544 | if (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1 || sig == SIGUSR2) { | 2546 | if (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1 || sig == SIGUSR2) { |
| 2545 | audit_sig_pid = tsk->pid; | 2547 | audit_sig_pid = tsk->pid; |
| 2546 | if (tsk->loginuid != -1) | 2548 | if (uid_valid(tsk->loginuid)) |
| 2547 | audit_sig_uid = tsk->loginuid; | 2549 | audit_sig_uid = tsk->loginuid; |
| 2548 | else | 2550 | else |
| 2549 | audit_sig_uid = uid; | 2551 | audit_sig_uid = uid; |
diff --git a/net/core/dev.c b/net/core/dev.c index 026bb4a37665..1c0d0823a5a4 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -4524,7 +4524,7 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc) | |||
| 4524 | "dev=%s prom=%d old_prom=%d auid=%u uid=%u gid=%u ses=%u", | 4524 | "dev=%s prom=%d old_prom=%d auid=%u uid=%u gid=%u ses=%u", |
| 4525 | dev->name, (dev->flags & IFF_PROMISC), | 4525 | dev->name, (dev->flags & IFF_PROMISC), |
| 4526 | (old_flags & IFF_PROMISC), | 4526 | (old_flags & IFF_PROMISC), |
| 4527 | audit_get_loginuid(current), | 4527 | from_kuid(&init_user_ns, audit_get_loginuid(current)), |
| 4528 | from_kuid(&init_user_ns, uid), | 4528 | from_kuid(&init_user_ns, uid), |
| 4529 | from_kgid(&init_user_ns, gid), | 4529 | from_kgid(&init_user_ns, gid), |
| 4530 | audit_get_sessionid(current)); | 4530 | audit_get_sessionid(current)); |
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index e7ff694f1049..729a345c75a4 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
| @@ -1541,7 +1541,7 @@ int __init netlbl_unlabel_defconf(void) | |||
| 1541 | * it is called is at bootup before the audit subsystem is reporting | 1541 | * it is called is at bootup before the audit subsystem is reporting |
| 1542 | * messages so don't worry to much about these values. */ | 1542 | * messages so don't worry to much about these values. */ |
| 1543 | security_task_getsecid(current, &audit_info.secid); | 1543 | security_task_getsecid(current, &audit_info.secid); |
| 1544 | audit_info.loginuid = 0; | 1544 | audit_info.loginuid = GLOBAL_ROOT_UID; |
| 1545 | audit_info.sessionid = 0; | 1545 | audit_info.sessionid = 0; |
| 1546 | 1546 | ||
| 1547 | entry = kzalloc(sizeof(*entry), GFP_KERNEL); | 1547 | entry = kzalloc(sizeof(*entry), GFP_KERNEL); |
diff --git a/net/netlabel/netlabel_user.c b/net/netlabel/netlabel_user.c index 9fae63f10298..9650c4ad5f88 100644 --- a/net/netlabel/netlabel_user.c +++ b/net/netlabel/netlabel_user.c | |||
| @@ -109,7 +109,7 @@ struct audit_buffer *netlbl_audit_start_common(int type, | |||
| 109 | return NULL; | 109 | return NULL; |
| 110 | 110 | ||
| 111 | audit_log_format(audit_buf, "netlabel: auid=%u ses=%u", | 111 | audit_log_format(audit_buf, "netlabel: auid=%u ses=%u", |
| 112 | audit_info->loginuid, | 112 | from_kuid(&init_user_ns, audit_info->loginuid), |
| 113 | audit_info->sessionid); | 113 | audit_info->sessionid); |
| 114 | 114 | ||
| 115 | if (audit_info->secid != 0 && | 115 | if (audit_info->secid != 0 && |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index c5a5165a5927..2f475151cea1 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
| @@ -2630,12 +2630,12 @@ static void xfrm_policy_fini(struct net *net) | |||
| 2630 | 2630 | ||
| 2631 | flush_work(&net->xfrm.policy_hash_work); | 2631 | flush_work(&net->xfrm.policy_hash_work); |
| 2632 | #ifdef CONFIG_XFRM_SUB_POLICY | 2632 | #ifdef CONFIG_XFRM_SUB_POLICY |
| 2633 | audit_info.loginuid = -1; | 2633 | audit_info.loginuid = INVALID_UID; |
| 2634 | audit_info.sessionid = -1; | 2634 | audit_info.sessionid = -1; |
| 2635 | audit_info.secid = 0; | 2635 | audit_info.secid = 0; |
| 2636 | xfrm_policy_flush(net, XFRM_POLICY_TYPE_SUB, &audit_info); | 2636 | xfrm_policy_flush(net, XFRM_POLICY_TYPE_SUB, &audit_info); |
| 2637 | #endif | 2637 | #endif |
| 2638 | audit_info.loginuid = -1; | 2638 | audit_info.loginuid = INVALID_UID; |
| 2639 | audit_info.sessionid = -1; | 2639 | audit_info.sessionid = -1; |
| 2640 | audit_info.secid = 0; | 2640 | audit_info.secid = 0; |
| 2641 | xfrm_policy_flush(net, XFRM_POLICY_TYPE_MAIN, &audit_info); | 2641 | xfrm_policy_flush(net, XFRM_POLICY_TYPE_MAIN, &audit_info); |
| @@ -2742,7 +2742,7 @@ static void xfrm_audit_common_policyinfo(struct xfrm_policy *xp, | |||
| 2742 | } | 2742 | } |
| 2743 | 2743 | ||
| 2744 | void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, | 2744 | void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, |
| 2745 | uid_t auid, u32 sessionid, u32 secid) | 2745 | kuid_t auid, u32 sessionid, u32 secid) |
| 2746 | { | 2746 | { |
| 2747 | struct audit_buffer *audit_buf; | 2747 | struct audit_buffer *audit_buf; |
| 2748 | 2748 | ||
| @@ -2757,7 +2757,7 @@ void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, | |||
| 2757 | EXPORT_SYMBOL_GPL(xfrm_audit_policy_add); | 2757 | EXPORT_SYMBOL_GPL(xfrm_audit_policy_add); |
| 2758 | 2758 | ||
| 2759 | void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, | 2759 | void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, |
| 2760 | uid_t auid, u32 sessionid, u32 secid) | 2760 | kuid_t auid, u32 sessionid, u32 secid) |
| 2761 | { | 2761 | { |
| 2762 | struct audit_buffer *audit_buf; | 2762 | struct audit_buffer *audit_buf; |
| 2763 | 2763 | ||
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 5b228f97d4b3..fce6a49bc7c6 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
| @@ -2045,7 +2045,7 @@ void xfrm_state_fini(struct net *net) | |||
| 2045 | unsigned int sz; | 2045 | unsigned int sz; |
| 2046 | 2046 | ||
| 2047 | flush_work(&net->xfrm.state_hash_work); | 2047 | flush_work(&net->xfrm.state_hash_work); |
| 2048 | audit_info.loginuid = -1; | 2048 | audit_info.loginuid = INVALID_UID; |
| 2049 | audit_info.sessionid = -1; | 2049 | audit_info.sessionid = -1; |
| 2050 | audit_info.secid = 0; | 2050 | audit_info.secid = 0; |
| 2051 | xfrm_state_flush(net, IPSEC_PROTO_ANY, &audit_info); | 2051 | xfrm_state_flush(net, IPSEC_PROTO_ANY, &audit_info); |
| @@ -2112,7 +2112,7 @@ static void xfrm_audit_helper_pktinfo(struct sk_buff *skb, u16 family, | |||
| 2112 | } | 2112 | } |
| 2113 | 2113 | ||
| 2114 | void xfrm_audit_state_add(struct xfrm_state *x, int result, | 2114 | void xfrm_audit_state_add(struct xfrm_state *x, int result, |
| 2115 | uid_t auid, u32 sessionid, u32 secid) | 2115 | kuid_t auid, u32 sessionid, u32 secid) |
| 2116 | { | 2116 | { |
| 2117 | struct audit_buffer *audit_buf; | 2117 | struct audit_buffer *audit_buf; |
| 2118 | 2118 | ||
| @@ -2127,7 +2127,7 @@ void xfrm_audit_state_add(struct xfrm_state *x, int result, | |||
| 2127 | EXPORT_SYMBOL_GPL(xfrm_audit_state_add); | 2127 | EXPORT_SYMBOL_GPL(xfrm_audit_state_add); |
| 2128 | 2128 | ||
| 2129 | void xfrm_audit_state_delete(struct xfrm_state *x, int result, | 2129 | void xfrm_audit_state_delete(struct xfrm_state *x, int result, |
| 2130 | uid_t auid, u32 sessionid, u32 secid) | 2130 | kuid_t auid, u32 sessionid, u32 secid) |
| 2131 | { | 2131 | { |
| 2132 | struct audit_buffer *audit_buf; | 2132 | struct audit_buffer *audit_buf; |
| 2133 | 2133 | ||
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index e75d8e47f35c..9ea55db737b4 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
| @@ -575,7 +575,7 @@ static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 575 | struct xfrm_state *x; | 575 | struct xfrm_state *x; |
| 576 | int err; | 576 | int err; |
| 577 | struct km_event c; | 577 | struct km_event c; |
| 578 | uid_t loginuid = audit_get_loginuid(current); | 578 | kuid_t loginuid = audit_get_loginuid(current); |
| 579 | u32 sessionid = audit_get_sessionid(current); | 579 | u32 sessionid = audit_get_sessionid(current); |
| 580 | u32 sid; | 580 | u32 sid; |
| 581 | 581 | ||
| @@ -654,7 +654,7 @@ static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 654 | int err = -ESRCH; | 654 | int err = -ESRCH; |
| 655 | struct km_event c; | 655 | struct km_event c; |
| 656 | struct xfrm_usersa_id *p = nlmsg_data(nlh); | 656 | struct xfrm_usersa_id *p = nlmsg_data(nlh); |
| 657 | uid_t loginuid = audit_get_loginuid(current); | 657 | kuid_t loginuid = audit_get_loginuid(current); |
| 658 | u32 sessionid = audit_get_sessionid(current); | 658 | u32 sessionid = audit_get_sessionid(current); |
| 659 | u32 sid; | 659 | u32 sid; |
| 660 | 660 | ||
| @@ -1369,7 +1369,7 @@ static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 1369 | struct km_event c; | 1369 | struct km_event c; |
| 1370 | int err; | 1370 | int err; |
| 1371 | int excl; | 1371 | int excl; |
| 1372 | uid_t loginuid = audit_get_loginuid(current); | 1372 | kuid_t loginuid = audit_get_loginuid(current); |
| 1373 | u32 sessionid = audit_get_sessionid(current); | 1373 | u32 sessionid = audit_get_sessionid(current); |
| 1374 | u32 sid; | 1374 | u32 sid; |
| 1375 | 1375 | ||
| @@ -1624,7 +1624,7 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 1624 | NETLINK_CB(skb).pid); | 1624 | NETLINK_CB(skb).pid); |
| 1625 | } | 1625 | } |
| 1626 | } else { | 1626 | } else { |
| 1627 | uid_t loginuid = audit_get_loginuid(current); | 1627 | kuid_t loginuid = audit_get_loginuid(current); |
| 1628 | u32 sessionid = audit_get_sessionid(current); | 1628 | u32 sessionid = audit_get_sessionid(current); |
| 1629 | u32 sid; | 1629 | u32 sid; |
| 1630 | 1630 | ||
| @@ -1918,7 +1918,7 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 1918 | 1918 | ||
| 1919 | err = 0; | 1919 | err = 0; |
| 1920 | if (up->hard) { | 1920 | if (up->hard) { |
| 1921 | uid_t loginuid = audit_get_loginuid(current); | 1921 | kuid_t loginuid = audit_get_loginuid(current); |
| 1922 | u32 sessionid = audit_get_sessionid(current); | 1922 | u32 sessionid = audit_get_sessionid(current); |
| 1923 | u32 sid; | 1923 | u32 sid; |
| 1924 | 1924 | ||
| @@ -1961,7 +1961,7 @@ static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 1961 | km_state_expired(x, ue->hard, current->pid); | 1961 | km_state_expired(x, ue->hard, current->pid); |
| 1962 | 1962 | ||
| 1963 | if (ue->hard) { | 1963 | if (ue->hard) { |
| 1964 | uid_t loginuid = audit_get_loginuid(current); | 1964 | kuid_t loginuid = audit_get_loginuid(current); |
| 1965 | u32 sessionid = audit_get_sessionid(current); | 1965 | u32 sessionid = audit_get_sessionid(current); |
| 1966 | u32 sid; | 1966 | u32 sid; |
| 1967 | 1967 | ||
