diff options
| author | Sona Sarmadi <sona.sarmadi@enea.com> | 2015-01-27 14:04:08 +0100 |
|---|---|---|
| committer | Zhenhua Luo <zhenhua.luo@freescale.com> | 2015-02-03 10:06:46 +0800 |
| commit | f4a55466f032850b4ca8c495d76d06d18d77fb00 (patch) | |
| tree | 5e264c4600f87f09756f3613715d9dfc8e941eea | |
| parent | 26303c11e8502a997caee96a4b342fdf084bd4ab (diff) | |
| download | meta-freescale-f4a55466f032850b4ca8c495d76d06d18d77fb00.tar.gz | |
kernel-auditsc: CVE-2014-3917
audit_krule mask accesses need bounds checking
Reference:
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-3917
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
| -rw-r--r-- | meta-fsl-ppc/recipes-kernel/linux/files/auditsc-CVE-2014-3917.patch | 91 | ||||
| -rw-r--r-- | meta-fsl-ppc/recipes-kernel/linux/linux-qoriq_3.12.bb | 1 |
2 files changed, 92 insertions, 0 deletions
diff --git a/meta-fsl-ppc/recipes-kernel/linux/files/auditsc-CVE-2014-3917.patch b/meta-fsl-ppc/recipes-kernel/linux/files/auditsc-CVE-2014-3917.patch new file mode 100644 index 000000000..a0bdc271f --- /dev/null +++ b/meta-fsl-ppc/recipes-kernel/linux/files/auditsc-CVE-2014-3917.patch | |||
| @@ -0,0 +1,91 @@ | |||
| 1 | From 6004b0e5ac2e8e9e1bb0f012dc9242e03cca95df Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Andy Lutomirski <luto@amacapital.net> | ||
| 3 | Date: Wed, 28 May 2014 23:09:58 -0400 | ||
| 4 | Subject: [PATCH] auditsc: audit_krule mask accesses need bounds checking | ||
| 5 | |||
| 6 | commit a3c54931199565930d6d84f4c3456f6440aefd41 upstream. | ||
| 7 | |||
| 8 | Fixes an easy DoS and possible information disclosure. | ||
| 9 | |||
| 10 | This does nothing about the broken state of x32 auditing. | ||
| 11 | |||
| 12 | eparis: If the admin has enabled auditd and has specifically loaded | ||
| 13 | audit rules. This bug has been around since before git. Wow... | ||
| 14 | |||
| 15 | This fixes CVE-2014-3917 | ||
| 16 | Upstream-Status: Backport | ||
| 17 | |||
| 18 | Signed-off-by: Andy Lutomirski <luto@amacapital.net> | ||
| 19 | Signed-off-by: Eric Paris <eparis@redhat.com> | ||
| 20 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
| 21 | Signed-off-by: Jiri Slaby <jslaby@suse.cz> | ||
| 22 | Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com> | ||
| 23 | --- | ||
| 24 | kernel/auditsc.c | 27 ++++++++++++++++++--------- | ||
| 25 | 1 file changed, 18 insertions(+), 9 deletions(-) | ||
| 26 | |||
| 27 | diff --git a/kernel/auditsc.c b/kernel/auditsc.c | ||
| 28 | index 3b79a47..979c00b 100644 | ||
| 29 | --- a/kernel/auditsc.c | ||
| 30 | +++ b/kernel/auditsc.c | ||
| 31 | @@ -733,6 +733,22 @@ static enum audit_state audit_filter_task(struct task_struct *tsk, char **key) | ||
| 32 | return AUDIT_BUILD_CONTEXT; | ||
| 33 | } | ||
| 34 | |||
| 35 | +static int audit_in_mask(const struct audit_krule *rule, unsigned long val) | ||
| 36 | +{ | ||
| 37 | + int word, bit; | ||
| 38 | + | ||
| 39 | + if (val > 0xffffffff) | ||
| 40 | + return false; | ||
| 41 | + | ||
| 42 | + word = AUDIT_WORD(val); | ||
| 43 | + if (word >= AUDIT_BITMASK_SIZE) | ||
| 44 | + return false; | ||
| 45 | + | ||
| 46 | + bit = AUDIT_BIT(val); | ||
| 47 | + | ||
| 48 | + return rule->mask[word] & bit; | ||
| 49 | +} | ||
| 50 | + | ||
| 51 | /* At syscall entry and exit time, this filter is called if the | ||
| 52 | * audit_state is not low enough that auditing cannot take place, but is | ||
| 53 | * also not high enough that we already know we have to write an audit | ||
| 54 | @@ -750,11 +766,8 @@ static enum audit_state audit_filter_syscall(struct task_struct *tsk, | ||
| 55 | |||
| 56 | rcu_read_lock(); | ||
| 57 | if (!list_empty(list)) { | ||
| 58 | - int word = AUDIT_WORD(ctx->major); | ||
| 59 | - int bit = AUDIT_BIT(ctx->major); | ||
| 60 | - | ||
| 61 | list_for_each_entry_rcu(e, list, list) { | ||
| 62 | - if ((e->rule.mask[word] & bit) == bit && | ||
| 63 | + if (audit_in_mask(&e->rule, ctx->major) && | ||
| 64 | audit_filter_rules(tsk, &e->rule, ctx, NULL, | ||
| 65 | &state, false)) { | ||
| 66 | rcu_read_unlock(); | ||
| 67 | @@ -774,20 +787,16 @@ static enum audit_state audit_filter_syscall(struct task_struct *tsk, | ||
| 68 | static int audit_filter_inode_name(struct task_struct *tsk, | ||
| 69 | struct audit_names *n, | ||
| 70 | struct audit_context *ctx) { | ||
| 71 | - int word, bit; | ||
| 72 | int h = audit_hash_ino((u32)n->ino); | ||
| 73 | struct list_head *list = &audit_inode_hash[h]; | ||
| 74 | struct audit_entry *e; | ||
| 75 | enum audit_state state; | ||
| 76 | |||
| 77 | - word = AUDIT_WORD(ctx->major); | ||
| 78 | - bit = AUDIT_BIT(ctx->major); | ||
| 79 | - | ||
| 80 | if (list_empty(list)) | ||
| 81 | return 0; | ||
| 82 | |||
| 83 | list_for_each_entry_rcu(e, list, list) { | ||
| 84 | - if ((e->rule.mask[word] & bit) == bit && | ||
| 85 | + if (audit_in_mask(&e->rule, ctx->major) && | ||
| 86 | audit_filter_rules(tsk, &e->rule, ctx, n, &state, false)) { | ||
| 87 | ctx->current_state = state; | ||
| 88 | return 1; | ||
| 89 | -- | ||
| 90 | 1.9.1 | ||
| 91 | |||
diff --git a/meta-fsl-ppc/recipes-kernel/linux/linux-qoriq_3.12.bb b/meta-fsl-ppc/recipes-kernel/linux/linux-qoriq_3.12.bb index 966563227..bbbf4ba71 100644 --- a/meta-fsl-ppc/recipes-kernel/linux/linux-qoriq_3.12.bb +++ b/meta-fsl-ppc/recipes-kernel/linux/linux-qoriq_3.12.bb | |||
| @@ -22,6 +22,7 @@ SRC_URI = "git://git.freescale.com/ppc/sdk/linux.git;nobranch=1 \ | |||
| 22 | file://0001-net-sctp-CVE-2014-3673.patch \ | 22 | file://0001-net-sctp-CVE-2014-3673.patch \ |
| 23 | file://0002-net-sctp-CVE-2014-3687.patch \ | 23 | file://0002-net-sctp-CVE-2014-3687.patch \ |
| 24 | file://0003-net-sctp-CVE-2014-3688.patch \ | 24 | file://0003-net-sctp-CVE-2014-3688.patch \ |
| 25 | file://auditsc-CVE-2014-3917.patch \ | ||
| 25 | " | 26 | " |
| 26 | SRCREV = "6619b8b55796cdf0cec04b66a71288edd3057229" | 27 | SRCREV = "6619b8b55796cdf0cec04b66a71288edd3057229" |
| 27 | 28 | ||
