diff options
| author | Paul Moore <pmoore@redhat.com> | 2014-01-28 14:44:16 -0500 |
|---|---|---|
| committer | Paul Moore <pmoore@redhat.com> | 2014-02-05 10:39:48 -0500 |
| commit | 825e587af2e90e9b953849f3347a01d8f383d577 (patch) | |
| tree | e48942a05882da47544e179c6a0c920e00137a6a /security | |
| parent | 8ed814602876bec9bad2649ca17f34b499357a1c (diff) | |
| parent | d8ec26d7f8287f5788a494f56e8814210f0e64be (diff) | |
Merge tag 'v3.13' into stable-3.14
Linux 3.13
Conflicts:
security/selinux/hooks.c
Trivial merge issue in selinux_inet_conn_request() likely due to me
including patches that I sent to the stable folks in my next tree
resulting in the patch hitting twice (I think). Thankfully it was an
easy fix this time, but regardless, lesson learned, I will not do that
again.
Diffstat (limited to 'security')
54 files changed, 2802 insertions, 1239 deletions
diff --git a/security/Makefile b/security/Makefile index c26c81e92571..a5918e01a4f7 100644 --- a/security/Makefile +++ b/security/Makefile | |||
| @@ -16,7 +16,6 @@ obj-$(CONFIG_MMU) += min_addr.o | |||
| 16 | # Object file lists | 16 | # Object file lists |
| 17 | obj-$(CONFIG_SECURITY) += security.o capability.o | 17 | obj-$(CONFIG_SECURITY) += security.o capability.o |
| 18 | obj-$(CONFIG_SECURITYFS) += inode.o | 18 | obj-$(CONFIG_SECURITYFS) += inode.o |
| 19 | # Must precede capability.o in order to stack properly. | ||
| 20 | obj-$(CONFIG_SECURITY_SELINUX) += selinux/built-in.o | 19 | obj-$(CONFIG_SECURITY_SELINUX) += selinux/built-in.o |
| 21 | obj-$(CONFIG_SECURITY_SMACK) += smack/built-in.o | 20 | obj-$(CONFIG_SECURITY_SMACK) += smack/built-in.o |
| 22 | obj-$(CONFIG_AUDIT) += lsm_audit.o | 21 | obj-$(CONFIG_AUDIT) += lsm_audit.o |
diff --git a/security/apparmor/audit.c b/security/apparmor/audit.c index 031d2d9dd695..89c78658031f 100644 --- a/security/apparmor/audit.c +++ b/security/apparmor/audit.c | |||
| @@ -111,7 +111,6 @@ static const char *const aa_audit_type[] = { | |||
| 111 | static void audit_pre(struct audit_buffer *ab, void *ca) | 111 | static void audit_pre(struct audit_buffer *ab, void *ca) |
| 112 | { | 112 | { |
| 113 | struct common_audit_data *sa = ca; | 113 | struct common_audit_data *sa = ca; |
| 114 | struct task_struct *tsk = sa->aad->tsk ? sa->aad->tsk : current; | ||
| 115 | 114 | ||
| 116 | if (aa_g_audit_header) { | 115 | if (aa_g_audit_header) { |
| 117 | audit_log_format(ab, "apparmor="); | 116 | audit_log_format(ab, "apparmor="); |
| @@ -132,11 +131,6 @@ static void audit_pre(struct audit_buffer *ab, void *ca) | |||
| 132 | 131 | ||
| 133 | if (sa->aad->profile) { | 132 | if (sa->aad->profile) { |
| 134 | struct aa_profile *profile = sa->aad->profile; | 133 | struct aa_profile *profile = sa->aad->profile; |
| 135 | pid_t pid; | ||
| 136 | rcu_read_lock(); | ||
| 137 | pid = rcu_dereference(tsk->real_parent)->pid; | ||
| 138 | rcu_read_unlock(); | ||
| 139 | audit_log_format(ab, " parent=%d", pid); | ||
| 140 | if (profile->ns != root_ns) { | 134 | if (profile->ns != root_ns) { |
| 141 | audit_log_format(ab, " namespace="); | 135 | audit_log_format(ab, " namespace="); |
| 142 | audit_log_untrustedstring(ab, profile->ns->base.hname); | 136 | audit_log_untrustedstring(ab, profile->ns->base.hname); |
| @@ -149,12 +143,6 @@ static void audit_pre(struct audit_buffer *ab, void *ca) | |||
| 149 | audit_log_format(ab, " name="); | 143 | audit_log_format(ab, " name="); |
| 150 | audit_log_untrustedstring(ab, sa->aad->name); | 144 | audit_log_untrustedstring(ab, sa->aad->name); |
| 151 | } | 145 | } |
| 152 | |||
| 153 | if (sa->aad->tsk) { | ||
| 154 | audit_log_format(ab, " pid=%d comm=", tsk->pid); | ||
| 155 | audit_log_untrustedstring(ab, tsk->comm); | ||
| 156 | } | ||
| 157 | |||
| 158 | } | 146 | } |
| 159 | 147 | ||
| 160 | /** | 148 | /** |
| @@ -212,7 +200,7 @@ int aa_audit(int type, struct aa_profile *profile, gfp_t gfp, | |||
| 212 | 200 | ||
| 213 | if (sa->aad->type == AUDIT_APPARMOR_KILL) | 201 | if (sa->aad->type == AUDIT_APPARMOR_KILL) |
| 214 | (void)send_sig_info(SIGKILL, NULL, | 202 | (void)send_sig_info(SIGKILL, NULL, |
| 215 | sa->aad->tsk ? sa->aad->tsk : current); | 203 | sa->u.tsk ? sa->u.tsk : current); |
| 216 | 204 | ||
| 217 | if (sa->aad->type == AUDIT_APPARMOR_ALLOWED) | 205 | if (sa->aad->type == AUDIT_APPARMOR_ALLOWED) |
| 218 | return complain_error(sa->aad->error); | 206 | return complain_error(sa->aad->error); |
diff --git a/security/apparmor/capability.c b/security/apparmor/capability.c index 84d1f5f53877..1101c6f64bb7 100644 --- a/security/apparmor/capability.c +++ b/security/apparmor/capability.c | |||
| @@ -53,8 +53,7 @@ static void audit_cb(struct audit_buffer *ab, void *va) | |||
| 53 | 53 | ||
| 54 | /** | 54 | /** |
| 55 | * audit_caps - audit a capability | 55 | * audit_caps - audit a capability |
| 56 | * @profile: profile confining task (NOT NULL) | 56 | * @profile: profile being tested for confinement (NOT NULL) |
| 57 | * @task: task capability test was performed against (NOT NULL) | ||
| 58 | * @cap: capability tested | 57 | * @cap: capability tested |
| 59 | * @error: error code returned by test | 58 | * @error: error code returned by test |
| 60 | * | 59 | * |
| @@ -63,8 +62,7 @@ static void audit_cb(struct audit_buffer *ab, void *va) | |||
| 63 | * | 62 | * |
| 64 | * Returns: 0 or sa->error on success, error code on failure | 63 | * Returns: 0 or sa->error on success, error code on failure |
| 65 | */ | 64 | */ |
| 66 | static int audit_caps(struct aa_profile *profile, struct task_struct *task, | 65 | static int audit_caps(struct aa_profile *profile, int cap, int error) |
| 67 | int cap, int error) | ||
| 68 | { | 66 | { |
| 69 | struct audit_cache *ent; | 67 | struct audit_cache *ent; |
| 70 | int type = AUDIT_APPARMOR_AUTO; | 68 | int type = AUDIT_APPARMOR_AUTO; |
| @@ -73,7 +71,6 @@ static int audit_caps(struct aa_profile *profile, struct task_struct *task, | |||
| 73 | sa.type = LSM_AUDIT_DATA_CAP; | 71 | sa.type = LSM_AUDIT_DATA_CAP; |
| 74 | sa.aad = &aad; | 72 | sa.aad = &aad; |
| 75 | sa.u.cap = cap; | 73 | sa.u.cap = cap; |
| 76 | sa.aad->tsk = task; | ||
| 77 | sa.aad->op = OP_CAPABLE; | 74 | sa.aad->op = OP_CAPABLE; |
| 78 | sa.aad->error = error; | 75 | sa.aad->error = error; |
| 79 | 76 | ||
| @@ -124,8 +121,7 @@ static int profile_capable(struct aa_profile *profile, int cap) | |||
| 124 | |||
