summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Li <rongqing.li@windriver.com>2015-04-24 09:36:48 +0800
committerJoe MacDonald <joe_macdonald@mentor.com>2015-05-08 11:06:47 -0400
commitee4a378917850deaa277938dcf140426f0bd0f9a (patch)
tree8845eb9f413d2307f04de90c79dd55ea27cee299
parent9e1d6b48d89b1e00f1d13fb50e76edf296e761b1 (diff)
downloadmeta-openembedded-ee4a378917850deaa277938dcf140426f0bd0f9a.tar.gz
vsftpd: fix the CVE-2015-1419
Taken Patch from fedora to fix CVE-2015-1419, deny_file parsing to do more what is expected. Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-rw-r--r--meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/vsftpd-2.1.0-filter.patch77
-rw-r--r--meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.2.bb1
2 files changed, 78 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/vsftpd-2.1.0-filter.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/vsftpd-2.1.0-filter.patch
new file mode 100644
index 0000000000..32f7e82183
--- /dev/null
+++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/vsftpd-2.1.0-filter.patch
@@ -0,0 +1,77 @@
1Fix the CVE-2015-1419
2
3Upstream-Status: Pending
4
5Try to fix deny_file parsing to do more what is expected. Taken
6from fedora. CVE-2015-1419
7
8ftp://195.220.108.108/linux/fedora/linux/development/rawhide/source/SRPMS/v/vsftpd-3.0.2-13.fc22.src.rpm
9
10Signed-off-by: Roy Li <rongqing.li@windriver.com>
11
12diff -up vsftpd-2.1.0/ls.c.filter vsftpd-2.1.0/ls.c
13--- vsftpd-2.1.0/ls.c.filter 2008-02-02 02:30:41.000000000 +0100
14+++ vsftpd-2.1.0/ls.c 2009-01-08 19:31:15.000000000 +0100
15@@ -239,9 +239,31 @@ vsf_filename_passes_filter(const struct
16 int ret = 0;
17 char last_token = 0;
18 int must_match_at_current_pos = 1;
19+
20+
21 str_copy(&filter_remain_str, p_filter_str);
22- str_copy(&name_remain_str, p_filename_str);
23-
24+
25+ if (!str_isempty (&filter_remain_str) && !str_isempty(p_filename_str)) {
26+ if (str_get_char_at(p_filter_str, 0) == '/') {
27+ if (str_get_char_at(p_filename_str, 0) != '/') {
28+ str_getcwd (&name_remain_str);
29+
30+ if (str_getlen(&name_remain_str) > 1) /* cwd != root dir */
31+ str_append_char (&name_remain_str, '/');
32+
33+ str_append_str (&name_remain_str, p_filename_str);
34+ }
35+ else
36+ str_copy (&name_remain_str, p_filename_str);
37+ } else {
38+ if (str_get_char_at(p_filter_str, 0) != '{')
39+ str_basename (&name_remain_str, p_filename_str);
40+ else
41+ str_copy (&name_remain_str, p_filename_str);
42+ }
43+ } else
44+ str_copy(&name_remain_str, p_filename_str);
45+
46 while (!str_isempty(&filter_remain_str) && *iters < VSFTP_MATCHITERS_MAX)
47 {
48 static struct mystr s_match_needed_str;
49diff -up vsftpd-2.1.0/str.c.filter vsftpd-2.1.0/str.c
50--- vsftpd-2.1.0/str.c.filter 2008-12-17 06:54:16.000000000 +0100
51+++ vsftpd-2.1.0/str.c 2009-01-08 19:31:15.000000000 +0100
52@@ -680,3 +680,14 @@ str_replace_unprintable(struct mystr* p_
53 }
54 }
55
56+void
57+str_basename (struct mystr* d_str, const struct mystr* path)
58+{
59+ static struct mystr tmp;
60+
61+ str_copy (&tmp, path);
62+ str_split_char_reverse(&tmp, d_str, '/');
63+
64+ if (str_isempty(d_str))
65+ str_copy (d_str, path);
66+}
67diff -up vsftpd-2.1.0/str.h.filter vsftpd-2.1.0/str.h
68--- vsftpd-2.1.0/str.h.filter 2008-12-17 06:53:23.000000000 +0100
69+++ vsftpd-2.1.0/str.h 2009-01-08 19:32:14.000000000 +0100
70@@ -100,6 +100,7 @@ void str_replace_unprintable(struct myst
71 int str_atoi(const struct mystr* p_str);
72 filesize_t str_a_to_filesize_t(const struct mystr* p_str);
73 unsigned int str_octal_to_uint(const struct mystr* p_str);
74+void str_basename (struct mystr* d_str, const struct mystr* path);
75
76 /* PURPOSE: Extract a line of text (delimited by \n or EOF) from a string
77 * buffer, starting at character position 'p_pos'. The extracted line will
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.2.bb b/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.2.bb
index e4d65eea6f..fbeca9b04a 100644
--- a/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.2.bb
+++ b/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.2.bb
@@ -17,6 +17,7 @@ SRC_URI = "https://security.appspot.com/downloads/vsftpd-${PV}.tar.gz \
17 file://change-secure_chroot_dir.patch \ 17 file://change-secure_chroot_dir.patch \
18 file://volatiles.99_vsftpd \ 18 file://volatiles.99_vsftpd \
19 file://vsftpd.service \ 19 file://vsftpd.service \
20 file://vsftpd-2.1.0-filter.patch \
20" 21"
21 22
22LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271 \ 23LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271 \