diff options
Diffstat (limited to 'meta/recipes-devtools')
106 files changed, 5273 insertions, 2111 deletions
diff --git a/meta/recipes-devtools/apt/files/apt.conf b/meta/recipes-devtools/apt/files/apt.conf index 03351356bc..c95a5b07af 100644 --- a/meta/recipes-devtools/apt/files/apt.conf +++ b/meta/recipes-devtools/apt/files/apt.conf | |||
@@ -39,4 +39,4 @@ APT | |||
39 | }; | 39 | }; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"}; | 42 | DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-force-overwrite";"--no-debsig"}; |
diff --git a/meta/recipes-devtools/binutils/binutils/nativesdk-relocation.patch b/meta/recipes-devtools/binutils/binutils/nativesdk-relocation.patch new file mode 100644 index 0000000000..408f7d18b7 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/nativesdk-relocation.patch | |||
@@ -0,0 +1,80 @@ | |||
1 | We need binutils to look at our ld.so.conf file within the SDK to ensure | ||
2 | we search the SDK's libdirs as well as those from the host system. | ||
3 | |||
4 | We therefore pass in the directory to the code using a define, then add | ||
5 | it to a section we relocate in a similar way to the way we relocate the | ||
6 | gcc internal paths. This ensures that ld works correctly in our buildtools | ||
7 | tarball. | ||
8 | |||
9 | Standard sysroot relocation doesn't work since we're not in a sysroot, | ||
10 | we want to use both the host system and SDK libs. | ||
11 | |||
12 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
13 | 2020/1/17 | ||
14 | Upstream-Status: Inappropriate [OE specific tweak] | ||
15 | |||
16 | Index: git/ld/Makefile.am | ||
17 | =================================================================== | ||
18 | --- git.orig/ld/Makefile.am | ||
19 | +++ git/ld/Makefile.am | ||
20 | @@ -36,7 +36,8 @@ am__skipyacc = | ||
21 | |||
22 | ELF_CLFAGS=-DELF_LIST_OPTIONS=@elf_list_options@ \ | ||
23 | -DELF_SHLIB_LIST_OPTIONS=@elf_shlib_list_options@ \ | ||
24 | - -DELF_PLT_UNWIND_LIST_OPTIONS=@elf_plt_unwind_list_options@ | ||
25 | + -DELF_PLT_UNWIND_LIST_OPTIONS=@elf_plt_unwind_list_options@ \ | ||
26 | + -DSYSCONFDIR="\"$(sysconfdir)\"" | ||
27 | WARN_CFLAGS = @WARN_CFLAGS@ | ||
28 | NO_WERROR = @NO_WERROR@ | ||
29 | AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) | ||
30 | Index: git/ld/Makefile.in | ||
31 | =================================================================== | ||
32 | --- git.orig/ld/Makefile.in | ||
33 | +++ git/ld/Makefile.in | ||
34 | @@ -546,7 +546,8 @@ am__skiplex = | ||
35 | am__skipyacc = | ||
36 | ELF_CLFAGS = -DELF_LIST_OPTIONS=@elf_list_options@ \ | ||
37 | -DELF_SHLIB_LIST_OPTIONS=@elf_shlib_list_options@ \ | ||
38 | - -DELF_PLT_UNWIND_LIST_OPTIONS=@elf_plt_unwind_list_options@ | ||
39 | + -DELF_PLT_UNWIND_LIST_OPTIONS=@elf_plt_unwind_list_options@ \ | ||
40 | + -DSYSCONFDIR="\"$(sysconfdir)\"" | ||
41 | |||
42 | AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) | ||
43 | @ENABLE_PLUGINS_FALSE@PLUGIN_C = | ||
44 | Index: git/ld/emultempl/elf32.em | ||
45 | =================================================================== | ||
46 | --- git.orig/ld/emultempl/elf32.em | ||
47 | +++ git/ld/emultempl/elf32.em | ||
48 | @@ -1024,7 +1024,7 @@ gld${EMULATION_NAME}_check_ld_so_conf (c | ||
49 | |||
50 | info.path = NULL; | ||
51 | info.len = info.alloc = 0; | ||
52 | - tmppath = concat (ld_sysroot, "${prefix}/etc/ld.so.conf", | ||
53 | + tmppath = concat (ld_sysconfdir, "/ld.so.conf", | ||
54 | (const char *) NULL); | ||
55 | if (!gld${EMULATION_NAME}_parse_ld_so_conf (&info, tmppath)) | ||
56 | { | ||
57 | Index: git/ld/ldmain.c | ||
58 | =================================================================== | ||
59 | --- git.orig/ld/ldmain.c | ||
60 | +++ git/ld/ldmain.c | ||
61 | @@ -68,6 +68,7 @@ char *program_name; | ||
62 | |||
63 | /* The prefix for system library directories. */ | ||
64 | const char *ld_sysroot; | ||
65 | +char ld_sysconfdir[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSCONFDIR; | ||
66 | |||
67 | /* The canonical representation of ld_sysroot. */ | ||
68 | char *ld_canon_sysroot; | ||
69 | Index: git/ld/ldmain.h | ||
70 | =================================================================== | ||
71 | --- git.orig/ld/ldmain.h | ||
72 | +++ git/ld/ldmain.h | ||
73 | @@ -23,6 +23,7 @@ | ||
74 | |||
75 | extern char *program_name; | ||
76 | extern const char *ld_sysroot; | ||
77 | +extern char ld_sysconfdir[4096]; | ||
78 | extern char *ld_canon_sysroot; | ||
79 | extern int ld_canon_sysroot_len; | ||
80 | extern FILE *saved_script_handle; | ||
diff --git a/meta/recipes-devtools/binutils/binutils_2.32.bb b/meta/recipes-devtools/binutils/binutils_2.32.bb index 89315915c4..ecdab96658 100644 --- a/meta/recipes-devtools/binutils/binutils_2.32.bb +++ b/meta/recipes-devtools/binutils/binutils_2.32.bb | |||
@@ -51,5 +51,10 @@ do_install_class-native () { | |||
51 | PACKAGE_BEFORE_PN += "libbfd" | 51 | PACKAGE_BEFORE_PN += "libbfd" |
52 | FILES_libbfd = "${libdir}/libbfd-*.so" | 52 | FILES_libbfd = "${libdir}/libbfd-*.so" |
53 | 53 | ||
54 | SRC_URI_append_class-nativesdk = "file://nativesdk-relocation.patch" | ||
55 | |||
56 | USE_ALTERNATIVES_FOR_class-nativesdk = "" | ||
57 | FILES_${PN}_append_class-nativesdk = " ${bindir}" | ||
58 | |||
54 | BBCLASSEXTEND = "native nativesdk" | 59 | BBCLASSEXTEND = "native nativesdk" |
55 | 60 | ||
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-don-t-try-to-rehash-a-deleted-directory.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-don-t-try-to-rehash-a-deleted-directory.patch new file mode 100644 index 0000000000..ba4e3a3c97 --- /dev/null +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-don-t-try-to-rehash-a-deleted-directory.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From 71ba13755337e19c9a826dfc874562a36e1b24d3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Theodore Ts'o <tytso@mit.edu> | ||
3 | Date: Thu, 19 Dec 2019 19:45:06 -0500 | ||
4 | Subject: [PATCH] e2fsck: don't try to rehash a deleted directory | ||
5 | |||
6 | If directory has been deleted in pass1[bcd] processing, then we | ||
7 | shouldn't try to rehash the directory in pass 3a when we try to | ||
8 | rehash/reoptimize directories. | ||
9 | |||
10 | Signed-off-by: Theodore Ts'o <tytso@mit.edu> | ||
11 | |||
12 | Upstream-Status: Backport [https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=71ba13755337e19c9a826dfc874562a36e1b24d3] | ||
13 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
14 | --- | ||
15 | e2fsck/pass1b.c | 4 ++++ | ||
16 | e2fsck/rehash.c | 2 ++ | ||
17 | 2 files changed, 6 insertions(+) | ||
18 | |||
19 | diff --git a/e2fsck/pass1b.c b/e2fsck/pass1b.c | ||
20 | index 5693b9cf..bca701ca 100644 | ||
21 | --- a/e2fsck/pass1b.c | ||
22 | +++ b/e2fsck/pass1b.c | ||
23 | @@ -705,6 +705,10 @@ static void delete_file(e2fsck_t ctx, ext2_ino_t ino, | ||
24 | fix_problem(ctx, PR_1B_BLOCK_ITERATE, &pctx); | ||
25 | if (ctx->inode_bad_map) | ||
26 | ext2fs_unmark_inode_bitmap2(ctx->inode_bad_map, ino); | ||
27 | + if (ctx->inode_reg_map) | ||
28 | + ext2fs_unmark_inode_bitmap2(ctx->inode_reg_map, ino); | ||
29 | + ext2fs_unmark_inode_bitmap2(ctx->inode_dir_map, ino); | ||
30 | + ext2fs_unmark_inode_bitmap2(ctx->inode_used_map, ino); | ||
31 | ext2fs_inode_alloc_stats2(fs, ino, -1, LINUX_S_ISDIR(dp->inode.i_mode)); | ||
32 | quota_data_sub(ctx->qctx, &dp->inode, ino, | ||
33 | pb.dup_blocks * fs->blocksize); | ||
34 | diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c | ||
35 | index 3dd1e941..2c908be0 100644 | ||
36 | --- a/e2fsck/rehash.c | ||
37 | +++ b/e2fsck/rehash.c | ||
38 | @@ -1028,6 +1028,8 @@ void e2fsck_rehash_directories(e2fsck_t ctx) | ||
39 | if (!ext2fs_u32_list_iterate(iter, &ino)) | ||
40 | break; | ||
41 | } | ||
42 | + if (!ext2fs_test_inode_bitmap2(ctx->inode_dir_map, ino)) | ||
43 | + continue; | ||
44 | |||
45 | pctx.dir = ino; | ||
46 | if (first) { | ||
47 | -- | ||
48 | 2.24.1 | ||
49 | |||
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/CVE-2019-5188.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/CVE-2019-5188.patch new file mode 100644 index 0000000000..de4bce0037 --- /dev/null +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/CVE-2019-5188.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From 8dd73c149f418238f19791f9d666089ef9734dff Mon Sep 17 00:00:00 2001 | ||
2 | From: Theodore Ts'o <tytso@mit.edu> | ||
3 | Date: Thu, 19 Dec 2019 19:37:34 -0500 | ||
4 | Subject: [PATCH] e2fsck: abort if there is a corrupted directory block when | ||
5 | rehashing | ||
6 | |||
7 | In e2fsck pass 3a, when we are rehashing directories, at least in | ||
8 | theory, all of the directories should have had corruptions with | ||
9 | respect to directory entry structure fixed. However, it's possible | ||
10 | (for example, if the user declined a fix) that we can reach this stage | ||
11 | of processing with a corrupted directory entries. | ||
12 | |||
13 | So check for that case and don't try to process a corrupted directory | ||
14 | block so we don't run into trouble in mutate_name() if there is a | ||
15 | zero-length file name. | ||
16 | |||
17 | Addresses: TALOS-2019-0973 | ||
18 | Addresses: CVE-2019-5188 | ||
19 | Signed-off-by: Theodore Ts'o <tytso@mit.edu> | ||
20 | |||
21 | CVE: CVE-2019-5188 | ||
22 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
23 | Upstream-Status: Backport [https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=8dd73c149f418238f19791f9d666089ef9734dff] | ||
24 | --- | ||
25 | e2fsck/rehash.c | 9 +++++++++ | ||
26 | 1 file changed, 9 insertions(+) | ||
27 | |||
28 | diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c | ||
29 | index a5fc1be1..3dd1e941 100644 | ||
30 | --- a/e2fsck/rehash.c | ||
31 | +++ b/e2fsck/rehash.c | ||
32 | @@ -160,6 +160,10 @@ static int fill_dir_block(ext2_filsys fs, | ||
33 | dir_offset += rec_len; | ||
34 | if (dirent->inode == 0) | ||
35 | continue; | ||
36 | + if ((name_len) == 0) { | ||
37 | + fd->err = EXT2_ET_DIR_CORRUPTED; | ||
38 | + return BLOCK_ABORT; | ||
39 | + } | ||
40 | if (!fd->compress && (name_len == 1) && | ||
41 | (dirent->name[0] == '.')) | ||
42 | continue; | ||
43 | @@ -401,6 +405,11 @@ static int duplicate_search_and_fix(e2fsck_t ctx, ext2_filsys fs, | ||
44 | continue; | ||
45 | } | ||
46 | new_len = ext2fs_dirent_name_len(ent->dir); | ||
47 | + if (new_len == 0) { | ||
48 | + /* should never happen */ | ||
49 | + ext2fs_unmark_valid(fs); | ||
50 | + continue; | ||
51 | + } | ||
52 | memcpy(new_name, ent->dir->name, new_len); | ||
53 | mutate_name(new_name, &new_len); | ||
54 | for (j=0; j < fd->num_array; j++) { | ||
55 | -- | ||
56 | 2.24.1 | ||
57 | |||
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsck-fix-use-after-free-in-calculate_tree.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsck-fix-use-after-free-in-calculate_tree.patch new file mode 100644 index 0000000000..342a2b855b --- /dev/null +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsck-fix-use-after-free-in-calculate_tree.patch | |||
@@ -0,0 +1,76 @@ | |||
1 | From: Wang Shilong <wshilong@ddn.com> | ||
2 | Date: Mon, 30 Dec 2019 19:52:39 -0500 | ||
3 | Subject: e2fsck: fix use after free in calculate_tree() | ||
4 | |||
5 | The problem is alloc_blocks() will call get_next_block() which might | ||
6 | reallocate outdir->buf, and memory address could be changed after | ||
7 | this. To fix this, pointers that point into outdir->buf, such as | ||
8 | int_limit and root need to be recaulated based on the new starting | ||
9 | address of outdir->buf. | ||
10 | |||
11 | [ Changed to correctly recalculate int_limit, and to optimize how we | ||
12 | reallocate outdir->buf. -TYT ] | ||
13 | |||
14 | Addresses-Debian-Bug: 948517 | ||
15 | Signed-off-by: Wang Shilong <wshilong@ddn.com> | ||
16 | Signed-off-by: Theodore Ts'o <tytso@mit.edu> | ||
17 | (cherry picked from commit 101e73e99ccafa0403fcb27dd7413033b587ca01) | ||
18 | |||
19 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
20 | Upstream-Status: Backport [https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=101e73e99ccafa0403fcb27dd7413033b587ca01] | ||
21 | --- | ||
22 | e2fsck/rehash.c | 17 ++++++++++++++++- | ||
23 | 1 file changed, 16 insertions(+), 1 deletion(-) | ||
24 | |||
25 | diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c | ||
26 | index 0a5888a9..2574e151 100644 | ||
27 | --- a/e2fsck/rehash.c | ||
28 | +++ b/e2fsck/rehash.c | ||
29 | @@ -295,7 +295,11 @@ static errcode_t get_next_block(ext2_filsys fs, struct out_dir *outdir, | ||
30 | errcode_t retval; | ||
31 | |||
32 | if (outdir->num >= outdir->max) { | ||
33 | - retval = alloc_size_dir(fs, outdir, outdir->max + 50); | ||
34 | + int increment = outdir->max / 10; | ||
35 | + | ||
36 | + if (increment < 50) | ||
37 | + increment = 50; | ||
38 | + retval = alloc_size_dir(fs, outdir, outdir->max + increment); | ||
39 | if (retval) | ||
40 | return retval; | ||
41 | } | ||
42 | @@ -637,6 +641,9 @@ static int alloc_blocks(ext2_filsys fs, | ||
43 | if (retval) | ||
44 | return retval; | ||
45 | |||
46 | + /* outdir->buf might be reallocated */ | ||
47 | + *prev_ent = (struct ext2_dx_entry *) (outdir->buf + *prev_offset); | ||
48 | + | ||
49 | *next_ent = set_int_node(fs, block_start); | ||
50 | *limit = (struct ext2_dx_countlimit *)(*next_ent); | ||
51 | if (next_offset) | ||
52 | @@ -726,6 +733,9 @@ static errcode_t calculate_tree(ext2_filsys fs, | ||
53 | return retval; | ||
54 | } | ||
55 | if (c3 == 0) { | ||
56 | + int delta1 = (char *)int_limit - outdir->buf; | ||
57 | + int delta2 = (char *)root - outdir->buf; | ||
58 | + | ||
59 | retval = alloc_blocks(fs, &limit, &int_ent, | ||
60 | &dx_ent, &int_offset, | ||
61 | NULL, outdir, i, &c2, | ||
62 | @@ -733,6 +743,11 @@ static errcode_t calculate_tree(ext2_filsys fs, | ||
63 | if (retval) | ||
64 | return retval; | ||
65 | |||
66 | + /* outdir->buf might be reallocated */ | ||
67 | + int_limit = (struct ext2_dx_countlimit *) | ||
68 | + (outdir->buf + delta1); | ||
69 | + root = (struct ext2_dx_entry *) | ||
70 | + (outdir->buf + delta2); | ||
71 | } | ||
72 | dx_ent->block = ext2fs_cpu_to_le32(i); | ||
73 | if (c3 != limit->limit) | ||
74 | -- | ||
75 | 2.24.1 | ||
76 | |||
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.45.3.bb b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.45.3.bb index 14c05a446c..f81defb837 100644 --- a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.45.3.bb +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.45.3.bb | |||
@@ -6,6 +6,9 @@ SRC_URI += "file://remove.ldconfig.call.patch \ | |||
6 | file://mkdir_p.patch \ | 6 | file://mkdir_p.patch \ |
7 | file://0001-misc-create_inode.c-set-dir-s-mode-correctly.patch \ | 7 | file://0001-misc-create_inode.c-set-dir-s-mode-correctly.patch \ |
8 | file://CVE-2019-5094.patch \ | 8 | file://CVE-2019-5094.patch \ |
9 | file://CVE-2019-5188.patch \ | ||
10 | file://0001-e2fsck-don-t-try-to-rehash-a-deleted-directory.patch \ | ||
11 | file://e2fsck-fix-use-after-free-in-calculate_tree.patch \ | ||
9 | " | 12 | " |
10 | 13 | ||
11 | SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch \ | 14 | SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch \ |
diff --git a/meta/recipes-devtools/file/file_5.37.bb b/meta/recipes-devtools/file/file_5.37.bb index 60fc66131e..eb0f40b54d 100644 --- a/meta/recipes-devtools/file/file_5.37.bb +++ b/meta/recipes-devtools/file/file_5.37.bb | |||
@@ -9,7 +9,7 @@ LICENSE = "BSD" | |||
9 | LIC_FILES_CHKSUM = "file://COPYING;beginline=2;md5=0251eaec1188b20d9a72c502ecfdda1b" | 9 | LIC_FILES_CHKSUM = "file://COPYING;beginline=2;md5=0251eaec1188b20d9a72c502ecfdda1b" |
10 | 10 | ||
11 | DEPENDS = "zlib file-replacement-native" | 11 | DEPENDS = "zlib file-replacement-native" |
12 | DEPENDS_class-native = "zlib-native" | 12 | DEPENDS_class-native = "zlib-native bzip2-replacement-native" |
13 | 13 | ||
14 | # Blacklist a bogus tag in upstream check | 14 | # Blacklist a bogus tag in upstream check |
15 | UPSTREAM_CHECK_GITTAGREGEX = "FILE(?P<pver>(?!6_23).+)" | 15 | UPSTREAM_CHECK_GITTAGREGEX = "FILE(?P<pver>(?!6_23).+)" |
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc index f14cbf7152..4aac345bec 100644 --- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc +++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc | |||
@@ -158,7 +158,7 @@ SYSTEMLIBS1 = "${target_libdir}/" | |||
158 | EXTRA_OECONF += "--enable-poison-system-directories" | 158 | EXTRA_OECONF += "--enable-poison-system-directories" |
159 | EXTRA_OECONF_remove_elf = "--with-sysroot=/not/exist" | 159 | EXTRA_OECONF_remove_elf = "--with-sysroot=/not/exist" |
160 | EXTRA_OECONF_remove_eabi = "--with-sysroot=/not/exist" | 160 | EXTRA_OECONF_remove_eabi = "--with-sysroot=/not/exist" |
161 | EXTRA_OECONF_append_elf = "--without-headers --with-newlib" | 161 | EXTRA_OECONF_append_elf = " --without-headers --with-newlib" |
162 | EXTRA_OECONF_append_eabi = "--without-headers --with-newlib" | 162 | EXTRA_OECONF_append_eabi = " --without-headers --with-newlib" |
163 | # gcc 4.7 needs -isystem | 163 | # gcc 4.7 needs -isystem |
164 | export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}" | 164 | export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}" |
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc index 8855bb1f34..06ba3ccd15 100644 --- a/meta/recipes-devtools/gcc/gcc-cross.inc +++ b/meta/recipes-devtools/gcc/gcc-cross.inc | |||
@@ -61,6 +61,13 @@ do_compile () { | |||
61 | export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" | 61 | export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" |
62 | export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" | 62 | export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" |
63 | 63 | ||
64 | # Prevent native/host sysroot path from being used in configargs.h header, | ||
65 | # as it will be rewritten when used by other sysroots preventing support | ||
66 | # for gcc plugins | ||
67 | oe_runmake configure-gcc | ||
68 | sed -i 's@${STAGING_DIR_TARGET}@/host@g' ${B}/gcc/configargs.h | ||
69 | sed -i 's@${STAGING_DIR_HOST}@/host@g' ${B}/gcc/configargs.h | ||
70 | |||
64 | oe_runmake all-host configure-target-libgcc | 71 | oe_runmake all-host configure-target-libgcc |
65 | (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h) | 72 | (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h) |
66 | # now generate script to drive testing | 73 | # now generate script to drive testing |
diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc index 2da3c02ef0..536b18d97f 100644 --- a/meta/recipes-devtools/gcc/gcc-runtime.inc +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc | |||
@@ -302,10 +302,6 @@ do_check() { | |||
302 | 302 | ||
303 | # HACK: this works around the configure setting CXX with -nostd* args | 303 | # HACK: this works around the configure setting CXX with -nostd* args |
304 | sed -i 's/-nostdinc++ -nostdlib++//g' $(find ${B} -name testsuite_flags | head -1) | 304 | sed -i 's/-nostdinc++ -nostdlib++//g' $(find ${B} -name testsuite_flags | head -1) |
305 | # HACK: this works around the de-stashing changes to configargs.h, as well as recipe-sysroot changing the content | ||
306 | sed -i '/static const char configuration_arguments/d' ${B}/gcc/configargs.h | ||
307 | ${CC} -v 2>&1 | grep "^Configured with:" | \ | ||
308 | sed 's/Configured with: \(.*\)/static const char configuration_arguments[] = "\1";/g' >> ${B}/gcc/configargs.h | ||
309 | 305 | ||
310 | if [ "${TOOLCHAIN_TEST_TARGET}" = "user" ]; then | 306 | if [ "${TOOLCHAIN_TEST_TARGET}" = "user" ]; then |
311 | # qemu user has issues allocating large amounts of memory | 307 | # qemu user has issues allocating large amounts of memory |
diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc index bdc6ff658f..987e88d32c 100644 --- a/meta/recipes-devtools/gcc/gcc-target.inc +++ b/meta/recipes-devtools/gcc/gcc-target.inc | |||
@@ -137,6 +137,14 @@ FILES_${PN}-doc = "\ | |||
137 | " | 137 | " |
138 | 138 | ||
139 | do_compile () { | 139 | do_compile () { |
140 | # Prevent full target sysroot path from being used in configargs.h header, | ||
141 | # as it will be rewritten when used by other sysroots preventing support | ||
142 | # for gcc plugins. Additionally the path is embeddeded into the output | ||
143 | # binary, this prevents building a reproducible binary. | ||
144 | oe_runmake configure-gcc | ||
145 | sed -i 's@${STAGING_DIR_TARGET}@/@g' ${B}/gcc/configargs.h | ||
146 | sed -i 's@${STAGING_DIR_HOST}@/@g' ${B}/gcc/configargs.h | ||
147 | |||
140 | oe_runmake all-host | 148 | oe_runmake all-host |
141 | } | 149 | } |
142 | 150 | ||
diff --git a/meta/recipes-devtools/git/git.inc b/meta/recipes-devtools/git/git.inc index 6e137432f0..a0ce1626a1 100644 --- a/meta/recipes-devtools/git/git.inc +++ b/meta/recipes-devtools/git/git.inc | |||
@@ -7,7 +7,21 @@ DEPENDS = "openssl curl zlib expat" | |||
7 | PROVIDES_append_class-native = " git-replacement-native" | 7 | PROVIDES_append_class-native = " git-replacement-native" |
8 | 8 | ||
9 | SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \ | 9 | SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \ |
10 | ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages" | 10 | ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages \ |
11 | file://CVE-2020-5260.patch \ | ||
12 | file://0001-t-lib-credential-use-test_i18ncmp-to-check-stderr.patch \ | ||
13 | file://0002-credential-detect-unrepresentable-values-when-parsin.patch \ | ||
14 | file://0003-fsck-detect-gitmodules-URLs-with-embedded-newlines.patch \ | ||
15 | file://CVE-2020-11008-1.patch \ | ||
16 | file://CVE-2020-11008-2.patch \ | ||
17 | file://CVE-2020-11008-3.patch \ | ||
18 | file://CVE-2020-11008-4.patch \ | ||
19 | file://CVE-2020-11008-5.patch \ | ||
20 | file://CVE-2020-11008-6.patch \ | ||
21 | file://CVE-2020-11008-7.patch \ | ||
22 | file://CVE-2020-11008-8.patch \ | ||
23 | file://CVE-2020-11008-9.patch \ | ||
24 | " | ||
11 | 25 | ||
12 | S = "${WORKDIR}/git-${PV}" | 26 | S = "${WORKDIR}/git-${PV}" |
13 | 27 | ||
diff --git a/meta/recipes-devtools/git/git/0001-t-lib-credential-use-test_i18ncmp-to-check-stderr.patch b/meta/recipes-devtools/git/git/0001-t-lib-credential-use-test_i18ncmp-to-check-stderr.patch new file mode 100644 index 0000000000..6eb3c16aef --- /dev/null +++ b/meta/recipes-devtools/git/git/0001-t-lib-credential-use-test_i18ncmp-to-check-stderr.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 70ef9c6ce884b2d466d3d36563f1d2aa31b56443 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jeff King <peff@peff.net> | ||
3 | Date: Wed, 11 Mar 2020 18:11:37 -0400 | ||
4 | Subject: [PATCH 01/12] t/lib-credential: use test_i18ncmp to check stderr | ||
5 | |||
6 | The credential tests have a "check" function which feeds some input to | ||
7 | git-credential and checks the stdout and stderr. We look for exact | ||
8 | matches in the output. For stdout, this makes sense; the output is | ||
9 | the credential protocol. But for stderr, we may be showing various | ||
10 | diagnostic messages, or the prompts fed to the askpass program, which | ||
11 | could be translated. Let's mark them as such. | ||
12 | |||
13 | Upstream-Status: Backport | ||
14 | |||
15 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
16 | --- | ||
17 | t/lib-credential.sh | 2 +- | ||
18 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/t/lib-credential.sh b/t/lib-credential.sh | ||
21 | index 937b831..bb88cc0 100755 | ||
22 | --- a/t/lib-credential.sh | ||
23 | +++ b/t/lib-credential.sh | ||
24 | @@ -19,7 +19,7 @@ check() { | ||
25 | false | ||
26 | fi && | ||
27 | test_cmp expect-stdout stdout && | ||
28 | - test_cmp expect-stderr stderr | ||
29 | + test_i18ncmp expect-stderr stderr | ||
30 | } | ||
31 | |||
32 | read_chunk() { | ||
33 | -- | ||
34 | 1.9.1 | ||
35 | |||
diff --git a/meta/recipes-devtools/git/git/0002-credential-detect-unrepresentable-values-when-parsin.patch b/meta/recipes-devtools/git/git/0002-credential-detect-unrepresentable-values-when-parsin.patch new file mode 100644 index 0000000000..a9b7348ef7 --- /dev/null +++ b/meta/recipes-devtools/git/git/0002-credential-detect-unrepresentable-values-when-parsin.patch | |||
@@ -0,0 +1,156 @@ | |||
1 | From 43803880b954a020dbffa5250a5b7fd893442c7c Mon Sep 17 00:00:00 2001 | ||
2 | From: Jeff King <peff@peff.net> | ||
3 | Date: Thu, 12 Mar 2020 01:31:11 -0400 | ||
4 | Subject: [PATCH 02/12] credential: detect unrepresentable values when parsing | ||
5 | urls | ||
6 | |||
7 | The credential protocol can't represent newlines in values, but URLs can | ||
8 | embed percent-encoded newlines in various components. A previous commit | ||
9 | taught the low-level writing routines to die() when encountering this, | ||
10 | but we can be a little friendlier to the user by detecting them earlier | ||
11 | and handling them gracefully. | ||
12 | |||
13 | This patch teaches credential_from_url() to notice such components, | ||
14 | issue a warning, and blank the credential (which will generally result | ||
15 | in prompting the user for a username and password). We blank the whole | ||
16 | credential in this case. Another option would be to blank only the | ||
17 | invalid component. However, we're probably better off not feeding a | ||
18 | partially-parsed URL result to a credential helper. We don't know how a | ||
19 | given helper would handle it, so we're better off to err on the side of | ||
20 | matching nothing rather than something unexpected. | ||
21 | |||
22 | The die() call in credential_write() is _probably_ impossible to reach | ||
23 | after this patch. Values should end up in credential structs only by URL | ||
24 | parsing (which is covered here), or by reading credential protocol input | ||
25 | (which by definition cannot read a newline into a value). But we should | ||
26 | definitely keep the low-level check, as it's our final and most accurate | ||
27 | line of defense against protocol injection attacks. Arguably it could | ||
28 | become a BUG(), but it probably doesn't matter much either way. | ||
29 | |||
30 | Note that the public interface of credential_from_url() grows a little | ||
31 | more than we need here. We'll use the extra flexibility in a future | ||
32 | patch to help fsck catch these cases. | ||
33 | |||
34 | Upstream-Status: Backport | ||
35 | |||
36 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
37 | --- | ||
38 | credential.c | 36 ++++++++++++++++++++++++++++++++++-- | ||
39 | credential.h | 16 ++++++++++++++++ | ||
40 | t/t0300-credentials.sh | 12 ++++++++++-- | ||
41 | 3 files changed, 60 insertions(+), 4 deletions(-) | ||
42 | |||
43 | diff --git a/credential.c b/credential.c | ||
44 | index a79aff0..2482382 100644 | ||
45 | --- a/credential.c | ||
46 | +++ b/credential.c | ||
47 | @@ -324,7 +324,22 @@ void credential_reject(struct credential *c) | ||
48 | c->approved = 0; | ||
49 | } | ||
50 | |||
51 | -void credential_from_url(struct credential *c, const char *url) | ||
52 | +static int check_url_component(const char *url, int quiet, | ||
53 | + const char *name, const char *value) | ||
54 | +{ | ||
55 | + if (!value) | ||
56 | + return 0; | ||
57 | + if (!strchr(value, '\n')) | ||
58 | + return 0; | ||
59 | + | ||
60 | + if (!quiet) | ||
61 | + warning(_("url contains a newline in its %s component: %s"), | ||
62 | + name, url); | ||
63 | + return -1; | ||
64 | +} | ||
65 | + | ||
66 | +int credential_from_url_gently(struct credential *c, const char *url, | ||
67 | + int quiet) | ||
68 | { | ||
69 | const char *at, *colon, *cp, *slash, *host, *proto_end; | ||
70 | |||
71 | @@ -338,7 +353,7 @@ void credential_from_url(struct credential *c, const char *url) | ||
72 | */ | ||
73 | proto_end = strstr(url, "://"); | ||
74 | if (!proto_end) | ||
75 | - return; | ||
76 | + return 0; | ||
77 | cp = proto_end + 3; | ||
78 | at = strchr(cp, '@'); | ||
79 | colon = strchr(cp, ':'); | ||
80 | @@ -373,4 +388,21 @@ void credential_from_url(struct credential *c, const char *url) | ||
81 | while (p > c->path && *p == '/') | ||
82 | *p-- = '\0'; | ||
83 | } | ||
84 | + | ||
85 | + if (check_url_component(url, quiet, "username", c->username) < 0 || | ||
86 | + check_url_component(url, quiet, "password", c->password) < 0 || | ||
87 | + check_url_component(url, quiet, "protocol", c->protocol) < 0 || | ||
88 | + check_url_component(url, quiet, "host", c->host) < 0 || | ||
89 | + check_url_component(url, quiet, "path", c->path) < 0) | ||
90 | + return -1; | ||
91 | + | ||
92 | + return 0; | ||
93 | +} | ||
94 | + | ||
95 | +void credential_from_url(struct credential *c, const char *url) | ||
96 | +{ | ||
97 | + if (credential_from_url_gently(c, url, 0) < 0) { | ||
98 | + warning(_("skipping credential lookup for url: %s"), url); | ||
99 | + credential_clear(c); | ||
100 | + } | ||
101 | } | ||
102 | diff --git a/credential.h b/credential.h | ||
103 | index 6b0cd16..122a23c 100644 | ||
104 | --- a/credential.h | ||
105 | +++ b/credential.h | ||
106 | @@ -28,7 +28,23 @@ struct credential { | ||
107 | |||
108 | int credential_read(struct credential *, FILE *); | ||
109 | void credential_write(const struct credential *, FILE *); | ||
110 | + | ||
111 | +/* | ||
112 | + * Parse a url into a credential struct, replacing any existing contents. | ||
113 | + * | ||
114 | + * Ifthe url can't be parsed (e.g., a missing "proto://" component), the | ||
115 | + * resulting credential will be empty but we'll still return success from the | ||
116 | + * "gently" form. | ||
117 | + * | ||
118 | + * If we encounter a component which cannot be represented as a credential | ||
119 | + * value (e.g., because it contains a newline), the "gently" form will return | ||
120 | + * an error but leave the broken state in the credential object for further | ||
121 | + * examination. The non-gentle form will issue a warning to stderr and return | ||
122 | + * an empty credential. | ||
123 | + */ | ||
124 | void credential_from_url(struct credential *, const char *url); | ||
125 | +int credential_from_url_gently(struct credential *, const char *url, int quiet); | ||
126 | + | ||
127 | int credential_match(const struct credential *have, | ||
128 | const struct credential *want); | ||
129 | |||
130 | diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh | ||
131 | index 26f3c3a..b9c0f1f 100755 | ||
132 | --- a/t/t0300-credentials.sh | ||
133 | +++ b/t/t0300-credentials.sh | ||
134 | @@ -308,9 +308,17 @@ test_expect_success 'empty helper spec resets helper list' ' | ||
135 | EOF | ||
136 | ' | ||
137 | |||
138 | -test_expect_success 'url parser rejects embedded newlines' ' | ||
139 | - test_must_fail git credential fill <<-\EOF | ||
140 | +test_expect_success 'url parser ignores embedded newlines' ' | ||
141 | + check fill <<-EOF | ||
142 | url=https://one.example.com?%0ahost=two.example.com/ | ||
143 | + -- | ||
144 | + username=askpass-username | ||
145 | + password=askpass-password | ||
146 | + -- | ||
147 | + warning: url contains a newline in its host component: https://one.example.com?%0ahost=two.example.com/ | ||
148 | + warning: skipping credential lookup for url: https://one.example.com?%0ahost=two.example.com/ | ||
149 | + askpass: Username: | ||
150 | + askpass: Password: | ||
151 | EOF | ||
152 | ' | ||
153 | |||
154 | -- | ||
155 | 1.9.1 | ||
156 | |||
diff --git a/meta/recipes-devtools/git/git/0003-fsck-detect-gitmodules-URLs-with-embedded-newlines.patch b/meta/recipes-devtools/git/git/0003-fsck-detect-gitmodules-URLs-with-embedded-newlines.patch new file mode 100644 index 0000000000..23931e6313 --- /dev/null +++ b/meta/recipes-devtools/git/git/0003-fsck-detect-gitmodules-URLs-with-embedded-newlines.patch | |||
@@ -0,0 +1,103 @@ | |||
1 | From 1c9f8cedd34302575db40016231bdf502f17901e Mon Sep 17 00:00:00 2001 | ||
2 | From: Li Zhou <li.zhou@windriver.com> | ||
3 | Date: Mon, 27 Apr 2020 13:49:39 +0800 | ||
4 | Subject: [PATCH 03/12] fsck: detect gitmodules URLs with embedded newlines | ||
5 | |||
6 | The credential protocol can't handle values with newlines. We already | ||
7 | detect and block any such URLs from being used with credential helpers, | ||
8 | but let's also add an fsck check to detect and block gitmodules files | ||
9 | with such URLs. That will let us notice the problem earlier when | ||
10 | transfer.fsckObjects is turned on. And in particular it will prevent bad | ||
11 | objects from spreading, which may protect downstream users running older | ||
12 | versions of Git. | ||
13 | |||
14 | We'll file this under the existing gitmodulesUrl flag, which covers URLs | ||
15 | with option injection. There's really no need to distinguish the exact | ||
16 | flaw in the URL in this context. Likewise, I've expanded the description | ||
17 | of t7416 to cover all types of bogus URLs. | ||
18 | |||
19 | Upstream-Status: Backport | ||
20 | |||
21 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
22 | --- | ||
23 | fsck.c | 16 +++++++++++++++- | ||
24 | t/t7416-submodule-dash-url.sh | 18 +++++++++++++++++- | ||
25 | 2 files changed, 32 insertions(+), 2 deletions(-) | ||
26 | |||
27 | diff --git a/fsck.c b/fsck.c | ||
28 | index ef8b343..ea46eea 100644 | ||
29 | --- a/fsck.c | ||
30 | +++ b/fsck.c | ||
31 | @@ -15,6 +15,7 @@ | ||
32 | #include "packfile.h" | ||
33 | #include "submodule-config.h" | ||
34 | #include "config.h" | ||
35 | +#include "credential.h" | ||
36 | #include "help.h" | ||
37 | |||
38 | static struct oidset gitmodules_found = OIDSET_INIT; | ||
39 | @@ -947,6 +948,19 @@ static int fsck_tag(struct tag *tag, const char *data, | ||
40 | return fsck_tag_buffer(tag, data, size, options); | ||
41 | } | ||
42 | |||
43 | +static int check_submodule_url(const char *url) | ||
44 | +{ | ||
45 | + struct credential c = CREDENTIAL_INIT; | ||
46 | + int ret; | ||
47 | + | ||
48 | + if (looks_like_command_line_option(url)) | ||
49 | + return -1; | ||
50 | + | ||
51 | + ret = credential_from_url_gently(&c, url, 1); | ||
52 | + credential_clear(&c); | ||
53 | + return ret; | ||
54 | +} | ||
55 | + | ||
56 | struct fsck_gitmodules_data { | ||
57 | struct object *obj; | ||
58 | struct fsck_options *options; | ||
59 | @@ -971,7 +985,7 @@ static int fsck_gitmodules_fn(const char *var, const char *value, void *vdata) | ||
60 | "disallowed submodule name: %s", | ||
61 | name); | ||
62 | if (!strcmp(key, "url") && value && | ||
63 | - looks_like_command_line_option(value)) | ||
64 | + check_submodule_url(value) < 0) | ||
65 | data->ret |= report(data->options, data->obj, | ||
66 | FSCK_MSG_GITMODULES_URL, | ||
67 | "disallowed submodule url: %s", | ||
68 | diff --git a/t/t7416-submodule-dash-url.sh b/t/t7416-submodule-dash-url.sh | ||
69 | index 5ba041f..41431b1 100755 | ||
70 | --- a/t/t7416-submodule-dash-url.sh | ||
71 | +++ b/t/t7416-submodule-dash-url.sh | ||
72 | @@ -1,6 +1,6 @@ | ||
73 | #!/bin/sh | ||
74 | |||
75 | -test_description='check handling of .gitmodule url with dash' | ||
76 | +test_description='check handling of disallowed .gitmodule urls' | ||
77 | . ./test-lib.sh | ||
78 | |||
79 | test_expect_success 'create submodule with protected dash in url' ' | ||
80 | @@ -60,4 +60,20 @@ test_expect_success 'trailing backslash is handled correctly' ' | ||
81 | test_i18ngrep ! "unknown option" err | ||
82 | ' | ||
83 | |||
84 | +test_expect_success 'fsck rejects embedded newline in url' ' | ||
85 | + # create an orphan branch to avoid existing .gitmodules objects | ||
86 | + git checkout --orphan newline && | ||
87 | + cat >.gitmodules <<-\EOF && | ||
88 | + [submodule "foo"] | ||
89 | + url = "https://one.example.com?%0ahost=two.example.com/foo.git" | ||
90 | + EOF | ||
91 | + git add .gitmodules && | ||
92 | + git commit -m "gitmodules with newline" && | ||
93 | + test_when_finished "rm -rf dst" && | ||
94 | + git init --bare dst && | ||
95 | + git -C dst config transfer.fsckObjects true && | ||
96 | + test_must_fail git push dst HEAD 2>err && | ||
97 | + grep gitmodulesUrl err | ||
98 | +' | ||
99 | + | ||
100 | test_done | ||
101 | -- | ||
102 | 1.9.1 | ||
103 | |||
diff --git a/meta/recipes-devtools/git/git/CVE-2020-11008-1.patch b/meta/recipes-devtools/git/git/CVE-2020-11008-1.patch new file mode 100644 index 0000000000..9cf98ea7b4 --- /dev/null +++ b/meta/recipes-devtools/git/git/CVE-2020-11008-1.patch | |||
@@ -0,0 +1,70 @@ | |||
1 | From 863f8067d8b4012904ca3bb881c659ac9894df97 Mon Sep 17 00:00:00 2001 | ||
2 | From: Li Zhou <li.zhou@windriver.com> | ||
3 | Date: Mon, 27 Apr 2020 14:36:03 +0800 | ||
4 | Subject: [PATCH 04/12] t0300: make "quit" helper more realistic | ||
5 | |||
6 | We test a toy credential helper that writes "quit=1" and confirms that | ||
7 | we stop running other helpers. However, that helper is unrealistic in | ||
8 | that it does not bother to read its stdin at all. | ||
9 | |||
10 | For now we don't send any input to it, because we feed git-credential a | ||
11 | blank credential. But that will change in the next patch, which will | ||
12 | cause this test to racily fail, as git-credential will get SIGPIPE | ||
13 | writing to the helper rather than exiting because it was asked to. | ||
14 | |||
15 | Let's make this one-off helper more like our other sample helpers, and | ||
16 | have it source the "dump" script. That will read stdin, fixing the | ||
17 | SIGPIPE problem. But it will also write what it sees to stderr. We can | ||
18 | make the test more robust by checking that output, which confirms that | ||
19 | we do run the quit helper, don't run any other helpers, and exit for the | ||
20 | reason we expected. | ||
21 | |||
22 | Signed-off-by: Jeff King <peff@peff.net> | ||
23 | Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> | ||
24 | |||
25 | Upstream-Status: Backport | ||
26 | CVE: CVE-2020-11008 (1) | ||
27 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
28 | --- | ||
29 | t/t0300-credentials.sh | 17 ++++++++++++++--- | ||
30 | 1 file changed, 14 insertions(+), 3 deletions(-) | ||
31 | |||
32 | diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh | ||
33 | index b9c0f1f..0206b3b 100755 | ||
34 | --- a/t/t0300-credentials.sh | ||
35 | +++ b/t/t0300-credentials.sh | ||
36 | @@ -22,6 +22,11 @@ test_expect_success 'setup helper scripts' ' | ||
37 | exit 0 | ||
38 | EOF | ||
39 | |||
40 | + write_script git-credential-quit <<-\EOF && | ||
41 | + . ./dump | ||
42 | + echo quit=1 | ||
43 | + EOF | ||
44 | + | ||
45 | write_script git-credential-verbatim <<-\EOF && | ||
46 | user=$1; shift | ||
47 | pass=$1; shift | ||
48 | @@ -291,10 +296,16 @@ test_expect_success 'http paths can be part of context' ' | ||
49 | |||
50 | test_expect_success 'helpers can abort the process' ' | ||
51 | test_must_fail git \ | ||
52 | - -c credential.helper="!f() { echo quit=1; }; f" \ | ||
53 | + -c credential.helper=quit \ | ||
54 | -c credential.helper="verbatim foo bar" \ | ||
55 | - credential fill >stdout && | ||
56 | - test_must_be_empty stdout | ||
57 | + credential fill >stdout 2>stderr && | ||
58 | + >expect && | ||
59 | + test_cmp expect stdout && | ||
60 | + cat >expect <<-\EOF && | ||
61 | + quit: get | ||
62 | + fatal: credential helper '\''quit'\'' told us to quit | ||
63 | + EOF | ||
64 | + test_i18ncmp expect stderr | ||
65 | ' | ||
66 | |||
67 | test_expect_success 'empty helper spec resets helper list' ' | ||
68 | -- | ||
69 | 1.9.1 | ||
70 | |||
diff --git a/meta/recipes-devtools/git/git/CVE-2020-11008-2.patch b/meta/recipes-devtools/git/git/CVE-2020-11008-2.patch new file mode 100644 index 0000000000..c752e3d431 --- /dev/null +++ b/meta/recipes-devtools/git/git/CVE-2020-11008-2.patch | |||
@@ -0,0 +1,292 @@ | |||
1 | From 5588659069214aa0f7fea75a69687078e2f7a817 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jeff King <peff@peff.net> | ||
3 | Date: Sat, 18 Apr 2020 20:47:30 -0700 | ||
4 | Subject: [PATCH 05/12] t0300: use more realistic inputs | ||
5 | |||
6 | Many of the tests in t0300 give partial inputs to git-credential, | ||
7 | omitting a protocol or hostname. We're checking only high-level things | ||
8 | like whether and how helpers are invoked at all, and we don't care about | ||
9 | specific hosts. However, in preparation for tightening up the rules | ||
10 | about when we're willing to run a helper, let's start using input that's | ||
11 | a bit more realistic: pretend as if http://example.com is being | ||
12 | examined. | ||
13 | |||
14 | This shouldn't change the point of any of the tests, but do note we have | ||
15 | to adjust the expected output to accommodate this (filling a credential | ||
16 | will repeat back the protocol/host fields to stdout, and the helper | ||
17 | debug messages and askpass prompt will change on stderr). | ||
18 | |||
19 | Signed-off-by: Jeff King <peff@peff.net> | ||
20 | Reviewed-by: Taylor Blau <me@ttaylorr.com> | ||
21 | Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> | ||
22 | |||
23 | Upstream-Status: Backport | ||
24 | CVE: CVE-2020-11008 (2) | ||
25 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
26 | --- | ||
27 | t/t0300-credentials.sh | 89 +++++++++++++++++++++++++++++++++++++++++++++++--- | ||
28 | 1 file changed, 85 insertions(+), 4 deletions(-) | ||
29 | |||
30 | diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh | ||
31 | index 0206b3b..f4c5d7f 100755 | ||
32 | --- a/t/t0300-credentials.sh | ||
33 | +++ b/t/t0300-credentials.sh | ||
34 | @@ -40,43 +40,71 @@ test_expect_success 'setup helper scripts' ' | ||
35 | |||
36 | test_expect_success 'credential_fill invokes helper' ' | ||
37 | check fill "verbatim foo bar" <<-\EOF | ||
38 | + protocol=http | ||
39 | + host=example.com | ||
40 | -- | ||
41 | + protocol=http | ||
42 | + host=example.com | ||
43 | username=foo | ||
44 | password=bar | ||
45 | -- | ||
46 | verbatim: get | ||
47 | + verbatim: protocol=http | ||
48 | + verbatim: host=example.com | ||
49 | EOF | ||
50 | ' | ||
51 | |||
52 | test_expect_success 'credential_fill invokes multiple helpers' ' | ||
53 | check fill useless "verbatim foo bar" <<-\EOF | ||
54 | + protocol=http | ||
55 | + host=example.com | ||
56 | -- | ||
57 | + protocol=http | ||
58 | + host=example.com | ||
59 | username=foo | ||
60 | password=bar | ||
61 | -- | ||
62 | useless: get | ||
63 | + useless: protocol=http | ||
64 | + useless: host=example.com | ||
65 | verbatim: get | ||
66 | + verbatim: protocol=http | ||
67 | + verbatim: host=example.com | ||
68 | EOF | ||
69 | ' | ||
70 | |||
71 | test_expect_success 'credential_fill stops when we get a full response' ' | ||
72 | check fill "verbatim one two" "verbatim three four" <<-\EOF | ||
73 | + protocol=http | ||
74 | + host=example.com | ||
75 | -- | ||
76 | + protocol=http | ||
77 | + host=example.com | ||
78 | username=one | ||
79 | password=two | ||
80 | -- | ||
81 | verbatim: get | ||
82 | + verbatim: protocol=http | ||
83 | + verbatim: host=example.com | ||
84 | EOF | ||
85 | ' | ||
86 | |||
87 | test_expect_success 'credential_fill continues through partial response' ' | ||
88 | check fill "verbatim one \"\"" "verbatim two three" <<-\EOF | ||
89 | + protocol=http | ||
90 | + host=example.com | ||
91 | -- | ||
92 | + protocol=http | ||
93 | + host=example.com | ||
94 | username=two | ||
95 | password=three | ||
96 | -- | ||
97 | verbatim: get | ||
98 | + verbatim: protocol=http | ||
99 | + verbatim: host=example.com | ||
100 | verbatim: get | ||
101 | + verbatim: protocol=http | ||
102 | + verbatim: host=example.com | ||
103 | verbatim: username=one | ||
104 | EOF | ||
105 | ' | ||
106 | @@ -102,14 +130,20 @@ test_expect_success 'credential_fill passes along metadata' ' | ||
107 | |||
108 | test_expect_success 'credential_approve calls all helpers' ' | ||
109 | check approve useless "verbatim one two" <<-\EOF | ||
110 | + protocol=http | ||
111 | + host=example.com | ||
112 | username=foo | ||
113 | password=bar | ||
114 | -- | ||
115 | -- | ||
116 | useless: store | ||
117 | + useless: protocol=http | ||
118 | + useless: host=example.com | ||
119 | useless: username=foo | ||
120 | useless: password=bar | ||
121 | verbatim: store | ||
122 | + verbatim: protocol=http | ||
123 | + verbatim: host=example.com | ||
124 | verbatim: username=foo | ||
125 | verbatim: password=bar | ||
126 | EOF | ||
127 | @@ -117,6 +151,8 @@ test_expect_success 'credential_approve calls all helpers' ' | ||
128 | |||
129 | test_expect_success 'do not bother storing password-less credential' ' | ||
130 | check approve useless <<-\EOF | ||
131 | + protocol=http | ||
132 | + host=example.com | ||
133 | username=foo | ||
134 | -- | ||
135 | -- | ||
136 | @@ -126,14 +162,20 @@ test_expect_success 'do not bother storing password-less credential' ' | ||
137 | |||
138 | test_expect_success 'credential_reject calls all helpers' ' | ||
139 | check reject useless "verbatim one two" <<-\EOF | ||
140 | + protocol=http | ||
141 | + host=example.com | ||
142 | username=foo | ||
143 | password=bar | ||
144 | -- | ||
145 | -- | ||
146 | useless: erase | ||
147 | + useless: protocol=http | ||
148 | + useless: host=example.com | ||
149 | useless: username=foo | ||
150 | useless: password=bar | ||
151 | verbatim: erase | ||
152 | + verbatim: protocol=http | ||
153 | + verbatim: host=example.com | ||
154 | verbatim: username=foo | ||
155 | verbatim: password=bar | ||
156 | EOF | ||
157 | @@ -141,33 +183,49 @@ test_expect_success 'credential_reject calls all helpers' ' | ||
158 | |||
159 | test_expect_success 'usernames can be preserved' ' | ||
160 | check fill "verbatim \"\" three" <<-\EOF | ||
161 | + protocol=http | ||
162 | + host=example.com | ||
163 | username=one | ||
164 | -- | ||
165 | + protocol=http | ||
166 | + host=example.com | ||
167 | username=one | ||
168 | password=three | ||
169 | -- | ||
170 | verbatim: get | ||
171 | + verbatim: protocol=http | ||
172 | + verbatim: host=example.com | ||
173 | verbatim: username=one | ||
174 | EOF | ||
175 | ' | ||
176 | |||
177 | test_expect_success 'usernames can be overridden' ' | ||
178 | check fill "verbatim two three" <<-\EOF | ||
179 | + protocol=http | ||
180 | + host=example.com | ||
181 | username=one | ||
182 | -- | ||
183 | + protocol=http | ||
184 | + host=example.com | ||
185 | username=two | ||
186 | password=three | ||
187 | -- | ||
188 | verbatim: get | ||
189 | + verbatim: protocol=http | ||
190 | + verbatim: host=example.com | ||
191 | verbatim: username=one | ||
192 | EOF | ||
193 | ' | ||
194 | |||
195 | test_expect_success 'do not bother completing already-full credential' ' | ||
196 | check fill "verbatim three four" <<-\EOF | ||
197 | + protocol=http | ||
198 | + host=example.com | ||
199 | username=one | ||
200 | password=two | ||
201 | -- | ||
202 | + protocol=http | ||
203 | + host=example.com | ||
204 | username=one | ||
205 | password=two | ||
206 | -- | ||
207 | @@ -179,23 +237,31 @@ test_expect_success 'do not bother completing already-full credential' ' | ||
208 | # askpass helper is run, we know the internal getpass is working. | ||
209 | test_expect_success 'empty helper list falls back to internal getpass' ' | ||
210 | check fill <<-\EOF | ||
211 | + protocol=http | ||
212 | + host=example.com | ||
213 | -- | ||
214 | + protocol=http | ||
215 | + host=example.com | ||
216 | username=askpass-username | ||
217 | password=askpass-password | ||
218 | -- | ||
219 | - askpass: Username: | ||
220 | - askpass: Password: | ||
221 | + askpass: Username for '\''http://example.com'\'': | ||
222 | + askpass: Password for '\''http://askpass-username@example.com'\'': | ||
223 | EOF | ||
224 | ' | ||
225 | |||
226 | test_expect_success 'internal getpass does not ask for known username' ' | ||
227 | check fill <<-\EOF | ||
228 | + protocol=http | ||
229 | + host=example.com | ||
230 | username=foo | ||
231 | -- | ||
232 | + protocol=http | ||
233 | + host=example.com | ||
234 | username=foo | ||
235 | password=askpass-password | ||
236 | -- | ||
237 | - askpass: Password: | ||
238 | + askpass: Password for '\''http://foo@example.com'\'': | ||
239 | EOF | ||
240 | ' | ||
241 | |||
242 | @@ -207,7 +273,11 @@ HELPER="!f() { | ||
243 | test_expect_success 'respect configured credentials' ' | ||
244 | test_config credential.helper "$HELPER" && | ||
245 | check fill <<-\EOF | ||
246 | + protocol=http | ||
247 | + host=example.com | ||
248 | -- | ||
249 | + protocol=http | ||
250 | + host=example.com | ||
251 | username=foo | ||
252 | password=bar | ||
253 | -- | ||
254 | @@ -298,11 +368,16 @@ test_expect_success 'helpers can abort the process' ' | ||
255 | test_must_fail git \ | ||
256 | -c credential.helper=quit \ | ||
257 | -c credential.helper="verbatim foo bar" \ | ||
258 | - credential fill >stdout 2>stderr && | ||
259 | + credential fill >stdout 2>stderr <<-\EOF && | ||
260 | + protocol=http | ||
261 | + host=example.com | ||
262 | + EOF | ||
263 | >expect && | ||
264 | test_cmp expect stdout && | ||
265 | cat >expect <<-\EOF && | ||
266 | quit: get | ||
267 | + quit: protocol=http | ||
268 | + quit: host=example.com | ||
269 | fatal: credential helper '\''quit'\'' told us to quit | ||
270 | EOF | ||
271 | test_i18ncmp expect stderr | ||
272 | @@ -311,11 +386,17 @@ test_expect_success 'helpers can abort the process' ' | ||
273 | test_expect_success 'empty helper spec resets helper list' ' | ||
274 | test_config credential.helper "verbatim file file" && | ||
275 | check fill "" "verbatim cmdline cmdline" <<-\EOF | ||
276 | + protocol=http | ||
277 | + host=example.com | ||
278 | -- | ||
279 | + protocol=http | ||
280 | + host=example.com | ||
281 | username=cmdline | ||
282 | password=cmdline | ||
283 | -- | ||
284 | verbatim: get | ||
285 | + verbatim: protocol=http | ||
286 | + verbatim: host=example.com | ||
287 | EOF | ||
288 | ' | ||
289 | |||
290 | -- | ||
291 | 1.9.1 | ||
292 | |||
diff --git a/meta/recipes-devtools/git/git/CVE-2020-11008-3.patch b/meta/recipes-devtools/git/git/CVE-2020-11008-3.patch new file mode 100644 index 0000000000..c17e883d6c --- /dev/null +++ b/meta/recipes-devtools/git/git/CVE-2020-11008-3.patch | |||
@@ -0,0 +1,97 @@ | |||
1 | From 22f28251ae575dd7a60f7a46853469025d004ca7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jeff King <peff@peff.net> | ||
3 | Date: Sat, 18 Apr 2020 20:48:05 -0700 | ||
4 | Subject: [PATCH 06/12] credential: parse URL without host as empty host, not | ||
5 | unset | ||
6 | |||
7 | We may feed a URL like "cert:///path/to/cert.pem" into the credential | ||
8 | machinery to get the key for a client-side certificate. That | ||
9 | credential has no hostname field, which is about to be disallowed (to | ||
10 | avoid confusion with protocols where a helper _would_ expect a | ||
11 | hostname). | ||
12 | |||
13 | This means as of the next patch, credential helpers won't work for | ||
14 | unlocking certs. Let's fix that by doing two things: | ||
15 | |||
16 | - when we parse a url with an empty host, set the host field to the | ||
17 | empty string (asking only to match stored entries with an empty | ||
18 | host) rather than NULL (asking to match _any_ host). | ||
19 | |||
20 | - when we build a cert:// credential by hand, similarly assign an | ||
21 | empty string | ||
22 | |||
23 | It's the latter that is more likely to impact real users in practice, | ||
24 | since it's what's used for http connections. But we don't have good | ||
25 | infrastructure to test it. | ||
26 | |||
27 | The url-parsing version will help anybody using git-credential in a | ||
28 | script, and is easy to test. | ||
29 | |||
30 | Signed-off-by: Jeff King <peff@peff.net> | ||
31 | Reviewed-by: Taylor Blau <me@ttaylorr.com> | ||
32 | Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> | ||
33 | |||
34 | Upstream-Status: Backport | ||
35 | CVE: CVE-2020-11008 (3) | ||
36 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
37 | --- | ||
38 | credential.c | 3 +-- | ||
39 | http.c | 1 + | ||
40 | t/t0300-credentials.sh | 17 +++++++++++++++++ | ||
41 | 3 files changed, 19 insertions(+), 2 deletions(-) | ||
42 | |||
43 | diff --git a/credential.c b/credential.c | ||
44 | index 2482382..f2413ce 100644 | ||
45 | --- a/credential.c | ||
46 | +++ b/credential.c | ||
47 | @@ -376,8 +376,7 @@ int credential_from_url_gently(struct credential *c, const char *url, | ||
48 | |||
49 | if (proto_end - url > 0) | ||
50 | c->protocol = xmemdupz(url, proto_end - url); | ||
51 | - if (slash - host > 0) | ||
52 | - c->host = url_decode_mem(host, slash - host); | ||
53 | + c->host = url_decode_mem(host, slash - host); | ||
54 | /* Trim leading and trailing slashes from path */ | ||
55 | while (*slash == '/') | ||
56 | slash++; | ||
57 | diff --git a/http.c b/http.c | ||
58 | index 27aa0a3..c4dfdac 100644 | ||
59 | --- a/http.c | ||
60 | +++ b/http.c | ||
61 | @@ -558,6 +558,7 @@ static int has_cert_password(void) | ||
62 | return 0; | ||
63 | if (!cert_auth.password) { | ||
64 | cert_auth.protocol = xstrdup("cert"); | ||
65 | + cert_auth.host = xstrdup(""); | ||
66 | cert_auth.username = xstrdup(""); | ||
67 | cert_auth.path = xstrdup(ssl_cert); | ||
68 | credential_fill(&cert_auth); | ||
69 | diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh | ||
70 | index f4c5d7f..1c1010b 100755 | ||
71 | --- a/t/t0300-credentials.sh | ||
72 | +++ b/t/t0300-credentials.sh | ||
73 | @@ -414,4 +414,21 @@ test_expect_success 'url parser ignores embedded newlines' ' | ||
74 | EOF | ||
75 | ' | ||
76 | |||
77 | +test_expect_success 'host-less URLs are parsed as empty host' ' | ||
78 | + check fill "verbatim foo bar" <<-\EOF | ||
79 | + url=cert:///path/to/cert.pem | ||
80 | + -- | ||
81 | + protocol=cert | ||
82 | + host= | ||
83 | + path=path/to/cert.pem | ||
84 | + username=foo | ||
85 | + password=bar | ||
86 | + -- | ||
87 | + verbatim: get | ||
88 | + verbatim: protocol=cert | ||
89 | + verbatim: host= | ||
90 | + verbatim: path=path/to/cert.pem | ||
91 | + EOF | ||
92 | +' | ||
93 | + | ||
94 | test_done | ||
95 | -- | ||
96 | 1.9.1 | ||
97 | |||
diff --git a/meta/recipes-devtools/git/git/CVE-2020-11008-4.patch b/meta/recipes-devtools/git/git/CVE-2020-11008-4.patch new file mode 100644 index 0000000000..14e23466d4 --- /dev/null +++ b/meta/recipes-devtools/git/git/CVE-2020-11008-4.patch | |||
@@ -0,0 +1,173 @@ | |||
1 | From f8bf7099379990ad974c1ca8f51e1f28bf18cf2a Mon Sep 17 00:00:00 2001 | ||
2 | From: Jeff King <peff@peff.net> | ||
3 | Date: Sat, 18 Apr 2020 20:50:48 -0700 | ||
4 | Subject: [PATCH 07/12] credential: refuse to operate when missing host or | ||
5 | protocol | ||
6 | |||
7 | The credential helper protocol was designed to be very flexible: the | ||
8 | fields it takes as input are treated as a pattern, and any missing | ||
9 | fields are taken as wildcards. This allows unusual things like: | ||
10 | |||
11 | echo protocol=https | git credential reject | ||
12 | |||
13 | to delete all stored https credentials (assuming the helpers themselves | ||
14 | treat the input that way). But when helpers are invoked automatically by | ||
15 | Git, this flexibility works against us. If for whatever reason we don't | ||
16 | have a "host" field, then we'd match _any_ host. When you're filling a | ||
17 | credential to send to a remote server, this is almost certainly not what | ||
18 | you want. | ||
19 | |||
20 | Prevent this at the layer that writes to the credential helper. Add a | ||
21 | check to the credential API that the host and protocol are always passed | ||
22 | in, and add an assertion to the credential_write function that speaks | ||
23 | credential helper protocol to be doubly sure. | ||
24 | |||
25 | There are a few ways this can be triggered in practice: | ||
26 | |||
27 | - the "git credential" command passes along arbitrary credential | ||
28 | parameters it reads from stdin. | ||
29 | |||
30 | - until the previous patch, when the host field of a URL is empty, we | ||
31 | would leave it unset (rather than setting it to the empty string) | ||
32 | |||
33 | - a URL like "example.com/foo.git" is treated by curl as if "http://" | ||
34 | was present, but our parser sees it as a non-URL and leaves all | ||
35 | fields unset | ||
36 | |||
37 | - the recent fix for URLs with embedded newlines blanks the URL but | ||
38 | otherwise continues. Rather than having the desired effect of | ||
39 | looking up no credential at all, many helpers will return _any_ | ||
40 | credential | ||
41 | |||
42 | Our earlier test for an embedded newline didn't catch this because it | ||
43 | only checked that the credential was cleared, but didn't configure an | ||
44 | actual helper. Configuring the "verbatim" helper in the test would show | ||
45 | that it is invoked (it's obviously a silly helper which doesn't look at | ||
46 | its input, but the point is that it shouldn't be run at all). Since | ||
47 | we're switching this case to die(), we don't need to bother with a | ||
48 | helper. We can see the new behavior just by checking that the operation | ||
49 | fails. | ||
50 | |||
51 | We'll add new tests covering partial input as well (these can be | ||
52 | triggered through various means with url-parsing, but it's simpler to | ||
53 | just check them directly, as we know we are covered even if the url | ||
54 | parser changes behavior in the future). | ||
55 | |||
56 | [jn: changed to die() instead of logging and showing a manual | ||
57 | username/password prompt] | ||
58 | |||
59 | Reported-by: Carlo Arenas <carenas@gmail.com> | ||
60 | Signed-off-by: Jeff King <peff@peff.net> | ||
61 | Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> | ||
62 | |||
63 | Upstream-Status: Backport | ||
64 | CVE: CVE-2020-11008 (4) | ||
65 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
66 | --- | ||
67 | credential.c | 20 ++++++++++++++------ | ||
68 | t/t0300-credentials.sh | 34 ++++++++++++++++++++++++++-------- | ||
69 | 2 files changed, 40 insertions(+), 14 deletions(-) | ||
70 | |||
71 | diff --git a/credential.c b/credential.c | ||
72 | index f2413ce..e08ed84 100644 | ||
73 | --- a/credential.c | ||
74 | +++ b/credential.c | ||
75 | @@ -89,6 +89,11 @@ static int proto_is_http(const char *s) | ||
76 | |||
77 | static void credential_apply_config(struct credential *c) | ||
78 | { | ||
79 | + if (!c->host) | ||
80 | + die(_("refusing to work with credential missing host field")); | ||
81 | + if (!c->protocol) | ||
82 | + die(_("refusing to work with credential missing protocol field")); | ||
83 | + | ||
84 | if (c->configured) | ||
85 | return; | ||
86 | git_config(credential_config_callback, c); | ||
87 | @@ -191,8 +196,11 @@ int credential_read(struct credential *c, FILE *fp) | ||
88 | return 0; | ||
89 | } | ||
90 | |||
91 | -static void credential_write_item(FILE *fp, const char *key, const char *value) | ||
92 | +static void credential_write_item(FILE *fp, const char *key, const char *value, | ||
93 | + int required) | ||
94 | { | ||
95 | + if (!value && required) | ||
96 | + BUG("credential value for %s is missing", key); | ||
97 | if (!value) | ||
98 | return; | ||
99 | if (strchr(value, '\n')) | ||
100 | @@ -202,11 +210,11 @@ static void credential_write_item(FILE *fp, const char *key, const char *value) | ||
101 | |||
102 | void credential_write(const struct credential *c, FILE *fp) | ||
103 | { | ||
104 | - credential_write_item(fp, "protocol", c->protocol); | ||
105 | - credential_write_item(fp, "host", c->host); | ||
106 | - credential_write_item(fp, "path", c->path); | ||
107 | - credential_write_item(fp, "username", c->username); | ||
108 | - credential_write_item(fp, "password", c->password); | ||
109 | + credential_write_item(fp, "protocol", c->protocol, 1); | ||
110 | + credential_write_item(fp, "host", c->host, 1); | ||
111 | + credential_write_item(fp, "path", c->path, 0); | ||
112 | + credential_write_item(fp, "username", c->username, 0); | ||
113 | + credential_write_item(fp, "password", c->password, 0); | ||
114 | } | ||
115 | |||
116 | static int run_credential_helper(struct credential *c, | ||
117 | diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh | ||
118 | index 1c1010b..646f845 100755 | ||
119 | --- a/t/t0300-credentials.sh | ||
120 | +++ b/t/t0300-credentials.sh | ||
121 | @@ -400,18 +400,16 @@ test_expect_success 'empty helper spec resets helper list' ' | ||
122 | EOF | ||
123 | ' | ||
124 | |||
125 | -test_expect_success 'url parser ignores embedded newlines' ' | ||
126 | - check fill <<-EOF | ||
127 | +test_expect_success 'url parser rejects embedded newlines' ' | ||
128 | + test_must_fail git credential fill 2>stderr <<-\EOF && | ||
129 | url=https://one.example.com?%0ahost=two.example.com/ | ||
130 | - -- | ||
131 | - username=askpass-username | ||
132 | - password=askpass-password | ||
133 | - -- | ||
134 | + EOF | ||
135 | + cat >expect <<-\EOF && | ||
136 | warning: url contains a newline in its host component: https://one.example.com?%0ahost=two.example.com/ | ||
137 | warning: skipping credential lookup for url: https://one.example.com?%0ahost=two.example.com/ | ||
138 | - askpass: Username: | ||
139 | - askpass: Password: | ||
140 | + fatal: refusing to work with credential missing host field | ||
141 | EOF | ||
142 | + test_i18ncmp expect stderr | ||
143 | ' | ||
144 | |||
145 | test_expect_success 'host-less URLs are parsed as empty host' ' | ||
146 | @@ -431,4 +429,24 @@ test_expect_success 'host-less URLs are parsed as empty host' ' | ||
147 | EOF | ||
148 | ' | ||
149 | |||
150 | +test_expect_success 'credential system refuses to work with missing host' ' | ||
151 | + test_must_fail git credential fill 2>stderr <<-\EOF && | ||
152 | + protocol=http | ||
153 | + EOF | ||
154 | + cat >expect <<-\EOF && | ||
155 | + fatal: refusing to work with credential missing host field | ||
156 | + EOF | ||
157 | + test_i18ncmp expect stderr | ||
158 | +' | ||
159 | + | ||
160 | +test_expect_success 'credential system refuses to work with missing protocol' ' | ||
161 | + test_must_fail git credential fill 2>stderr <<-\EOF && | ||
162 | + host=example.com | ||
163 | + EOF | ||
164 | + cat >expect <<-\EOF && | ||
165 | + fatal: refusing to work with credential missing protocol field | ||
166 | + EOF | ||
167 | + test_i18ncmp expect stderr | ||
168 | +' | ||
169 | + | ||
170 | test_done | ||
171 | -- | ||
172 | 1.9.1 | ||
173 | |||
diff --git a/meta/recipes-devtools/git/git/CVE-2020-11008-5.patch b/meta/recipes-devtools/git/git/CVE-2020-11008-5.patch new file mode 100644 index 0000000000..60f8d59082 --- /dev/null +++ b/meta/recipes-devtools/git/git/CVE-2020-11008-5.patch | |||
@@ -0,0 +1,211 @@ | |||
1 | From 3431abe8c0f64f4049a31298c0b1056baa7d81dc Mon Sep 17 00:00:00 2001 | ||
2 | From: Li Zhou <li.zhou@windriver.com> | ||
3 | Date: Mon, 27 Apr 2020 14:45:49 +0800 | ||
4 | Subject: [PATCH 08/12] fsck: convert gitmodules url to URL passed to curl | ||
5 | |||
6 | In 07259e74ec1 (fsck: detect gitmodules URLs with embedded newlines, | ||
7 | 2020-03-11), git fsck learned to check whether URLs in .gitmodules could | ||
8 | be understood by the credential machinery when they are handled by | ||
9 | git-remote-curl. | ||
10 | |||
11 | However, the check is overbroad: it checks all URLs instead of only | ||
12 | URLs that would be passed to git-remote-curl. In principle a git:// or | ||
13 | file:/// URL does not need to follow the same conventions as an http:// | ||
14 | URL; in particular, git:// and file:// protocols are not succeptible to | ||
15 | issues in the credential API because they do not support attaching | ||
16 | credentials. | ||
17 | |||
18 | In the HTTP case, the URL in .gitmodules does not always match the URL | ||
19 | that would be passed to git-remote-curl and the credential machinery: | ||
20 | Git's URL syntax allows specifying a remote helper followed by a "::" | ||
21 | delimiter and a URL to be passed to it, so that | ||
22 | |||
23 | git ls-remote http::https://example.com/repo.git | ||
24 | |||
25 | invokes git-remote-http with https://example.com/repo.git as its URL | ||
26 | argument. With today's checks, that distinction does not make a | ||
27 | difference, but for a check we are about to introduce (for empty URL | ||
28 | schemes) it will matter. | ||
29 | |||
30 | .gitmodules files also support relative URLs. To ensure coverage for the | ||
31 | https based embedded-newline attack, urldecode and check them directly | ||
32 | for embedded newlines. | ||
33 | |||
34 | Helped-by: Jeff King <peff@peff.net> | ||
35 | Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> | ||
36 | Reviewed-by: Jeff King <peff@peff.net> | ||
37 | |||
38 | Upstream-Status: Backport | ||
39 | CVE: CVE-2020-11008 (5) | ||
40 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
41 | --- | ||
42 | fsck.c | 94 ++++++++++++++++++++++++++++++++++++++++--- | ||
43 | t/t7416-submodule-dash-url.sh | 29 +++++++++++++ | ||
44 | 2 files changed, 118 insertions(+), 5 deletions(-) | ||
45 | |||
46 | diff --git a/fsck.c b/fsck.c | ||
47 | index ea46eea..0f21eb1 100644 | ||
48 | --- a/fsck.c | ||
49 | +++ b/fsck.c | ||
50 | @@ -9,6 +9,7 @@ | ||
51 | #include "tag.h" | ||
52 | #include "fsck.h" | ||
53 | #include "refs.h" | ||
54 | +#include "url.h" | ||
55 | #include "utf8.h" | ||
56 | #include "decorate.h" | ||
57 | #include "oidset.h" | ||
58 | @@ -948,17 +949,100 @@ static int fsck_tag(struct tag *tag, const char *data, | ||
59 | return fsck_tag_buffer(tag, data, size, options); | ||
60 | } | ||
61 | |||
62 | +/* | ||
63 | + * Like builtin/submodule--helper.c's starts_with_dot_slash, but without | ||
64 | + * relying on the platform-dependent is_dir_sep helper. | ||
65 | + * | ||
66 | + * This is for use in checking whether a submodule URL is interpreted as | ||
67 | + * relative to the current directory on any platform, since \ is a | ||
68 | + * directory separator on Windows but not on other platforms. | ||
69 | + */ | ||
70 | +static int starts_with_dot_slash(const char *str) | ||
71 | +{ | ||
72 | + return str[0] == '.' && (str[1] == '/' || str[1] == '\\'); | ||
73 | +} | ||
74 | + | ||
75 | +/* | ||
76 | + * Like starts_with_dot_slash, this is a variant of submodule--helper's | ||
77 | + * helper of the same name with the twist that it accepts backslash as a | ||
78 | + * directory separator even on non-Windows platforms. | ||
79 | + */ | ||
80 | +static int starts_with_dot_dot_slash(const char *str) | ||
81 | +{ | ||
82 | + return str[0] == '.' && starts_with_dot_slash(str + 1); | ||
83 | +} | ||
84 | + | ||
85 | +static int submodule_url_is_relative(const char *url) | ||
86 | +{ | ||
87 | + return starts_with_dot_slash(url) || starts_with_dot_dot_slash(url); | ||
88 | +} | ||
89 | + | ||
90 | +/* | ||
91 | + * Check whether a transport is implemented by git-remote-curl. | ||
92 | + * | ||
93 | + * If it is, returns 1 and writes the URL that would be passed to | ||
94 | + * git-remote-curl to the "out" parameter. | ||
95 | + * | ||
96 | + * Otherwise, returns 0 and leaves "out" untouched. | ||
97 | + * | ||
98 | + * Examples: | ||
99 | + * http::https://example.com/repo.git -> 1, https://example.com/repo.git | ||
100 | + * https://example.com/repo.git -> 1, https://example.com/repo.git | ||
101 | + * git://example.com/repo.git -> 0 | ||
102 | + * | ||
103 | + * This is for use in checking for previously exploitable bugs that | ||
104 | + * required a submodule URL to be passed to git-remote-curl. | ||
105 | + */ | ||
106 | +static int url_to_curl_url(const char *url, const char **out) | ||
107 | +{ | ||
108 | + /* | ||
109 | + * We don't need to check for case-aliases, "http.exe", and so | ||
110 | + * on because in the default configuration, is_transport_allowed | ||
111 | + * prevents URLs with those schemes from being cloned | ||
112 | + * automatically. | ||
113 | + */ | ||
114 | + if (skip_prefix(url, "http::", out) || | ||
115 | + skip_prefix(url, "https::", out) || | ||
116 | + skip_prefix(url, "ftp::", out) || | ||
117 | + skip_prefix(url, "ftps::", out)) | ||
118 | + return 1; | ||
119 | + if (starts_with(url, "http://") || | ||
120 | + starts_with(url, "https://") || | ||
121 | + starts_with(url, "ftp://") || | ||
122 | + starts_with(url, "ftps://")) { | ||
123 | + *out = url; | ||
124 | + return 1; | ||
125 | + } | ||
126 | + return 0; | ||
127 | +} | ||
128 | + | ||
129 | static int check_submodule_url(const char *url) | ||
130 | { | ||
131 | - struct credential c = CREDENTIAL_INIT; | ||
132 | - int ret; | ||
133 | + const char *curl_url; | ||
134 | |||
135 | if (looks_like_command_line_option(url)) | ||
136 | return -1; | ||
137 | |||
138 | - ret = credential_from_url_gently(&c, url, 1); | ||
139 | - credential_clear(&c); | ||
140 | - return ret; | ||
141 | + if (submodule_url_is_relative(url)) { | ||
142 | + /* | ||
143 | + * This could be appended to an http URL and url-decoded; | ||
144 | + * check for malicious characters. | ||
145 | + */ | ||
146 | + char *decoded = url_decode(url); | ||
147 | + int has_nl = !!strchr(decoded, '\n'); | ||
148 | + free(decoded); | ||
149 | + if (has_nl) | ||
150 | + return -1; | ||
151 | + } | ||
152 | + | ||
153 | + else if (url_to_curl_url(url, &curl_url)) { | ||
154 | + struct credential c = CREDENTIAL_INIT; | ||
155 | + int ret = credential_from_url_gently(&c, curl_url, 1); | ||
156 | + credential_clear(&c); | ||
157 | + return ret; | ||
158 | + } | ||
159 | + | ||
160 | + return 0; | ||
161 | } | ||
162 | |||
163 | struct fsck_gitmodules_data { | ||
164 | diff --git a/t/t7416-submodule-dash-url.sh b/t/t7416-submodule-dash-url.sh | ||
165 | index 41431b1..afdd255 100755 | ||
166 | --- a/t/t7416-submodule-dash-url.sh | ||
167 | +++ b/t/t7416-submodule-dash-url.sh | ||
168 | @@ -60,6 +60,20 @@ test_expect_success 'trailing backslash is handled correctly' ' | ||
169 | test_i18ngrep ! "unknown option" err | ||
170 | ' | ||
171 | |||
172 | +test_expect_success 'fsck permits embedded newline with unrecognized scheme' ' | ||
173 | + git checkout --orphan newscheme && | ||
174 | + cat >.gitmodules <<-\EOF && | ||
175 | + [submodule "foo"] | ||
176 | + url = "data://acjbkd%0akajfdickajkd" | ||
177 | + EOF | ||
178 | + git add .gitmodules && | ||
179 | + git commit -m "gitmodules with unrecognized scheme" && | ||
180 | + test_when_finished "rm -rf dst" && | ||
181 | + git init --bare dst && | ||
182 | + git -C dst config transfer.fsckObjects true && | ||
183 | + git push dst HEAD | ||
184 | +' | ||
185 | + | ||
186 | test_expect_success 'fsck rejects embedded newline in url' ' | ||
187 | # create an orphan branch to avoid existing .gitmodules objects | ||
188 | git checkout --orphan newline && | ||
189 | @@ -76,4 +90,19 @@ test_expect_success 'fsck rejects embedded newline in url' ' | ||
190 | grep gitmodulesUrl err | ||
191 | ' | ||
192 | |||
193 | +test_expect_success 'fsck rejects embedded newline in relative url' ' | ||
194 | + git checkout --orphan relative-newline && | ||
195 | + cat >.gitmodules <<-\EOF && | ||
196 | + [submodule "foo"] | ||
197 | + url = "./%0ahost=two.example.com/foo.git" | ||
198 | + EOF | ||
199 | + git add .gitmodules && | ||
200 | + git commit -m "relative url with newline" && | ||
201 | + test_when_finished "rm -rf dst" && | ||
202 | + git init --bare dst && | ||
203 | + git -C dst config transfer.fsckObjects true && | ||
204 | + test_must_fail git push dst HEAD 2>err && | ||
205 | + grep gitmodulesUrl err | ||
206 | +' | ||
207 | + | ||
208 | test_done | ||
209 | -- | ||
210 | 1.9.1 | ||
211 | |||
diff --git a/meta/recipes-devtools/git/git/CVE-2020-11008-6.patch b/meta/recipes-devtools/git/git/CVE-2020-11008-6.patch new file mode 100644 index 0000000000..6b36893030 --- /dev/null +++ b/meta/recipes-devtools/git/git/CVE-2020-11008-6.patch | |||
@@ -0,0 +1,84 @@ | |||
1 | From 883508bcebe87fbe7fb7392272e930c27c30fdc2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jeff King <peff@peff.net> | ||
3 | Date: Sat, 18 Apr 2020 20:53:09 -0700 | ||
4 | Subject: [PATCH 09/12] credential: die() when parsing invalid urls | ||
5 | |||
6 | When we try to initialize credential loading by URL and find that the | ||
7 | URL is invalid, we set all fields to NULL in order to avoid acting on | ||
8 | malicious input. Later when we request credentials, we diagonse the | ||
9 | erroneous input: | ||
10 | |||
11 | fatal: refusing to work with credential missing host field | ||
12 | |||
13 | This is problematic in two ways: | ||
14 | |||
15 | - The message doesn't tell the user *why* we are missing the host | ||
16 | field, so they can't tell from this message alone how to recover. | ||
17 | There can be intervening messages after the original warning of | ||
18 | bad input, so the user may not have the context to put two and two | ||
19 | together. | ||
20 | |||
21 | - The error only occurs when we actually need to get a credential. If | ||
22 | the URL permits anonymous access, the only encouragement the user gets | ||
23 | to correct their bogus URL is a quiet warning. | ||
24 | |||
25 | This is inconsistent with the check we perform in fsck, where any use | ||
26 | of such a URL as a submodule is an error. | ||
27 | |||
28 | When we see such a bogus URL, let's not try to be nice and continue | ||
29 | without helpers. Instead, die() immediately. This is simpler and | ||
30 | obviously safe. And there's very little chance of disrupting a normal | ||
31 | workflow. | ||
32 | |||
33 | It's _possible_ that somebody has a legitimate URL with a raw newline in | ||
34 | it. It already wouldn't work with credential helpers, so this patch | ||
35 | steps that up from an inconvenience to "we will refuse to work with it | ||
36 | at all". If such a case does exist, we should figure out a way to work | ||
37 | with it (especially if the newline is only in the path component, which | ||
38 | we normally don't even pass to helpers). But until we see a real report, | ||
39 | we're better off being defensive. | ||
40 | |||
41 | Reported-by: Carlo Arenas <carenas@gmail.com> | ||
42 | Signed-off-by: Jeff King <peff@peff.net> | ||
43 | Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> | ||
44 | |||
45 | Upstream-Status: Backport | ||
46 | CVE: CVE-2020-11008 (6) | ||
47 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
48 | --- | ||
49 | credential.c | 6 ++---- | ||
50 | t/t0300-credentials.sh | 3 +-- | ||
51 | 2 files changed, 3 insertions(+), 6 deletions(-) | ||
52 | |||
53 | diff --git a/credential.c b/credential.c | ||
54 | index e08ed84..22649d5 100644 | ||
55 | --- a/credential.c | ||
56 | +++ b/credential.c | ||
57 | @@ -408,8 +408,6 @@ int credential_from_url_gently(struct credential *c, const char *url, | ||
58 | |||
59 | void credential_from_url(struct credential *c, const char *url) | ||
60 | { | ||
61 | - if (credential_from_url_gently(c, url, 0) < 0) { | ||
62 | - warning(_("skipping credential lookup for url: %s"), url); | ||
63 | - credential_clear(c); | ||
64 | - } | ||
65 | + if (credential_from_url_gently(c, url, 0) < 0) | ||
66 | + die(_("credential url cannot be parsed: %s"), url); | ||
67 | } | ||
68 | diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh | ||
69 | index 646f845..efed3ea 100755 | ||
70 | --- a/t/t0300-credentials.sh | ||
71 | +++ b/t/t0300-credentials.sh | ||
72 | @@ -406,8 +406,7 @@ test_expect_success 'url parser rejects embedded newlines' ' | ||
73 | EOF | ||
74 | cat >expect <<-\EOF && | ||
75 | warning: url contains a newline in its host component: https://one.example.com?%0ahost=two.example.com/ | ||
76 | - warning: skipping credential lookup for url: https://one.example.com?%0ahost=two.example.com/ | ||
77 | - fatal: refusing to work with credential missing host field | ||
78 | + fatal: credential url cannot be parsed: https://one.example.com?%0ahost=two.example.com/ | ||
79 | EOF | ||
80 | test_i18ncmp expect stderr | ||
81 | ' | ||
82 | -- | ||
83 | 1.9.1 | ||
84 | |||
diff --git a/meta/recipes-devtools/git/git/CVE-2020-11008-7.patch b/meta/recipes-devtools/git/git/CVE-2020-11008-7.patch new file mode 100644 index 0000000000..5e3b6f1454 --- /dev/null +++ b/meta/recipes-devtools/git/git/CVE-2020-11008-7.patch | |||
@@ -0,0 +1,206 @@ | |||
1 | From 68acf8724e9cb2f67664dd980581c0022401daf0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jonathan Nieder <jrnieder@gmail.com> | ||
3 | Date: Sat, 18 Apr 2020 20:54:13 -0700 | ||
4 | Subject: [PATCH 10/12] credential: treat URL without scheme as invalid | ||
5 | |||
6 | libcurl permits making requests without a URL scheme specified. In | ||
7 | this case, it guesses the URL from the hostname, so I can run | ||
8 | |||
9 | git ls-remote http::ftp.example.com/path/to/repo | ||
10 | |||
11 | and it would make an FTP request. | ||
12 | |||
13 | Any user intentionally using such a URL is likely to have made a typo. | ||
14 | Unfortunately, credential_from_url is not able to determine the host and | ||
15 | protocol in order to determine appropriate credentials to send, and | ||
16 | until "credential: refuse to operate when missing host or protocol", | ||
17 | this resulted in another host's credentials being leaked to the named | ||
18 | host. | ||
19 | |||
20 | Teach credential_from_url_gently to consider such a URL to be invalid | ||
21 | so that fsck can detect and block gitmodules files with such URLs, | ||
22 | allowing server operators to avoid serving them to downstream users | ||
23 | running older versions of Git. | ||
24 | |||
25 | This also means that when such URLs are passed on the command line, Git | ||
26 | will print a clearer error so affected users can switch to the simpler | ||
27 | URL that explicitly specifies the host and protocol they intend. | ||
28 | |||
29 | One subtlety: .gitmodules files can contain relative URLs, representing | ||
30 | a URL relative to the URL they were cloned from. The relative URL | ||
31 | resolver used for .gitmodules can follow ".." components out of the path | ||
32 | part and past the host part of a URL, meaning that such a relative URL | ||
33 | can be used to traverse from a https://foo.example.com/innocent | ||
34 | superproject to a https::attacker.example.com/exploit submodule. | ||
35 | Fortunately a leading ':' in the first path component after a series of | ||
36 | leading './' and '../' components is unlikely to show up in other | ||
37 | contexts, so we can catch this by detecting that pattern. | ||
38 | |||
39 | Reported-by: Jeff King <peff@peff.net> | ||
40 | Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> | ||
41 | Reviewed-by: Jeff King <peff@peff.net> | ||
42 | |||
43 | Upstream-Status: Backport | ||
44 | CVE: CVE-2020-11008 (7) | ||
45 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
46 | --- | ||
47 | credential.c | 7 +++++-- | ||
48 | fsck.c | 47 +++++++++++++++++++++++++++++++++++++++++-- | ||
49 | t/t5550-http-fetch-dumb.sh | 7 ++----- | ||
50 | t/t7416-submodule-dash-url.sh | 32 +++++++++++++++++++++++++++++ | ||
51 | 4 files changed, 84 insertions(+), 9 deletions(-) | ||
52 | |||
53 | diff --git a/credential.c b/credential.c | ||
54 | index 22649d5..1e1aed5 100644 | ||
55 | --- a/credential.c | ||
56 | +++ b/credential.c | ||
57 | @@ -360,8 +360,11 @@ int credential_from_url_gently(struct credential *c, const char *url, | ||
58 | * (3) proto://<user>:<pass>@<host>/... | ||
59 | */ | ||
60 | proto_end = strstr(url, "://"); | ||
61 | - if (!proto_end) | ||
62 | - return 0; | ||
63 | + if (!proto_end) { | ||
64 | + if (!quiet) | ||
65 | + warning(_("url has no scheme: %s"), url); | ||
66 | + return -1; | ||
67 | + } | ||
68 | cp = proto_end + 3; | ||
69 | at = strchr(cp, '@'); | ||
70 | colon = strchr(cp, ':'); | ||
71 | diff --git a/fsck.c b/fsck.c | ||
72 | index 0f21eb1..30eac29 100644 | ||
73 | --- a/fsck.c | ||
74 | +++ b/fsck.c | ||
75 | @@ -978,6 +978,34 @@ static int submodule_url_is_relative(const char *url) | ||
76 | } | ||
77 | |||
78 | /* | ||
79 | + * Count directory components that a relative submodule URL should chop | ||
80 | + * from the remote_url it is to be resolved against. | ||
81 | + * | ||
82 | + * In other words, this counts "../" components at the start of a | ||
83 | + * submodule URL. | ||
84 | + * | ||
85 | + * Returns the number of directory components to chop and writes a | ||
86 | + * pointer to the next character of url after all leading "./" and | ||
87 | + * "../" components to out. | ||
88 | + */ | ||
89 | +static int count_leading_dotdots(const char *url, const char **out) | ||
90 | +{ | ||
91 | + int result = 0; | ||
92 | + while (1) { | ||
93 | + if (starts_with_dot_dot_slash(url)) { | ||
94 | + result++; | ||
95 | + url += strlen("../"); | ||
96 | + continue; | ||
97 | + } | ||
98 | + if (starts_with_dot_slash(url)) { | ||
99 | + url += strlen("./"); | ||
100 | + continue; | ||
101 | + } | ||
102 | + *out = url; | ||
103 | + return result; | ||
104 | + } | ||
105 | +} | ||
106 | +/* | ||
107 | * Check whether a transport is implemented by git-remote-curl. | ||
108 | * | ||
109 | * If it is, returns 1 and writes the URL that would be passed to | ||
110 | @@ -1024,15 +1052,30 @@ static int check_submodule_url(const char *url) | ||
111 | return -1; | ||
112 | |||
113 | if (submodule_url_is_relative(url)) { | ||
114 | + char *decoded; | ||
115 | + const char *next; | ||
116 | + int has_nl; | ||
117 | + | ||
118 | /* | ||
119 | * This could be appended to an http URL and url-decoded; | ||
120 | * check for malicious characters. | ||
121 | */ | ||
122 | - char *decoded = url_decode(url); | ||
123 | - int has_nl = !!strchr(decoded, '\n'); | ||
124 | + decoded = url_decode(url); | ||
125 | + has_nl = !!strchr(decoded, '\n'); | ||
126 | + | ||
127 | free(decoded); | ||
128 | if (has_nl) | ||
129 | return -1; | ||
130 | + | ||
131 | + /* | ||
132 | + * URLs which escape their root via "../" can overwrite | ||
133 | + * the host field and previous components, resolving to | ||
134 | + * URLs like https::example.com/submodule.git that were | ||
135 | + * susceptible to CVE-2020-11008. | ||
136 | + */ | ||
137 | + if (count_leading_dotdots(url, &next) > 0 && | ||
138 | + *next == ':') | ||
139 | + return -1; | ||
140 | } | ||
141 | |||
142 | else if (url_to_curl_url(url, &curl_url)) { | ||
143 | diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh | ||
144 | index b811d89..1c9e5d3 100755 | ||
145 | --- a/t/t5550-http-fetch-dumb.sh | ||
146 | +++ b/t/t5550-http-fetch-dumb.sh | ||
147 | @@ -321,11 +321,8 @@ test_expect_success 'git client does not send an empty Accept-Language' ' | ||
148 | ' | ||
149 | |||
150 | test_expect_success 'remote-http complains cleanly about malformed urls' ' | ||
151 | - # do not actually issue "list" or other commands, as we do not | ||
152 | - # want to rely on what curl would actually do with such a broken | ||
153 | - # URL. This is just about making sure we do not segfault during | ||
154 | - # initialization. | ||
155 | - test_must_fail git remote-http http::/example.com/repo.git | ||
156 | + test_must_fail git remote-http http::/example.com/repo.git 2>stderr && | ||
157 | + test_i18ngrep "url has no scheme" stderr | ||
158 | ' | ||
159 | |||
160 | test_expect_success 'redirects can be forbidden/allowed' ' | ||
161 | diff --git a/t/t7416-submodule-dash-url.sh b/t/t7416-submodule-dash-url.sh | ||
162 | index afdd255..249dc3d 100755 | ||
163 | --- a/t/t7416-submodule-dash-url.sh | ||
164 | +++ b/t/t7416-submodule-dash-url.sh | ||
165 | @@ -60,6 +60,38 @@ test_expect_success 'trailing backslash is handled correctly' ' | ||
166 | test_i18ngrep ! "unknown option" err | ||
167 | ' | ||
168 | |||
169 | +test_expect_success 'fsck rejects missing URL scheme' ' | ||
170 | + git checkout --orphan missing-scheme && | ||
171 | + cat >.gitmodules <<-\EOF && | ||
172 | + [submodule "foo"] | ||
173 | + url = http::one.example.com/foo.git | ||
174 | + EOF | ||
175 | + git add .gitmodules && | ||
176 | + test_tick && | ||
177 | + git commit -m "gitmodules with missing URL scheme" && | ||
178 | + test_when_finished "rm -rf dst" && | ||
179 | + git init --bare dst && | ||
180 | + git -C dst config transfer.fsckObjects true && | ||
181 | + test_must_fail git push dst HEAD 2>err && | ||
182 | + grep gitmodulesUrl err | ||
183 | +' | ||
184 | + | ||
185 | +test_expect_success 'fsck rejects relative URL resolving to missing scheme' ' | ||
186 | + git checkout --orphan relative-missing-scheme && | ||
187 | + cat >.gitmodules <<-\EOF && | ||
188 | + [submodule "foo"] | ||
189 | + url = "..\\../.\\../:one.example.com/foo.git" | ||
190 | + EOF | ||
191 | + git add .gitmodules && | ||
192 | + test_tick && | ||
193 | + git commit -m "gitmodules with relative URL that strips off scheme" && | ||
194 | + test_when_finished "rm -rf dst" && | ||
195 | + git init --bare dst && | ||
196 | + git -C dst config transfer.fsckObjects true && | ||
197 | + test_must_fail git push dst HEAD 2>err && | ||
198 | + grep gitmodulesUrl err | ||
199 | +' | ||
200 | + | ||
201 | test_expect_success 'fsck permits embedded newline with unrecognized scheme' ' | ||
202 | git checkout --orphan newscheme && | ||
203 | cat >.gitmodules <<-\EOF && | ||
204 | -- | ||
205 | 1.9.1 | ||
206 | |||
diff --git a/meta/recipes-devtools/git/git/CVE-2020-11008-8.patch b/meta/recipes-devtools/git/git/CVE-2020-11008-8.patch new file mode 100644 index 0000000000..935d47795f --- /dev/null +++ b/meta/recipes-devtools/git/git/CVE-2020-11008-8.patch | |||
@@ -0,0 +1,114 @@ | |||
1 | From 5e06d0781a963d62413ae7eab4eb78cc7195af8b Mon Sep 17 00:00:00 2001 | ||
2 | From: Jonathan Nieder <jrnieder@gmail.com> | ||
3 | Date: Sat, 18 Apr 2020 20:54:57 -0700 | ||
4 | Subject: [PATCH 11/12] credential: treat URL with empty scheme as invalid | ||
5 | |||
6 | Until "credential: refuse to operate when missing host or protocol", | ||
7 | Git's credential handling code interpreted URLs with empty scheme to | ||
8 | mean "give me credentials matching this host for any protocol". | ||
9 | |||
10 | Luckily libcurl does not recognize such URLs (it tries to look for a | ||
11 | protocol named "" and fails). Just in case that changes, let's reject | ||
12 | them within Git as well. This way, credential_from_url is guaranteed to | ||
13 | always produce a "struct credential" with protocol and host set. | ||
14 | |||
15 | Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> | ||
16 | |||
17 | Upstream-Status: Backport | ||
18 | CVE: CVE-2020-11008 (8) | ||
19 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
20 | --- | ||
21 | credential.c | 5 ++--- | ||
22 | t/t5550-http-fetch-dumb.sh | 9 +++++++++ | ||
23 | t/t7416-submodule-dash-url.sh | 32 ++++++++++++++++++++++++++++++++ | ||
24 | 3 files changed, 43 insertions(+), 3 deletions(-) | ||
25 | |||
26 | diff --git a/credential.c b/credential.c | ||
27 | index 1e1aed5..cf11cc9 100644 | ||
28 | --- a/credential.c | ||
29 | +++ b/credential.c | ||
30 | @@ -360,7 +360,7 @@ int credential_from_url_gently(struct credential *c, const char *url, | ||
31 | * (3) proto://<user>:<pass>@<host>/... | ||
32 | */ | ||
33 | proto_end = strstr(url, "://"); | ||
34 | - if (!proto_end) { | ||
35 | + if (!proto_end || proto_end == url) { | ||
36 | if (!quiet) | ||
37 | warning(_("url has no scheme: %s"), url); | ||
38 | return -1; | ||
39 | @@ -385,8 +385,7 @@ int credential_from_url_gently(struct credential *c, const char *url, | ||
40 | host = at + 1; | ||
41 | } | ||
42 | |||
43 | - if (proto_end - url > 0) | ||
44 | - c->protocol = xmemdupz(url, proto_end - url); | ||
45 | + c->protocol = xmemdupz(url, proto_end - url); | ||
46 | c->host = url_decode_mem(host, slash - host); | ||
47 | /* Trim leading and trailing slashes from path */ | ||
48 | while (*slash == '/') | ||
49 | diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh | ||
50 | index 1c9e5d3..ea2688b 100755 | ||
51 | --- a/t/t5550-http-fetch-dumb.sh | ||
52 | +++ b/t/t5550-http-fetch-dumb.sh | ||
53 | @@ -325,6 +325,15 @@ test_expect_success 'remote-http complains cleanly about malformed urls' ' | ||
54 | test_i18ngrep "url has no scheme" stderr | ||
55 | ' | ||
56 | |||
57 | +# NEEDSWORK: Writing commands to git-remote-curl can race against the latter | ||
58 | +# erroring out, producing SIGPIPE. Remove "ok=sigpipe" once transport-helper has | ||
59 | +# learned to handle early remote helper failures more cleanly. | ||
60 | +test_expect_success 'remote-http complains cleanly about empty scheme' ' | ||
61 | + test_must_fail ok=sigpipe git ls-remote \ | ||
62 | + http::${HTTPD_URL#http}/dumb/repo.git 2>stderr && | ||
63 | + test_i18ngrep "url has no scheme" stderr | ||
64 | +' | ||
65 | + | ||
66 | test_expect_success 'redirects can be forbidden/allowed' ' | ||
67 | test_must_fail git -c http.followRedirects=false \ | ||
68 | clone $HTTPD_URL/dumb-redir/repo.git dumb-redir && | ||
69 | diff --git a/t/t7416-submodule-dash-url.sh b/t/t7416-submodule-dash-url.sh | ||
70 | index 249dc3d..9309040 100755 | ||
71 | --- a/t/t7416-submodule-dash-url.sh | ||
72 | +++ b/t/t7416-submodule-dash-url.sh | ||
73 | @@ -92,6 +92,38 @@ test_expect_success 'fsck rejects relative URL resolving to missing scheme' ' | ||
74 | grep gitmodulesUrl err | ||
75 | ' | ||
76 | |||
77 | +test_expect_success 'fsck rejects empty URL scheme' ' | ||
78 | + git checkout --orphan empty-scheme && | ||
79 | + cat >.gitmodules <<-\EOF && | ||
80 | + [submodule "foo"] | ||
81 | + url = http::://one.example.com/foo.git | ||
82 | + EOF | ||
83 | + git add .gitmodules && | ||
84 | + test_tick && | ||
85 | + git commit -m "gitmodules with empty URL scheme" && | ||
86 | + test_when_finished "rm -rf dst" && | ||
87 | + git init --bare dst && | ||
88 | + git -C dst config transfer.fsckObjects true && | ||
89 | + test_must_fail git push dst HEAD 2>err && | ||
90 | + grep gitmodulesUrl err | ||
91 | +' | ||
92 | + | ||
93 | +test_expect_success 'fsck rejects relative URL resolving to empty scheme' ' | ||
94 | + git checkout --orphan relative-empty-scheme && | ||
95 | + cat >.gitmodules <<-\EOF && | ||
96 | + [submodule "foo"] | ||
97 | + url = ../../../:://one.example.com/foo.git | ||
98 | + EOF | ||
99 | + git add .gitmodules && | ||
100 | + test_tick && | ||
101 | + git commit -m "relative gitmodules URL resolving to empty scheme" && | ||
102 | + test_when_finished "rm -rf dst" && | ||
103 | + git init --bare dst && | ||
104 | + git -C dst config transfer.fsckObjects true && | ||
105 | + test_must_fail git push dst HEAD 2>err && | ||
106 | + grep gitmodulesUrl err | ||
107 | +' | ||
108 | + | ||
109 | test_expect_success 'fsck permits embedded newline with unrecognized scheme' ' | ||
110 | git checkout --orphan newscheme && | ||
111 | cat >.gitmodules <<-\EOF && | ||
112 | -- | ||
113 | 1.9.1 | ||
114 | |||
diff --git a/meta/recipes-devtools/git/git/CVE-2020-11008-9.patch b/meta/recipes-devtools/git/git/CVE-2020-11008-9.patch new file mode 100644 index 0000000000..22292dbbbf --- /dev/null +++ b/meta/recipes-devtools/git/git/CVE-2020-11008-9.patch | |||
@@ -0,0 +1,114 @@ | |||
1 | From 2e084e25fa454c58a600c9434f776f2150037a76 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jonathan Nieder <jrnieder@gmail.com> | ||
3 | Date: Sat, 18 Apr 2020 20:57:22 -0700 | ||
4 | Subject: [PATCH 12/12] fsck: reject URL with empty host in .gitmodules | ||
5 | |||
6 | Git's URL parser interprets | ||
7 | |||
8 | https:///example.com/repo.git | ||
9 | |||
10 | to have no host and a path of "example.com/repo.git". Curl, on the | ||
11 | other hand, internally redirects it to https://example.com/repo.git. As | ||
12 | a result, until "credential: parse URL without host as empty host, not | ||
13 | unset", tricking a user into fetching from such a URL would cause Git to | ||
14 | send credentials for another host to example.com. | ||
15 | |||
16 | Teach fsck to block and detect .gitmodules files using such a URL to | ||
17 | prevent sharing them with Git versions that are not yet protected. | ||
18 | |||
19 | A relative URL in a .gitmodules file could also be used to trigger this. | ||
20 | The relative URL resolver used for .gitmodules does not normalize | ||
21 | sequences of slashes and can follow ".." components out of the path part | ||
22 | and to the host part of a URL, meaning that such a relative URL can be | ||
23 | used to traverse from a https://foo.example.com/innocent superproject to | ||
24 | a https:///attacker.example.com/exploit submodule. Fortunately, | ||
25 | redundant extra slashes in .gitmodules are rare, so we can catch this by | ||
26 | detecting one after a leading sequence of "./" and "../" components. | ||
27 | |||
28 | Helped-by: Jeff King <peff@peff.net> | ||
29 | Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> | ||
30 | Reviewed-by: Jeff King <peff@peff.net> | ||
31 | |||
32 | Upstream-Status: Backport | ||
33 | CVE: CVE-2020-11008 (9) | ||
34 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
35 | --- | ||
36 | fsck.c | 10 +++++++--- | ||
37 | t/t7416-submodule-dash-url.sh | 32 ++++++++++++++++++++++++++++++++ | ||
38 | 2 files changed, 39 insertions(+), 3 deletions(-) | ||
39 | |||
40 | diff --git a/fsck.c b/fsck.c | ||
41 | index 30eac29..00077b1 100644 | ||
42 | --- a/fsck.c | ||
43 | +++ b/fsck.c | ||
44 | @@ -1070,17 +1070,21 @@ static int check_submodule_url(const char *url) | ||
45 | /* | ||
46 | * URLs which escape their root via "../" can overwrite | ||
47 | * the host field and previous components, resolving to | ||
48 | - * URLs like https::example.com/submodule.git that were | ||
49 | + * URLs like https::example.com/submodule.git and | ||
50 | + * https:///example.com/submodule.git that were | ||
51 | * susceptible to CVE-2020-11008. | ||
52 | */ | ||
53 | if (count_leading_dotdots(url, &next) > 0 && | ||
54 | - *next == ':') | ||
55 | + (*next == ':' || *next == '/')) | ||
56 | return -1; | ||
57 | } | ||
58 | |||
59 | else if (url_to_curl_url(url, &curl_url)) { | ||
60 | struct credential c = CREDENTIAL_INIT; | ||
61 | - int ret = credential_from_url_gently(&c, curl_url, 1); | ||
62 | + int ret = 0; | ||
63 | + if (credential_from_url_gently(&c, curl_url, 1) || | ||
64 | + !*c.host) | ||
65 | + ret = -1; | ||
66 | credential_clear(&c); | ||
67 | return ret; | ||
68 | } | ||
69 | diff --git a/t/t7416-submodule-dash-url.sh b/t/t7416-submodule-dash-url.sh | ||
70 | index 9309040..eec96e0 100755 | ||
71 | --- a/t/t7416-submodule-dash-url.sh | ||
72 | +++ b/t/t7416-submodule-dash-url.sh | ||
73 | @@ -124,6 +124,38 @@ test_expect_success 'fsck rejects relative URL resolving to empty scheme' ' | ||
74 | grep gitmodulesUrl err | ||
75 | ' | ||
76 | |||
77 | +test_expect_success 'fsck rejects empty hostname' ' | ||
78 | + git checkout --orphan empty-host && | ||
79 | + cat >.gitmodules <<-\EOF && | ||
80 | + [submodule "foo"] | ||
81 | + url = http:///one.example.com/foo.git | ||
82 | + EOF | ||
83 | + git add .gitmodules && | ||
84 | + test_tick && | ||
85 | + git commit -m "gitmodules with extra slashes" && | ||
86 | + test_when_finished "rm -rf dst" && | ||
87 | + git init --bare dst && | ||
88 | + git -C dst config transfer.fsckObjects true && | ||
89 | + test_must_fail git push dst HEAD 2>err && | ||
90 | + grep gitmodulesUrl err | ||
91 | +' | ||
92 | + | ||
93 | +test_expect_success 'fsck rejects relative url that produced empty hostname' ' | ||
94 | + git checkout --orphan messy-relative && | ||
95 | + cat >.gitmodules <<-\EOF && | ||
96 | + [submodule "foo"] | ||
97 | + url = ../../..//one.example.com/foo.git | ||
98 | + EOF | ||
99 | + git add .gitmodules && | ||
100 | + test_tick && | ||
101 | + git commit -m "gitmodules abusing relative_path" && | ||
102 | + test_when_finished "rm -rf dst" && | ||
103 | + git init --bare dst && | ||
104 | + git -C dst config transfer.fsckObjects true && | ||
105 | + test_must_fail git push dst HEAD 2>err && | ||
106 | + grep gitmodulesUrl err | ||
107 | +' | ||
108 | + | ||
109 | test_expect_success 'fsck permits embedded newline with unrecognized scheme' ' | ||
110 | git checkout --orphan newscheme && | ||
111 | cat >.gitmodules <<-\EOF && | ||
112 | -- | ||
113 | 1.9.1 | ||
114 | |||
diff --git a/meta/recipes-devtools/git/git/CVE-2020-5260.patch b/meta/recipes-devtools/git/git/CVE-2020-5260.patch new file mode 100644 index 0000000000..d03e701a8f --- /dev/null +++ b/meta/recipes-devtools/git/git/CVE-2020-5260.patch | |||
@@ -0,0 +1,65 @@ | |||
1 | From 9a6bbee8006c24b46a85d29e7b38cfa79e9ab21b Mon Sep 17 00:00:00 2001 | ||
2 | From: Jeff King <peff@peff.net> | ||
3 | Date: Wed, 11 Mar 2020 17:53:41 -0400 | ||
4 | Subject: [PATCH] credential: avoid writing values with newlines | ||
5 | |||
6 | The credential protocol that we use to speak to helpers can't represent | ||
7 | values with newlines in them. This was an intentional design choice to | ||
8 | keep the protocol simple, since none of the values we pass should | ||
9 | generally have newlines. | ||
10 | |||
11 | However, if we _do_ encounter a newline in a value, we blindly transmit | ||
12 | it in credential_write(). Such values may break the protocol syntax, or | ||
13 | worse, inject new valid lines into the protocol stream. | ||
14 | |||
15 | The most likely way for a newline to end up in a credential struct is by | ||
16 | decoding a URL with a percent-encoded newline. However, since the bug | ||
17 | occurs at the moment we write the value to the protocol, we'll catch it | ||
18 | there. That should leave no possibility of accidentally missing a code | ||
19 | path that can trigger the problem. | ||
20 | |||
21 | At this level of the code we have little choice but to die(). However, | ||
22 | since we'd not ever expect to see this case outside of a malicious URL, | ||
23 | that's an acceptable outcome. | ||
24 | |||
25 | Reported-by: Felix Wilhelm <fwilhelm@google.com> | ||
26 | |||
27 | Upstream-Status: Backport | ||
28 | CVE: CVE-2020-5260 | ||
29 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
30 | --- | ||
31 | credential.c | 2 ++ | ||
32 | t/t0300-credentials.sh | 6 ++++++ | ||
33 | 2 files changed, 8 insertions(+) | ||
34 | |||
35 | diff --git a/credential.c b/credential.c | ||
36 | index 9747f47..00ee4d6 100644 | ||
37 | --- a/credential.c | ||
38 | +++ b/credential.c | ||
39 | @@ -194,6 +194,8 @@ static void credential_write_item(FILE *fp, const char *key, const char *value) | ||
40 | { | ||
41 | if (!value) | ||
42 | return; | ||
43 | + if (strchr(value, '\n')) | ||
44 | + die("credential value for %s contains newline", key); | ||
45 | fprintf(fp, "%s=%s\n", key, value); | ||
46 | } | ||
47 | |||
48 | diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh | ||
49 | index 03bd31e..15cc3c5 100755 | ||
50 | --- a/t/t0300-credentials.sh | ||
51 | +++ b/t/t0300-credentials.sh | ||
52 | @@ -309,4 +309,10 @@ test_expect_success 'empty helper spec resets helper list' ' | ||
53 | EOF | ||
54 | ' | ||
55 | |||
56 | +test_expect_success 'url parser rejects embedded newlines' ' | ||
57 | + test_must_fail git credential fill <<-\EOF | ||
58 | + url=https://one.example.com?%0ahost=two.example.com/ | ||
59 | + EOF | ||
60 | +' | ||
61 | + | ||
62 | test_done | ||
63 | -- | ||
64 | 1.9.1 | ||
65 | |||
diff --git a/meta/recipes-devtools/go/go-1.12.inc b/meta/recipes-devtools/go/go-1.12.inc index 6aecaad75d..2a0680aeaa 100644 --- a/meta/recipes-devtools/go/go-1.12.inc +++ b/meta/recipes-devtools/go/go-1.12.inc | |||
@@ -18,6 +18,10 @@ SRC_URI += "\ | |||
18 | file://0008-use-GOBUILDMODE-to-set-buildmode.patch \ | 18 | file://0008-use-GOBUILDMODE-to-set-buildmode.patch \ |
19 | file://0001-release-branch.go1.12-security-net-textproto-don-t-n.patch \ | 19 | file://0001-release-branch.go1.12-security-net-textproto-don-t-n.patch \ |
20 | file://0010-fix-CVE-2019-17596.patch \ | 20 | file://0010-fix-CVE-2019-17596.patch \ |
21 | file://CVE-2020-15586.patch \ | ||
22 | file://CVE-2020-16845.patch \ | ||
23 | file://0001-net-http-cgi-rename-a-test-file-to-be-less-cute.patch \ | ||
24 | file://CVE-2020-24553.patch \ | ||
21 | " | 25 | " |
22 | SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch" | 26 | SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch" |
23 | 27 | ||
diff --git a/meta/recipes-devtools/go/go-1.12/0001-net-http-cgi-rename-a-test-file-to-be-less-cute.patch b/meta/recipes-devtools/go/go-1.12/0001-net-http-cgi-rename-a-test-file-to-be-less-cute.patch new file mode 100644 index 0000000000..7c07961c03 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.12/0001-net-http-cgi-rename-a-test-file-to-be-less-cute.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 8390c478600b852392cb116741b3cb239c94d123 Mon Sep 17 00:00:00 2001 | ||
2 | From: Brad Fitzpatrick <bradfitz@golang.org> | ||
3 | Date: Wed, 15 Jan 2020 18:08:10 +0000 | ||
4 | Subject: [PATCH] net/http/cgi: rename a test file to be less cute | ||
5 | |||
6 | My fault (from CL 4245070), sorry. | ||
7 | |||
8 | Change-Id: Ib95d3170dc326e74aa74c22421c4e44a8b00f577 | ||
9 | Reviewed-on: https://go-review.googlesource.com/c/go/+/214920 | ||
10 | Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> | ||
11 | TryBot-Result: Gobot Gobot <gobot@golang.org> | ||
12 | Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> | ||
13 | |||
14 | Upstream-Status: Backport | ||
15 | [lz: Add this patch for merging the patch for CVE-2020-24553] | ||
16 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
17 | --- | ||
18 | src/net/http/cgi/{matryoshka_test.go => integration_test.go} | 0 | ||
19 | 1 file changed, 0 insertions(+), 0 deletions(-) | ||
20 | rename src/net/http/cgi/{matryoshka_test.go => integration_test.go} (100%) | ||
21 | |||
22 | diff --git a/src/net/http/cgi/matryoshka_test.go b/src/net/http/cgi/integration_test.go | ||
23 | similarity index 100% | ||
24 | rename from src/net/http/cgi/matryoshka_test.go | ||
25 | rename to src/net/http/cgi/integration_test.go | ||
26 | -- | ||
27 | 2.17.1 | ||
28 | |||
diff --git a/meta/recipes-devtools/go/go-1.12/CVE-2020-15586.patch b/meta/recipes-devtools/go/go-1.12/CVE-2020-15586.patch new file mode 100644 index 0000000000..ebdc5aec6d --- /dev/null +++ b/meta/recipes-devtools/go/go-1.12/CVE-2020-15586.patch | |||
@@ -0,0 +1,131 @@ | |||
1 | From fa98f46741f818913a8c11b877520a548715131f Mon Sep 17 00:00:00 2001 | ||
2 | From: Russ Cox <rsc@golang.org> | ||
3 | Date: Mon, 13 Jul 2020 13:27:22 -0400 | ||
4 | Subject: [PATCH] net/http: synchronize "100 Continue" write and Handler writes | ||
5 | |||
6 | The expectContinueReader writes to the connection on the first | ||
7 | Request.Body read. Since a Handler might be doing a read in parallel or | ||
8 | before a write, expectContinueReader needs to synchronize with the | ||
9 | ResponseWriter, and abort if a response already went out. | ||
10 | |||
11 | The tests will land in a separate CL. | ||
12 | |||
13 | Fixes #34902 | ||
14 | Fixes CVE-2020-15586 | ||
15 | |||
16 | Change-Id: Icdd8dd539f45e8863762bd378194bb4741e875fc | ||
17 | Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/793350 | ||
18 | Reviewed-by: Filippo Valsorda <valsorda@google.com> | ||
19 | Reviewed-on: https://go-review.googlesource.com/c/go/+/242598 | ||
20 | Run-TryBot: Katie Hockman <katie@golang.org> | ||
21 | Reviewed-by: Filippo Valsorda <filippo@golang.org> | ||
22 | TryBot-Result: Gobot Gobot <gobot@golang.org> | ||
23 | |||
24 | Upstream-Status: Backport | ||
25 | CVE: CVE-2020-15586 | ||
26 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
27 | --- | ||
28 | src/net/http/server.go | 43 +++++++++++++++++++++++++++++++++++------- | ||
29 | 1 file changed, 36 insertions(+), 7 deletions(-) | ||
30 | |||
31 | diff --git a/src/net/http/server.go b/src/net/http/server.go | ||
32 | index a995a50658..d41b5f6f48 100644 | ||
33 | --- a/src/net/http/server.go | ||
34 | +++ b/src/net/http/server.go | ||
35 | @@ -425,6 +425,16 @@ type response struct { | ||
36 | wants10KeepAlive bool // HTTP/1.0 w/ Connection "keep-alive" | ||
37 | wantsClose bool // HTTP request has Connection "close" | ||
38 | |||
39 | + // canWriteContinue is a boolean value accessed as an atomic int32 | ||
40 | + // that says whether or not a 100 Continue header can be written | ||
41 | + // to the connection. | ||
42 | + // writeContinueMu must be held while writing the header. | ||
43 | + // These two fields together synchronize the body reader | ||
44 | + // (the expectContinueReader, which wants to write 100 Continue) | ||
45 | + // against the main writer. | ||
46 | + canWriteContinue atomicBool | ||
47 | + writeContinueMu sync.Mutex | ||
48 | + | ||
49 | w *bufio.Writer // buffers output in chunks to chunkWriter | ||
50 | cw chunkWriter | ||
51 | |||
52 | @@ -515,6 +525,7 @@ type atomicBool int32 | ||
53 | |||
54 | func (b *atomicBool) isSet() bool { return atomic.LoadInt32((*int32)(b)) != 0 } | ||
55 | func (b *atomicBool) setTrue() { atomic.StoreInt32((*int32)(b), 1) } | ||
56 | +func (b *atomicBool) setFalse() { atomic.StoreInt32((*int32)(b), 0) } | ||
57 | |||
58 | // declareTrailer is called for each Trailer header when the | ||
59 | // response header is written. It notes that a header will need to be | ||
60 | @@ -878,21 +889,27 @@ type expectContinueReader struct { | ||
61 | resp *response | ||
62 | readCloser io.ReadCloser | ||
63 | closed bool | ||
64 | - sawEOF bool | ||
65 | + sawEOF atomicBool | ||
66 | } | ||
67 | |||
68 | func (ecr *expectContinueReader) Read(p []byte) (n int, err error) { | ||
69 | if ecr.closed { | ||
70 | return 0, ErrBodyReadAfterClose | ||
71 | } | ||
72 | - if !ecr.resp.wroteContinue && !ecr.resp.conn.hijacked() { | ||
73 | - ecr.resp.wroteContinue = true | ||
74 | - ecr.resp.conn.bufw.WriteString("HTTP/1.1 100 Continue\r\n\r\n") | ||
75 | - ecr.resp.conn.bufw.Flush() | ||
76 | + w := ecr.resp | ||
77 | + if !w.wroteContinue && w.canWriteContinue.isSet() && !w.conn.hijacked() { | ||
78 | + w.wroteContinue = true | ||
79 | + w.writeContinueMu.Lock() | ||
80 | + if w.canWriteContinue.isSet() { | ||
81 | + w.conn.bufw.WriteString("HTTP/1.1 100 Continue\r\n\r\n") | ||
82 | + w.conn.bufw.Flush() | ||
83 | + w.canWriteContinue.setFalse() | ||
84 | + } | ||
85 | + w.writeContinueMu.Unlock() | ||
86 | } | ||
87 | n, err = ecr.readCloser.Read(p) | ||
88 | if err == io.EOF { | ||
89 | - ecr.sawEOF = true | ||
90 | + ecr.sawEOF.setTrue() | ||
91 | } | ||
92 | return | ||
93 | } | ||
94 | @@ -1311,7 +1328,7 @@ func (cw *chunkWriter) writeHeader(p []byte) { | ||
95 | // because we don't know if the next bytes on the wire will be | ||
96 | // the body-following-the-timer or the subsequent request. | ||
97 | // See Issue 11549. | ||
98 | - if ecr, ok := w.req.Body.(*expectContinueReader); ok && !ecr.sawEOF { | ||
99 | + if ecr, ok := w.req.Body.(*expectContinueReader); ok && !ecr.sawEOF.isSet() { | ||
100 | w.closeAfterReply = true | ||
101 | } | ||
102 | |||
103 | @@ -1561,6 +1578,17 @@ func (w *response) write(lenData int, dataB []byte, dataS string) (n int, err er | ||
104 | } | ||
105 | return 0, ErrHijacked | ||
106 | } | ||
107 | + | ||
108 | + if w.canWriteContinue.isSet() { | ||
109 | + // Body reader wants to write 100 Continue but hasn't yet. | ||
110 | + // Tell it not to. The store must be done while holding the lock | ||
111 | + // because the lock makes sure that there is not an active write | ||
112 | + // this very moment. | ||
113 | + w.writeContinueMu.Lock() | ||
114 | + w.canWriteContinue.setFalse() | ||
115 | + w.writeContinueMu.Unlock() | ||
116 | + } | ||
117 | + | ||
118 | if !w.wroteHeader { | ||
119 | w.WriteHeader(StatusOK) | ||
120 | } | ||
121 | @@ -1872,6 +1900,7 @@ func (c *conn) serve(ctx context.Context) { | ||
122 | if req.ProtoAtLeast(1, 1) && req.ContentLength != 0 { | ||
123 | // Wrap the Body reader with one that replies on the connection | ||
124 | req.Body = &expectContinueReader{readCloser: req.Body, resp: w} | ||
125 | + w.canWriteContinue.setTrue() | ||
126 | } | ||
127 | } else if req.Header.get("Expect") != "" { | ||
128 | w.sendExpectationFailed() | ||
129 | -- | ||
130 | 2.17.1 | ||
131 | |||
diff --git a/meta/recipes-devtools/go/go-1.12/CVE-2020-16845.patch b/meta/recipes-devtools/go/go-1.12/CVE-2020-16845.patch new file mode 100644 index 0000000000..80f467522f --- /dev/null +++ b/meta/recipes-devtools/go/go-1.12/CVE-2020-16845.patch | |||
@@ -0,0 +1,110 @@ | |||
1 | From 027d7241ce050d197e7fabea3d541ffbe3487258 Mon Sep 17 00:00:00 2001 | ||
2 | From: Katie Hockman <katie@golang.org> | ||
3 | Date: Tue, 4 Aug 2020 11:45:32 -0400 | ||
4 | Subject: [PATCH] encoding/binary: read at most MaxVarintLen64 bytes in | ||
5 | ReadUvarint | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | This CL ensures that ReadUvarint consumes only a limited | ||
11 | amount of input (instead of an unbounded amount). | ||
12 | |||
13 | On some inputs, ReadUvarint could read an arbitrary number | ||
14 | of bytes before deciding to return an overflow error. | ||
15 | After this CL, ReadUvarint returns that same overflow | ||
16 | error sooner, after reading at most MaxVarintLen64 bytes. | ||
17 | |||
18 | Fix authored by Robert Griesemer and Filippo Valsorda. | ||
19 | |||
20 | Thanks to Diederik Loerakker, Jonny Rhea, Raúl Kripalani, | ||
21 | and Preston Van Loon for reporting this. | ||
22 | |||
23 | Fixes #40618 | ||
24 | Fixes CVE-2020-16845 | ||
25 | |||
26 | Change-Id: Ie0cb15972f14c38b7cf7af84c45c4ce54909bb8f | ||
27 | Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/812099 | ||
28 | Reviewed-by: Filippo Valsorda <valsorda@google.com> | ||
29 | Reviewed-on: https://go-review.googlesource.com/c/go/+/247120 | ||
30 | Run-TryBot: Katie Hockman <katie@golang.org> | ||
31 | TryBot-Result: Gobot Gobot <gobot@golang.org> | ||
32 | Reviewed-by: Alexander Rakoczy <alex@golang.org> | ||
33 | |||
34 | Upstream-Status: Backport [https://github.com/golang/go.git] | ||
35 | CVE: CVE-2020-16845 | ||
36 | Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com> | ||
37 | --- | ||
38 | src/encoding/binary/varint.go | 5 +++-- | ||
39 | src/encoding/binary/varint_test.go | 18 ++++++++++++------ | ||
40 | 2 files changed, 15 insertions(+), 8 deletions(-) | ||
41 | |||
42 | diff --git a/src/encoding/binary/varint.go b/src/encoding/binary/varint.go | ||
43 | index bcb8ac9a45..38af61075c 100644 | ||
44 | --- a/src/encoding/binary/varint.go | ||
45 | +++ b/src/encoding/binary/varint.go | ||
46 | @@ -106,13 +106,13 @@ var overflow = errors.New("binary: varint overflows a 64-bit integer") | ||
47 | func ReadUvarint(r io.ByteReader) (uint64, error) { | ||
48 | var x uint64 | ||
49 | var s uint | ||
50 | - for i := 0; ; i++ { | ||
51 | + for i := 0; i < MaxVarintLen64; i++ { | ||
52 | b, err := r.ReadByte() | ||
53 | if err != nil { | ||
54 | return x, err | ||
55 | } | ||
56 | if b < 0x80 { | ||
57 | - if i > 9 || i == 9 && b > 1 { | ||
58 | + if i == 9 && b > 1 { | ||
59 | return x, overflow | ||
60 | } | ||
61 | return x | uint64(b)<<s, nil | ||
62 | @@ -120,6 +120,7 @@ func ReadUvarint(r io.ByteReader) (uint64, error) { | ||
63 | x |= uint64(b&0x7f) << s | ||
64 | s += 7 | ||
65 | } | ||
66 | + return x, overflow | ||
67 | } | ||
68 | |||
69 | // ReadVarint reads an encoded signed integer from r and returns it as an int64. | ||
70 | diff --git a/src/encoding/binary/varint_test.go b/src/encoding/binary/varint_test.go | ||
71 | index ca411ecbd6..6ef4c99505 100644 | ||
72 | --- a/src/encoding/binary/varint_test.go | ||
73 | +++ b/src/encoding/binary/varint_test.go | ||
74 | @@ -121,21 +121,27 @@ func TestBufferTooSmall(t *testing.T) { | ||
75 | } | ||
76 | } | ||
77 | |||
78 | -func testOverflow(t *testing.T, buf []byte, n0 int, err0 error) { | ||
79 | +func testOverflow(t *testing.T, buf []byte, x0 uint64, n0 int, err0 error) { | ||
80 | x, n := Uvarint(buf) | ||
81 | if x != 0 || n != n0 { | ||
82 | t.Errorf("Uvarint(%v): got x = %d, n = %d; want 0, %d", buf, x, n, n0) | ||
83 | } | ||
84 | |||
85 | - x, err := ReadUvarint(bytes.NewReader(buf)) | ||
86 | - if x != 0 || err != err0 { | ||
87 | - t.Errorf("ReadUvarint(%v): got x = %d, err = %s; want 0, %s", buf, x, err, err0) | ||
88 | + r := bytes.NewReader(buf) | ||
89 | + len := r.Len() | ||
90 | + x, err := ReadUvarint(r) | ||
91 | + if x != x0 || err != err0 { | ||
92 | + t.Errorf("ReadUvarint(%v): got x = %d, err = %s; want %d, %s", buf, x, err, x0, err0) | ||
93 | + } | ||
94 | + if read := len - r.Len(); read > MaxVarintLen64 { | ||
95 | + t.Errorf("ReadUvarint(%v): read more than MaxVarintLen64 bytes, got %d", buf, read) | ||
96 | } | ||
97 | } | ||
98 | |||
99 | func TestOverflow(t *testing.T) { | ||
100 | - testOverflow(t, []byte{0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x2}, -10, overflow) | ||
101 | - testOverflow(t, []byte{0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x1, 0, 0}, -13, overflow) | ||
102 | + testOverflow(t, []byte{0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x2}, 0, -10, overflow) | ||
103 | + testOverflow(t, []byte{0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x1, 0, 0}, 0, -13, overflow) | ||
104 | + testOverflow(t, []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, 1<<64-1, 0, overflow) // 11 bytes, should overflow | ||
105 | } | ||
106 | |||
107 | func TestNonCanonicalZero(t *testing.T) { | ||
108 | -- | ||
109 | 2.17.0 | ||
110 | |||
diff --git a/meta/recipes-devtools/go/go-1.12/CVE-2020-24553.patch b/meta/recipes-devtools/go/go-1.12/CVE-2020-24553.patch new file mode 100644 index 0000000000..18a218bc9a --- /dev/null +++ b/meta/recipes-devtools/go/go-1.12/CVE-2020-24553.patch | |||
@@ -0,0 +1,429 @@ | |||
1 | From eb07103a083237414145a45f029c873d57037e06 Mon Sep 17 00:00:00 2001 | ||
2 | From: Roberto Clapis <roberto@golang.org> | ||
3 | Date: Wed, 26 Aug 2020 08:53:03 +0200 | ||
4 | Subject: [PATCH] [release-branch.go1.15-security] net/http/cgi,net/http/fcgi: | ||
5 | add Content-Type detection | ||
6 | |||
7 | This CL ensures that responses served via CGI and FastCGI | ||
8 | have a Content-Type header based on the content of the | ||
9 | response if not explicitly set by handlers. | ||
10 | |||
11 | If the implementers of the handler did not explicitly | ||
12 | specify a Content-Type both CGI implementations would default | ||
13 | to "text/html", potentially causing cross-site scripting. | ||
14 | |||
15 | Thanks to RedTeam Pentesting GmbH for reporting this. | ||
16 | |||
17 | Fixes CVE-2020-24553 | ||
18 | |||
19 | Change-Id: I82cfc396309b5ab2e8d6e9a87eda8ea7e3799473 | ||
20 | Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/823217 | ||
21 | Reviewed-by: Russ Cox <rsc@google.com> | ||
22 | (cherry picked from commit 23d675d07fdc56aafd67c0a0b63d5b7e14708ff0) | ||
23 | Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/835311 | ||
24 | Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> | ||
25 | |||
26 | Upstream-Status: Backport | ||
27 | CVE: CVE-2020-24553 | ||
28 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
29 | --- | ||
30 | src/net/http/cgi/child.go | 36 ++++++++++----- | ||
31 | src/net/http/cgi/child_test.go | 69 ++++++++++++++++++++++++++++ | ||
32 | src/net/http/cgi/integration_test.go | 53 ++++++++++++++++++++- | ||
33 | src/net/http/fcgi/child.go | 39 ++++++++++++---- | ||
34 | src/net/http/fcgi/fcgi_test.go | 52 +++++++++++++++++++++ | ||
35 | 5 files changed, 227 insertions(+), 22 deletions(-) | ||
36 | |||
37 | diff --git a/src/net/http/cgi/child.go b/src/net/http/cgi/child.go | ||
38 | index 9474175f17..61de6165f6 100644 | ||
39 | --- a/src/net/http/cgi/child.go | ||
40 | +++ b/src/net/http/cgi/child.go | ||
41 | @@ -163,10 +163,12 @@ func Serve(handler http.Handler) error { | ||
42 | } | ||
43 | |||
44 | type response struct { | ||
45 | - req *http.Request | ||
46 | - header http.Header | ||
47 | - bufw *bufio.Writer | ||
48 | - headerSent bool | ||
49 | + req *http.Request | ||
50 | + header http.Header | ||
51 | + code int | ||
52 | + wroteHeader bool | ||
53 | + wroteCGIHeader bool | ||
54 | + bufw *bufio.Writer | ||
55 | } | ||
56 | |||
57 | func (r *response) Flush() { | ||
58 | @@ -178,26 +180,38 @@ func (r *response) Header() http.Header { | ||
59 | } | ||
60 | |||
61 | func (r *response) Write(p []byte) (n int, err error) { | ||
62 | - if !r.headerSent { | ||
63 | + if !r.wroteHeader { | ||
64 | r.WriteHeader(http.StatusOK) | ||
65 | } | ||
66 | + if !r.wroteCGIHeader { | ||
67 | + r.writeCGIHeader(p) | ||
68 | + } | ||
69 | return r.bufw.Write(p) | ||
70 | } | ||
71 | |||
72 | func (r *response) WriteHeader(code int) { | ||
73 | - if r.headerSent { | ||
74 | + if r.wroteHeader { | ||
75 | // Note: explicitly using Stderr, as Stdout is our HTTP output. | ||
76 | fmt.Fprintf(os.Stderr, "CGI attempted to write header twice on request for %s", r.req.URL) | ||
77 | return | ||
78 | } | ||
79 | - r.headerSent = true | ||
80 | - fmt.Fprintf(r.bufw, "Status: %d %s\r\n", code, http.StatusText(code)) | ||
81 | + r.wroteHeader = true | ||
82 | + r.code = code | ||
83 | +} | ||
84 | |||
85 | - // Set a default Content-Type | ||
86 | +// writeCGIHeader finalizes the header sent to the client and writes it to the output. | ||
87 | +// p is not written by writeHeader, but is the first chunk of the body | ||
88 | +// that will be written. It is sniffed for a Content-Type if none is | ||
89 | +// set explicitly. | ||
90 | +func (r *response) writeCGIHeader(p []byte) { | ||
91 | + if r.wroteCGIHeader { | ||
92 | + return | ||
93 | + } | ||
94 | + r.wroteCGIHeader = true | ||
95 | + fmt.Fprintf(r.bufw, "Status: %d %s\r\n", r.code, http.StatusText(r.code)) | ||
96 | if _, hasType := r.header["Content-Type"]; !hasType { | ||
97 | - r.header.Add("Content-Type", "text/html; charset=utf-8") | ||
98 | + r.header.Set("Content-Type", http.DetectContentType(p)) | ||
99 | } | ||
100 | - | ||
101 | r.header.Write(r.bufw) | ||
102 | r.bufw.WriteString("\r\n") | ||
103 | r.bufw.Flush() | ||
104 | diff --git a/src/net/http/cgi/child_test.go b/src/net/http/cgi/child_test.go | ||
105 | index 14e0af475f..f6ecb6eb80 100644 | ||
106 | --- a/src/net/http/cgi/child_test.go | ||
107 | +++ b/src/net/http/cgi/child_test.go | ||
108 | @@ -7,6 +7,11 @@ | ||
109 | package cgi | ||
110 | |||
111 | import ( | ||
112 | + "bufio" | ||
113 | + "bytes" | ||
114 | + "net/http" | ||
115 | + "net/http/httptest" | ||
116 | + "strings" | ||
117 | "testing" | ||
118 | ) | ||
119 | |||
120 | @@ -148,3 +153,67 @@ func TestRequestWithoutRemotePort(t *testing.T) { | ||
121 | t.Errorf("RemoteAddr: got %q; want %q", g, e) | ||
122 | } | ||
123 | } | ||
124 | + | ||
125 | +type countingWriter int | ||
126 | + | ||
127 | +func (c *countingWriter) Write(p []byte) (int, error) { | ||
128 | + *c += countingWriter(len(p)) | ||
129 | + return len(p), nil | ||
130 | +} | ||
131 | +func (c *countingWriter) WriteString(p string) (int, error) { | ||
132 | + *c += countingWriter(len(p)) | ||
133 | + return len(p), nil | ||
134 | +} | ||
135 | + | ||
136 | +func TestResponse(t *testing.T) { | ||
137 | + var tests = []struct { | ||
138 | + name string | ||
139 | + body string | ||
140 | + wantCT string | ||
141 | + }{ | ||
142 | + { | ||
143 | + name: "no body", | ||
144 | + wantCT: "text/plain; charset=utf-8", | ||
145 | + }, | ||
146 | + { | ||
147 | + name: "html", | ||
148 | + body: "<html><head><title>test page</title></head><body>This is a body</body></html>", | ||
149 | + wantCT: "text/html; charset=utf-8", | ||
150 | + }, | ||
151 | + { | ||
152 | + name: "text", | ||
153 | + body: strings.Repeat("gopher", 86), | ||
154 | + wantCT: "text/plain; charset=utf-8", | ||
155 | + }, | ||
156 | + { | ||
157 | + name: "jpg", | ||
158 | + body: "\xFF\xD8\xFF" + strings.Repeat("B", 1024), | ||
159 | + wantCT: "image/jpeg", | ||
160 | + }, | ||
161 | + } | ||
162 | + for _, tt := range tests { | ||
163 | + t.Run(tt.name, func(t *testing.T) { | ||
164 | + var buf bytes.Buffer | ||
165 | + resp := response{ | ||
166 | + req: httptest.NewRequest("GET", "/", nil), | ||
167 | + header: http.Header{}, | ||
168 | + bufw: bufio.NewWriter(&buf), | ||
169 | + } | ||
170 | + n, err := resp.Write([]byte(tt.body)) | ||
171 | + if err != nil { | ||
172 | + t.Errorf("Write: unexpected %v", err) | ||
173 | + } | ||
174 | + if want := len(tt.body); n != want { | ||
175 | + t.Errorf("reported short Write: got %v want %v", n, want) | ||
176 | + } | ||
177 | + resp.writeCGIHeader(nil) | ||
178 | + resp.Flush() | ||
179 | + if got := resp.Header().Get("Content-Type"); got != tt.wantCT { | ||
180 | + t.Errorf("wrong content-type: got %q, want %q", got, tt.wantCT) | ||
181 | + } | ||
182 | + if !bytes.HasSuffix(buf.Bytes(), []byte(tt.body)) { | ||
183 | + t.Errorf("body was not correctly written") | ||
184 | + } | ||
185 | + }) | ||
186 | + } | ||
187 | +} | ||
188 | diff --git a/src/net/http/cgi/integration_test.go b/src/net/http/cgi/integration_test.go | ||
189 | index 32d59c09a3..295c3b82d4 100644 | ||
190 | --- a/src/net/http/cgi/integration_test.go | ||
191 | +++ b/src/net/http/cgi/integration_test.go | ||
192 | @@ -16,7 +16,9 @@ import ( | ||
193 | "io" | ||
194 | "net/http" | ||
195 | "net/http/httptest" | ||
196 | + "net/url" | ||
197 | "os" | ||
198 | + "strings" | ||
199 | "testing" | ||
200 | "time" | ||
201 | ) | ||
202 | @@ -52,7 +54,7 @@ func TestHostingOurselves(t *testing.T) { | ||
203 | } | ||
204 | replay := runCgiTest(t, h, "GET /test.go?foo=bar&a=b HTTP/1.0\nHost: example.com\n\n", expectedMap) | ||
205 | |||
206 | - if expected, got := "text/html; charset=utf-8", replay.Header().Get("Content-Type"); got != expected { | ||
207 | + if expected, got := "text/plain; charset=utf-8", replay.Header().Get("Content-Type"); got != expected { | ||
208 | t.Errorf("got a Content-Type of %q; expected %q", got, expected) | ||
209 | } | ||
210 | if expected, got := "X-Test-Value", replay.Header().Get("X-Test-Header"); got != expected { | ||
211 | @@ -152,6 +154,51 @@ func TestChildOnlyHeaders(t *testing.T) { | ||
212 | } | ||
213 | } | ||
214 | |||
215 | +func TestChildContentType(t *testing.T) { | ||
216 | + testenv.MustHaveExec(t) | ||
217 | + | ||
218 | + h := &Handler{ | ||
219 | + Path: os.Args[0], | ||
220 | + Root: "/test.go", | ||
221 | + Args: []string{"-test.run=TestBeChildCGIProcess"}, | ||
222 | + } | ||
223 | + var tests = []struct { | ||
224 | + name string | ||
225 | + body string | ||
226 | + wantCT string | ||
227 | + }{ | ||
228 | + { | ||
229 | + name: "no body", | ||
230 | + wantCT: "text/plain; charset=utf-8", | ||
231 | + }, | ||
232 | + { | ||
233 | + name: "html", | ||
234 | + body: "<html><head><title>test page</title></head><body>This is a body</body></html>", | ||
235 | + wantCT: "text/html; charset=utf-8", | ||
236 | + }, | ||
237 | + { | ||
238 | + name: "text", | ||
239 | + body: strings.Repeat("gopher", 86), | ||
240 | + wantCT: "text/plain; charset=utf-8", | ||
241 | + }, | ||
242 | + { | ||
243 | + name: "jpg", | ||
244 | + body: "\xFF\xD8\xFF" + strings.Repeat("B", 1024), | ||
245 | + wantCT: "image/jpeg", | ||
246 | + }, | ||
247 | + } | ||
248 | + for _, tt := range tests { | ||
249 | + t.Run(tt.name, func(t *testing.T) { | ||
250 | + expectedMap := map[string]string{"_body": tt.body} | ||
251 | + req := fmt.Sprintf("GET /test.go?exact-body=%s HTTP/1.0\nHost: example.com\n\n", url.QueryEscape(tt.body)) | ||
252 | + replay := runCgiTest(t, h, req, expectedMap) | ||
253 | + if got := replay.Header().Get("Content-Type"); got != tt.wantCT { | ||
254 | + t.Errorf("got a Content-Type of %q; expected it to start with %q", got, tt.wantCT) | ||
255 | + } | ||
256 | + }) | ||
257 | + } | ||
258 | +} | ||
259 | + | ||
260 | // golang.org/issue/7198 | ||
261 | func Test500WithNoHeaders(t *testing.T) { want500Test(t, "/immediate-disconnect") } | ||
262 | func Test500WithNoContentType(t *testing.T) { want500Test(t, "/no-content-type") } | ||
263 | @@ -203,6 +250,10 @@ func TestBeChildCGIProcess(t *testing.T) { | ||
264 | if req.FormValue("no-body") == "1" { | ||
265 | return | ||
266 | } | ||
267 | + if eb, ok := req.Form["exact-body"]; ok { | ||
268 | + io.WriteString(rw, eb[0]) | ||
269 | + return | ||
270 | + } | ||
271 | if req.FormValue("write-forever") == "1" { | ||
272 | io.Copy(rw, neverEnding('a')) | ||
273 | for { | ||
274 | diff --git a/src/net/http/fcgi/child.go b/src/net/http/fcgi/child.go | ||
275 | index 30a6b2ce2d..a31273b3ec 100644 | ||
276 | --- a/src/net/http/fcgi/child.go | ||
277 | +++ b/src/net/http/fcgi/child.go | ||
278 | @@ -74,10 +74,12 @@ func (r *request) parseParams() { | ||
279 | |||
280 | // response implements http.ResponseWriter. | ||
281 | type response struct { | ||
282 | - req *request | ||
283 | - header http.Header | ||
284 | - w *bufWriter | ||
285 | - wroteHeader bool | ||
286 | + req *request | ||
287 | + header http.Header | ||
288 | + code int | ||
289 | + wroteHeader bool | ||
290 | + wroteCGIHeader bool | ||
291 | + w *bufWriter | ||
292 | } | ||
293 | |||
294 | func newResponse(c *child, req *request) *response { | ||
295 | @@ -92,11 +94,14 @@ func (r *response) Header() http.Header { | ||
296 | return r.header | ||
297 | } | ||
298 | |||
299 | -func (r *response) Write(data []byte) (int, error) { | ||
300 | +func (r *response) Write(p []byte) (n int, err error) { | ||
301 | if !r.wroteHeader { | ||
302 | r.WriteHeader(http.StatusOK) | ||
303 | } | ||
304 | - return r.w.Write(data) | ||
305 | + if !r.wroteCGIHeader { | ||
306 | + r.writeCGIHeader(p) | ||
307 | + } | ||
308 | + return r.w.Write(p) | ||
309 | } | ||
310 | |||
311 | func (r *response) WriteHeader(code int) { | ||
312 | @@ -104,22 +109,34 @@ func (r *response) WriteHeader(code int) { | ||
313 | return | ||
314 | } | ||
315 | r.wroteHeader = true | ||
316 | + r.code = code | ||
317 | if code == http.StatusNotModified { | ||
318 | // Must not have body. | ||
319 | r.header.Del("Content-Type") | ||
320 | r.header.Del("Content-Length") | ||
321 | r.header.Del("Transfer-Encoding") | ||
322 | - } else if r.header.Get("Content-Type") == "" { | ||
323 | - r.header.Set("Content-Type", "text/html; charset=utf-8") | ||
324 | } | ||
325 | - | ||
326 | if r.header.Get("Date") == "" { | ||
327 | r.header.Set("Date", time.Now().UTC().Format(http.TimeFormat)) | ||
328 | } | ||
329 | +} | ||
330 | |||
331 | - fmt.Fprintf(r.w, "Status: %d %s\r\n", code, http.StatusText(code)) | ||
332 | +// writeCGIHeader finalizes the header sent to the client and writes it to the output. | ||
333 | +// p is not written by writeHeader, but is the first chunk of the body | ||
334 | +// that will be written. It is sniffed for a Content-Type if none is | ||
335 | +// set explicitly. | ||
336 | +func (r *response) writeCGIHeader(p []byte) { | ||
337 | + if r.wroteCGIHeader { | ||
338 | + return | ||
339 | + } | ||
340 | + r.wroteCGIHeader = true | ||
341 | + fmt.Fprintf(r.w, "Status: %d %s\r\n", r.code, http.StatusText(r.code)) | ||
342 | + if _, hasType := r.header["Content-Type"]; r.code != http.StatusNotModified && !hasType { | ||
343 | + r.header.Set("Content-Type", http.DetectContentType(p)) | ||
344 | + } | ||
345 | r.header.Write(r.w) | ||
346 | r.w.WriteString("\r\n") | ||
347 | + r.w.Flush() | ||
348 | } | ||
349 | |||
350 | func (r *response) Flush() { | ||
351 | @@ -290,6 +307,8 @@ func (c *child) serveRequest(req *request, body io.ReadCloser) { | ||
352 | httpReq = httpReq.WithContext(envVarCtx) | ||
353 | c.handler.ServeHTTP(r, httpReq) | ||
354 | } | ||
355 | + // Make sure we serve something even if nothing was written to r | ||
356 | + r.Write(nil) | ||
357 | r.Close() | ||
358 | c.mu.Lock() | ||
359 | delete(c.requests, req.reqId) | ||
360 | diff --git a/src/net/http/fcgi/fcgi_test.go b/src/net/http/fcgi/fcgi_test.go | ||
361 | index e9d2b34023..4a27a12c35 100644 | ||
362 | --- a/src/net/http/fcgi/fcgi_test.go | ||
363 | +++ b/src/net/http/fcgi/fcgi_test.go | ||
364 | @@ -10,6 +10,7 @@ import ( | ||
365 | "io" | ||
366 | "io/ioutil" | ||
367 | "net/http" | ||
368 | + "strings" | ||
369 | "testing" | ||
370 | ) | ||
371 | |||
372 | @@ -344,3 +345,54 @@ func TestChildServeReadsEnvVars(t *testing.T) { | ||
373 | <-done | ||
374 | } | ||
375 | } | ||
376 | + | ||
377 | +func TestResponseWriterSniffsContentType(t *testing.T) { | ||
378 | + var tests = []struct { | ||
379 | + name string | ||
380 | + body string | ||
381 | + wantCT string | ||
382 | + }{ | ||
383 | + { | ||
384 | + name: "no body", | ||
385 | + wantCT: "text/plain; charset=utf-8", | ||
386 | + }, | ||
387 | + { | ||
388 | + name: "html", | ||
389 | + body: "<html><head><title>test page</title></head><body>This is a body</body></html>", | ||
390 | + wantCT: "text/html; charset=utf-8", | ||
391 | + }, | ||
392 | + { | ||
393 | + name: "text", | ||
394 | + body: strings.Repeat("gopher", 86), | ||
395 | + wantCT: "text/plain; charset=utf-8", | ||
396 | + }, | ||
397 | + { | ||
398 | + name: "jpg", | ||
399 | + body: "\xFF\xD8\xFF" + strings.Repeat("B", 1024), | ||
400 | + wantCT: "image/jpeg", | ||
401 | + }, | ||
402 | + } | ||
403 | + for _, tt := range tests { | ||
404 | + t.Run(tt.name, func(t *testing.T) { | ||
405 | + input := make([]byte, len(streamFullRequestStdin)) | ||
406 | + copy(input, streamFullRequestStdin) | ||
407 | + rc := nopWriteCloser{bytes.NewBuffer(input)} | ||
408 | + done := make(chan bool) | ||
409 | + var resp *response | ||
410 | + c := newChild(rc, http.HandlerFunc(func( | ||
411 | + w http.ResponseWriter, | ||
412 | + r *http.Request, | ||
413 | + ) { | ||
414 | + io.WriteString(w, tt.body) | ||
415 | + resp = w.(*response) | ||
416 | + done <- true | ||
417 | + })) | ||
418 | + defer c.cleanUp() | ||
419 | + go c.serve() | ||
420 | + <-done | ||
421 | + if got := resp.Header().Get("Content-Type"); got != tt.wantCT { | ||
422 | + t.Errorf("got a Content-Type of %q; expected it to start with %q", got, tt.wantCT) | ||
423 | + } | ||
424 | + }) | ||
425 | + } | ||
426 | +} | ||
427 | -- | ||
428 | 2.17.1 | ||
429 | |||
diff --git a/meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-Fix-return-value-of-ubiformat.patch b/meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-Fix-return-value-of-ubiformat.patch new file mode 100644 index 0000000000..d43f7e1a7a --- /dev/null +++ b/meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-Fix-return-value-of-ubiformat.patch | |||
@@ -0,0 +1,62 @@ | |||
1 | From 4d19bffcfd66e25d3ee74536ae2d2da7ad52e8e2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Barry Grussling <barry@grussling.com> | ||
3 | Date: Sun, 12 Jan 2020 12:33:32 -0800 | ||
4 | Subject: [PATCH] mtd-utils: Fix return value of ubiformat | ||
5 | Organization: O.S. Systems Software LTDA. | ||
6 | |||
7 | This changeset fixes a feature regression in ubiformat. Older versions of | ||
8 | ubiformat, when invoked with a flash-image, would return 0 in the case no error | ||
9 | was encountered. Upon upgrading to latest, it was discovered that ubiformat | ||
10 | returned 255 even without encountering an error condition. | ||
11 | |||
12 | This changeset corrects the above issue and causes ubiformat, when given an | ||
13 | image file, to return 0 when no errors are detected. | ||
14 | |||
15 | Tested by running through my loading scripts and verifying ubiformat returned | ||
16 | 0. | ||
17 | |||
18 | Upstream-Status: Backport [2.1.2] | ||
19 | |||
20 | Signed-off-by: Barry Grussling <barry@grussling.com> | ||
21 | Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at> | ||
22 | Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> | ||
23 | --- | ||
24 | ubi-utils/ubiformat.c | 7 +++++-- | ||
25 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
26 | |||
27 | diff --git a/ubi-utils/ubiformat.c b/ubi-utils/ubiformat.c | ||
28 | index a90627c..5377b12 100644 | ||
29 | --- a/ubi-utils/ubiformat.c | ||
30 | +++ b/ubi-utils/ubiformat.c | ||
31 | @@ -550,6 +550,7 @@ static int format(libmtd_t libmtd, const struct mtd_dev_info *mtd, | ||
32 | struct ubi_vtbl_record *vtbl; | ||
33 | int eb1 = -1, eb2 = -1; | ||
34 | long long ec1 = -1, ec2 = -1; | ||
35 | + int ret = -1; | ||
36 | |||
37 | write_size = UBI_EC_HDR_SIZE + mtd->subpage_size - 1; | ||
38 | write_size /= mtd->subpage_size; | ||
39 | @@ -643,8 +644,10 @@ static int format(libmtd_t libmtd, const struct mtd_dev_info *mtd, | ||
40 | if (!args.quiet && !args.verbose) | ||
41 | printf("\n"); | ||
42 | |||
43 | - if (novtbl) | ||
44 | + if (novtbl) { | ||
45 | + ret = 0; | ||
46 | goto out_free; | ||
47 | + } | ||
48 | |||
49 | if (eb1 == -1 || eb2 == -1) { | ||
50 | errmsg("no eraseblocks for volume table"); | ||
51 | @@ -669,7 +672,7 @@ static int format(libmtd_t libmtd, const struct mtd_dev_info *mtd, | ||
52 | |||
53 | out_free: | ||
54 | free(hdr); | ||
55 | - return -1; | ||
56 | + return ret; | ||
57 | } | ||
58 | |||
59 | int main(int argc, char * const argv[]) | ||
60 | -- | ||
61 | 2.27.0 | ||
62 | |||
diff --git a/meta/recipes-devtools/mtd/mtd-utils_git.bb b/meta/recipes-devtools/mtd/mtd-utils_git.bb index 810fe40f4e..d1658a739b 100644 --- a/meta/recipes-devtools/mtd/mtd-utils_git.bb +++ b/meta/recipes-devtools/mtd/mtd-utils_git.bb | |||
@@ -15,6 +15,7 @@ PV = "2.1.1" | |||
15 | SRCREV = "4443221ce9b88440cd9f5bb78e6fe95621d36c8a" | 15 | SRCREV = "4443221ce9b88440cd9f5bb78e6fe95621d36c8a" |
16 | SRC_URI = "git://git.infradead.org/mtd-utils.git \ | 16 | SRC_URI = "git://git.infradead.org/mtd-utils.git \ |
17 | file://add-exclusion-to-mkfs-jffs2-git-2.patch \ | 17 | file://add-exclusion-to-mkfs-jffs2-git-2.patch \ |
18 | file://0001-mtd-utils-Fix-return-value-of-ubiformat.patch \ | ||
18 | " | 19 | " |
19 | 20 | ||
20 | S = "${WORKDIR}/git/" | 21 | S = "${WORKDIR}/git/" |
diff --git a/meta/recipes-devtools/patchelf/patchelf/fix-phdrs.patch b/meta/recipes-devtools/patchelf/patchelf/fix-phdrs.patch new file mode 100644 index 0000000000..d087bd7855 --- /dev/null +++ b/meta/recipes-devtools/patchelf/patchelf/fix-phdrs.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | When running patchelf on some existing patchelf'd binaries to change to longer | ||
2 | RPATHS, ldd would report the binaries as invalid. The output of objdump -x on | ||
3 | those libraryies should show the top of the .dynamic section is getting trashed, | ||
4 | something like: | ||
5 | |||
6 | 0x600000001 0x0000000000429000 | ||
7 | 0x335000 0x0000000000335000 | ||
8 | 0xc740 0x000000000000c740 | ||
9 | 0x1000 0x0000000000009098 | ||
10 | SONAME libglib-2.0.so.0 | ||
11 | |||
12 | (which should be RPATH and DT_NEEDED entries) | ||
13 | |||
14 | This was tracked down to the code which injects the PT_LOAD section. | ||
15 | |||
16 | The issue is that if the program headers were previously relocated to the end | ||
17 | of the file which was how patchelf operated previously, the relocation code | ||
18 | wouldn't work properly on a second run as it now assumes they're located after | ||
19 | the elf header. This change forces them back to immediately follow the elf | ||
20 | header which is where the code has made space for them. | ||
21 | |||
22 | Upstream-Status: Submitted [https://github.com/NixOS/patchelf/pull/202] | ||
23 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
24 | RP 2020/6/2 | ||
25 | |||
26 | Index: git/src/patchelf.cc | ||
27 | =================================================================== | ||
28 | --- git.orig/src/patchelf.cc | ||
29 | +++ git/src/patchelf.cc | ||
30 | @@ -762,6 +762,7 @@ void ElfFile<ElfFileParamNames>::rewrite | ||
31 | } | ||
32 | |||
33 | /* Add a segment that maps the replaced sections into memory. */ | ||
34 | + wri(hdr->e_phoff, sizeof(Elf_Ehdr)); | ||
35 | phdrs.resize(rdi(hdr->e_phnum) + 1); | ||
36 | wri(hdr->e_phnum, rdi(hdr->e_phnum) + 1); | ||
37 | Elf_Phdr & phdr = phdrs[rdi(hdr->e_phnum) - 1]; | ||
diff --git a/meta/recipes-devtools/patchelf/patchelf_0.10.bb b/meta/recipes-devtools/patchelf/patchelf_0.10.bb index cc983e033a..e4a604ec70 100644 --- a/meta/recipes-devtools/patchelf/patchelf_0.10.bb +++ b/meta/recipes-devtools/patchelf/patchelf_0.10.bb | |||
@@ -1,6 +1,7 @@ | |||
1 | SRC_URI = "https://nixos.org/releases/${BPN}/${BPN}-${PV}/${BPN}-${PV}.tar.bz2 \ | 1 | SRC_URI = "https://nixos.org/releases/${BPN}/${BPN}-${PV}/${BPN}-${PV}.tar.bz2 \ |
2 | file://handle-read-only-files.patch \ | 2 | file://handle-read-only-files.patch \ |
3 | file://fix-adjusting-startPage.patch \ | 3 | file://fix-adjusting-startPage.patch \ |
4 | file://fix-phdrs.patch \ | ||
4 | " | 5 | " |
5 | 6 | ||
6 | LICENSE = "GPLv3" | 7 | LICENSE = "GPLv3" |
diff --git a/meta/recipes-devtools/perl/files/0001-tests-adjust-to-correctly-exclude-unbuilt-extensions.patch b/meta/recipes-devtools/perl/files/0001-tests-adjust-to-correctly-exclude-unbuilt-extensions.patch new file mode 100644 index 0000000000..0f3a2c6327 --- /dev/null +++ b/meta/recipes-devtools/perl/files/0001-tests-adjust-to-correctly-exclude-unbuilt-extensions.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From b0d53cfd785f64002128ac5eecc4aed0663d9c30 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | ||
3 | Date: Thu, 9 Jan 2020 17:26:55 +0100 | ||
4 | Subject: [PATCH] tests: adjust to correctly exclude unbuilt extensions | ||
5 | |||
6 | Issue is reported here: | ||
7 | https://github.com/arsv/perl-cross/issues/85 | ||
8 | |||
9 | Upstream-Status: Inappropriate [issue caused by perl-cross] | ||
10 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | ||
11 | --- | ||
12 | t/TEST | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/t/TEST b/t/TEST | ||
16 | index a9c844f..8d3505f 100755 | ||
17 | --- a/t/TEST | ||
18 | +++ b/t/TEST | ||
19 | @@ -419,7 +419,7 @@ sub _tests_from_manifest { | ||
20 | while (<MANI>) { | ||
21 | if (m!^((?:cpan|dist|ext)/(\S+)/+(?:[^/\s]+\.t|test\.pl)|lib/\S+?(?:\.t|test\.pl))\s!) { | ||
22 | my $t = $1; | ||
23 | - my $extension = $2; | ||
24 | + my $extension = $1."/".$2; | ||
25 | |||
26 | # XXX Generates way too many error lines currently. Skip for | ||
27 | # v5.22 | ||
diff --git a/meta/recipes-devtools/perl/files/CVE-2020-10543.patch b/meta/recipes-devtools/perl/files/CVE-2020-10543.patch new file mode 100644 index 0000000000..36dff0aac9 --- /dev/null +++ b/meta/recipes-devtools/perl/files/CVE-2020-10543.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From 897d1f7fd515b828e4b198d8b8bef76c6faf03ed Mon Sep 17 00:00:00 2001 | ||
2 | From: John Lightsey <jd@cpanel.net> | ||
3 | Date: Wed, 20 Nov 2019 20:02:45 -0600 | ||
4 | Subject: [PATCH] regcomp.c: Prevent integer overflow from nested regex | ||
5 | quantifiers. | ||
6 | |||
7 | (CVE-2020-10543) On 32bit systems the size calculations for nested regular | ||
8 | expression quantifiers could overflow causing heap memory corruption. | ||
9 | |||
10 | Fixes: Perl/perl5-security#125 | ||
11 | (cherry picked from commit bfd31397db5dc1a5c5d3e0a1f753a4f89a736e71) | ||
12 | |||
13 | Upstream-Status: Backport [https://github.com/perl/perl5/commit/897d1f7fd515b828e4b198d8b8bef76c6faf03ed] | ||
14 | CVE: CVE-2020-10543 | ||
15 | Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> | ||
16 | --- | ||
17 | regcomp.c | 6 ++++++ | ||
18 | 1 file changed, 6 insertions(+) | ||
19 | |||
20 | diff --git a/regcomp.c b/regcomp.c | ||
21 | index 93c8d98fbb0..5f86be8086d 100644 | ||
22 | --- a/regcomp.c | ||
23 | +++ b/regcomp.c | ||
24 | @@ -5489,6 +5489,12 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, | ||
25 | RExC_precomp))); | ||
26 | } | ||
27 | |||
28 | + if ( ( minnext > 0 && mincount >= SSize_t_MAX / minnext ) | ||
29 | + || min >= SSize_t_MAX - minnext * mincount ) | ||
30 | + { | ||
31 | + FAIL("Regexp out of space"); | ||
32 | + } | ||
33 | + | ||
34 | min += minnext * mincount; | ||
35 | is_inf_internal |= deltanext == SSize_t_MAX | ||
36 | || (maxcount == REG_INFTY && minnext + deltanext > 0); | ||
diff --git a/meta/recipes-devtools/perl/files/CVE-2020-10878_1.patch b/meta/recipes-devtools/perl/files/CVE-2020-10878_1.patch new file mode 100644 index 0000000000..b86085a551 --- /dev/null +++ b/meta/recipes-devtools/perl/files/CVE-2020-10878_1.patch | |||
@@ -0,0 +1,152 @@ | |||
1 | From 0a320d753fe7fca03df259a4dfd8e641e51edaa8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Hugo van der Sanden <hv@crypt.org> | ||
3 | Date: Tue, 18 Feb 2020 13:51:16 +0000 | ||
4 | Subject: [PATCH] study_chunk: extract rck_elide_nothing | ||
5 | |||
6 | (CVE-2020-10878) | ||
7 | |||
8 | (cherry picked from commit 93dee06613d4e1428fb10905ce1c3c96f53113dc) | ||
9 | |||
10 | Upstream-Status: Backport [https://github.com/perl/perl5/commit/0a320d753fe7fca03df259a4dfd8e641e51edaa8] | ||
11 | CVE: CVE-2020-10878 | ||
12 | Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> | ||
13 | --- | ||
14 | embed.fnc | 1 + | ||
15 | embed.h | 1 + | ||
16 | proto.h | 3 +++ | ||
17 | regcomp.c | 70 ++++++++++++++++++++++++++++++++++--------------------- | ||
18 | 4 files changed, 48 insertions(+), 27 deletions(-) | ||
19 | |||
20 | diff --git a/embed.fnc b/embed.fnc | ||
21 | index aedb4baef19..d7cd04d3fc3 100644 | ||
22 | --- a/embed.fnc | ||
23 | +++ b/embed.fnc | ||
24 | @@ -2481,6 +2481,7 @@ Es |SSize_t|study_chunk |NN RExC_state_t *pRExC_state \ | ||
25 | |I32 stopparen|U32 recursed_depth \ | ||
26 | |NULLOK regnode_ssc *and_withp \ | ||
27 | |U32 flags|U32 depth | ||
28 | +Es |void |rck_elide_nothing|NN regnode *node | ||
29 | EsR |SV * |get_ANYOFM_contents|NN const regnode * n | ||
30 | EsRn |U32 |add_data |NN RExC_state_t* const pRExC_state \ | ||
31 | |NN const char* const s|const U32 n | ||
32 | diff --git a/embed.h b/embed.h | ||
33 | index 75c91f77f45..356a8b98d96 100644 | ||
34 | --- a/embed.h | ||
35 | +++ b/embed.h | ||
36 | @@ -1208,6 +1208,7 @@ | ||
37 | #define parse_lparen_question_flags(a) S_parse_lparen_question_flags(aTHX_ a) | ||
38 | #define parse_uniprop_string(a,b,c,d,e,f,g,h,i) Perl_parse_uniprop_string(aTHX_ a,b,c,d,e,f,g,h,i) | ||
39 | #define populate_ANYOF_from_invlist(a,b) S_populate_ANYOF_from_invlist(aTHX_ a,b) | ||
40 | +#define rck_elide_nothing(a) S_rck_elide_nothing(aTHX_ a) | ||
41 | #define reg(a,b,c,d) S_reg(aTHX_ a,b,c,d) | ||
42 | #define reg2Lanode(a,b,c,d) S_reg2Lanode(aTHX_ a,b,c,d) | ||
43 | #define reg_node(a,b) S_reg_node(aTHX_ a,b) | ||
44 | diff --git a/proto.h b/proto.h | ||
45 | index 141ddbaee6d..f316fe134e1 100644 | ||
46 | --- a/proto.h | ||
47 | +++ b/proto.h | ||
48 | @@ -5543,6 +5543,9 @@ PERL_CALLCONV SV * Perl_parse_uniprop_string(pTHX_ const char * const name, cons | ||
49 | STATIC void S_populate_ANYOF_from_invlist(pTHX_ regnode *node, SV** invlist_ptr); | ||
50 | #define PERL_ARGS_ASSERT_POPULATE_ANYOF_FROM_INVLIST \ | ||
51 | assert(node); assert(invlist_ptr) | ||
52 | +STATIC void S_rck_elide_nothing(pTHX_ regnode *node); | ||
53 | +#define PERL_ARGS_ASSERT_RCK_ELIDE_NOTHING \ | ||
54 | + assert(node) | ||
55 | PERL_STATIC_NO_RET void S_re_croak2(pTHX_ bool utf8, const char* pat1, const char* pat2, ...) | ||
56 | __attribute__noreturn__; | ||
57 | #define PERL_ARGS_ASSERT_RE_CROAK2 \ | ||
58 | diff --git a/regcomp.c b/regcomp.c | ||
59 | index 5f86be8086d..4ba2980db66 100644 | ||
60 | --- a/regcomp.c | ||
61 | +++ b/regcomp.c | ||
62 | @@ -4450,6 +4450,44 @@ S_unwind_scan_frames(pTHX_ const void *p) | ||
63 | } while (f); | ||
64 | } | ||
65 | |||
66 | +/* Follow the next-chain of the current node and optimize away | ||
67 | + all the NOTHINGs from it. | ||
68 | + */ | ||
69 | +STATIC void | ||
70 | +S_rck_elide_nothing(pTHX_ regnode *node) | ||
71 | +{ | ||
72 | + dVAR; | ||
73 | + | ||
74 | + PERL_ARGS_ASSERT_RCK_ELIDE_NOTHING; | ||
75 | + | ||
76 | + if (OP(node) != CURLYX) { | ||
77 | + const int max = (reg_off_by_arg[OP(node)] | ||
78 | + ? I32_MAX | ||
79 | + /* I32 may be smaller than U16 on CRAYs! */ | ||
80 | + : (I32_MAX < U16_MAX ? I32_MAX : U16_MAX)); | ||
81 | + int off = (reg_off_by_arg[OP(node)] ? ARG(node) : NEXT_OFF(node)); | ||
82 | + int noff; | ||
83 | + regnode *n = node; | ||
84 | + | ||
85 | + /* Skip NOTHING and LONGJMP. */ | ||
86 | + while ( | ||
87 | + (n = regnext(n)) | ||
88 | + && ( | ||
89 | + (PL_regkind[OP(n)] == NOTHING && (noff = NEXT_OFF(n))) | ||
90 | + || ((OP(n) == LONGJMP) && (noff = ARG(n))) | ||
91 | + ) | ||
92 | + && off + noff < max | ||
93 | + ) { | ||
94 | + off += noff; | ||
95 | + } | ||
96 | + if (reg_off_by_arg[OP(node)]) | ||
97 | + ARG(node) = off; | ||
98 | + else | ||
99 | + NEXT_OFF(node) = off; | ||
100 | + } | ||
101 | + return; | ||
102 | +} | ||
103 | + | ||
104 | /* the return from this sub is the minimum length that could possibly match */ | ||
105 | STATIC SSize_t | ||
106 | S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, | ||
107 | @@ -4550,28 +4588,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, | ||
108 | */ | ||
109 | JOIN_EXACT(scan,&min_subtract, &unfolded_multi_char, 0); | ||
110 | |||
111 | - /* Follow the next-chain of the current node and optimize | ||
112 | - away all the NOTHINGs from it. */ | ||
113 | - if (OP(scan) != CURLYX) { | ||
114 | - const int max = (reg_off_by_arg[OP(scan)] | ||
115 | - ? I32_MAX | ||
116 | - /* I32 may be smaller than U16 on CRAYs! */ | ||
117 | - : (I32_MAX < U16_MAX ? I32_MAX : U16_MAX)); | ||
118 | - int off = (reg_off_by_arg[OP(scan)] ? ARG(scan) : NEXT_OFF(scan)); | ||
119 | - int noff; | ||
120 | - regnode *n = scan; | ||
121 | - | ||
122 | - /* Skip NOTHING and LONGJMP. */ | ||
123 | - while ((n = regnext(n)) | ||
124 | - && ((PL_regkind[OP(n)] == NOTHING && (noff = NEXT_OFF(n))) | ||
125 | - || ((OP(n) == LONGJMP) && (noff = ARG(n)))) | ||
126 | - && off + noff < max) | ||
127 | - off += noff; | ||
128 | - if (reg_off_by_arg[OP(scan)]) | ||
129 | - ARG(scan) = off; | ||
130 | - else | ||
131 | - NEXT_OFF(scan) = off; | ||
132 | - } | ||
133 | + /* Follow the next-chain of the current node and optimize | ||
134 | + away all the NOTHINGs from it. | ||
135 | + */ | ||
136 | + rck_elide_nothing(scan); | ||
137 | |||
138 | /* The principal pseudo-switch. Cannot be a switch, since we | ||
139 | look into several different things. */ | ||
140 | @@ -5745,11 +5765,7 @@ Perl_re_printf( aTHX_ "LHS=%" UVuf " RHS=%" UVuf "\n", | ||
141 | if (data && (fl & SF_HAS_EVAL)) | ||
142 | data->flags |= SF_HAS_EVAL; | ||
143 | optimize_curly_tail: | ||
144 | - if (OP(oscan) != CURLYX) { | ||
145 | - while (PL_regkind[OP(next = regnext(oscan))] == NOTHING | ||
146 | - && NEXT_OFF(next)) | ||
147 | - NEXT_OFF(oscan) += NEXT_OFF(next); | ||
148 | - } | ||
149 | + rck_elide_nothing(oscan); | ||
150 | continue; | ||
151 | |||
152 | default: | ||
diff --git a/meta/recipes-devtools/perl/files/CVE-2020-10878_2.patch b/meta/recipes-devtools/perl/files/CVE-2020-10878_2.patch new file mode 100644 index 0000000000..0bacd6b192 --- /dev/null +++ b/meta/recipes-devtools/perl/files/CVE-2020-10878_2.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From 3295b48defa0f8570114877b063fe546dd348b3c Mon Sep 17 00:00:00 2001 | ||
2 | From: Karl Williamson <khw@cpan.org> | ||
3 | Date: Thu, 20 Feb 2020 17:49:36 +0000 | ||
4 | Subject: [PATCH] regcomp: use long jumps if there is any possibility of | ||
5 | overflow | ||
6 | |||
7 | (CVE-2020-10878) Be conservative for backporting, we'll aim to do | ||
8 | something more aggressive for bleadperl. | ||
9 | |||
10 | (cherry picked from commit 9d7759db46f3b31b1d3f79c44266b6ba42a47fc6) | ||
11 | |||
12 | Upstream-Status: Backport [https://github.com/perl/perl5/commit/3295b48defa0f8570114877b063fe546dd348b3c] | ||
13 | CVE: CVE-2020-10878 | ||
14 | Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> | ||
15 | --- | ||
16 | regcomp.c | 7 +++++++ | ||
17 | 1 file changed, 7 insertions(+) | ||
18 | |||
19 | diff --git a/regcomp.c b/regcomp.c | ||
20 | index 4ba2980db66..73c35a67020 100644 | ||
21 | --- a/regcomp.c | ||
22 | +++ b/regcomp.c | ||
23 | @@ -7762,6 +7762,13 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count, | ||
24 | |||
25 | /* We have that number in RExC_npar */ | ||
26 | RExC_total_parens = RExC_npar; | ||
27 | + | ||
28 | + /* XXX For backporting, use long jumps if there is any possibility of | ||
29 | + * overflow */ | ||
30 | + if (RExC_size > U16_MAX && ! RExC_use_BRANCHJ) { | ||
31 | + RExC_use_BRANCHJ = TRUE; | ||
32 | + flags |= RESTART_PARSE; | ||
33 | + } | ||
34 | } | ||
35 | else if (! MUST_RESTART(flags)) { | ||
36 | ReREFCNT_dec(Rx); | ||
diff --git a/meta/recipes-devtools/perl/files/encodefix.patch b/meta/recipes-devtools/perl/files/encodefix.patch new file mode 100644 index 0000000000..396ed0d53e --- /dev/null +++ b/meta/recipes-devtools/perl/files/encodefix.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | The code is encoding host compiler parameters into target builds. Avoid | ||
2 | this for our target builds (patch is target specific, not native) | ||
3 | |||
4 | Upstream-Status: Inappropriate [Cross compile hack] | ||
5 | RP 2020/2/18 | ||
6 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
7 | |||
8 | Index: perl-5.30.1/cpan/Encode/bin/enc2xs | ||
9 | =================================================================== | ||
10 | --- perl-5.30.1.orig/cpan/Encode/bin/enc2xs | ||
11 | +++ perl-5.30.1/cpan/Encode/bin/enc2xs | ||
12 | @@ -195,7 +195,7 @@ sub compiler_info { | ||
13 | # above becomes false. | ||
14 | my $sized = $declaration && !($compat && !$pedantic); | ||
15 | |||
16 | - return ($cpp, $static, $sized); | ||
17 | + return (0, 1, 1); | ||
18 | } | ||
19 | |||
20 | |||
diff --git a/meta/recipes-devtools/perl/files/fix-setgroup.patch b/meta/recipes-devtools/perl/files/fix-setgroup.patch deleted file mode 100644 index 2b490e6067..0000000000 --- a/meta/recipes-devtools/perl/files/fix-setgroup.patch +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | Test script to reproduce the problem: | ||
2 | |||
3 | #!/usr/bin/env perl | ||
4 | $) = "2 2"; | ||
5 | print $!; | ||
6 | |||
7 | Result from perl 5.28 under strace: | ||
8 | |||
9 | setgroups(1, [2]) = 0 | ||
10 | setresgid(-1, 2, -1) = 0 | ||
11 | |||
12 | Result from perl 5.30 under strace: | ||
13 | |||
14 | setgroups(1, [-1]) = -1 EINVAL (Invalid argument) | ||
15 | setresgid(-1, 2, -1) = 0 | ||
16 | |||
17 | Patch which broke this upstream: | ||
18 | https://perl5.git.perl.org/perl.git/commitdiff/5d4a52b5c68a11bfc97c2e24806993b84a61eade | ||
19 | |||
20 | Issue is that the new function changes the endptr to the end of the | ||
21 | scanned number and needs to be reset to the end of the string for | ||
22 | each iteration of the loop. | ||
23 | |||
24 | [YOCTO #13391] | ||
25 | |||
26 | RP | ||
27 | 2019/6/14 | ||
28 | Upstream-Status: Pending | ||
29 | |||
30 | Index: perl-5.30.0/mg.c | ||
31 | =================================================================== | ||
32 | --- perl-5.30.0.orig/mg.c | ||
33 | +++ perl-5.30.0/mg.c | ||
34 | @@ -3179,6 +3256,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) | ||
35 | const char *p = SvPV_const(sv, len); | ||
36 | Groups_t *gary = NULL; | ||
37 | const char* endptr = p + len; | ||
38 | + const char* realend = p + len; | ||
39 | UV uv; | ||
40 | #ifdef _SC_NGROUPS_MAX | ||
41 | int maxgrp = sysconf(_SC_NGROUPS_MAX); | ||
42 | @@ -3209,6 +3287,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) | ||
43 | Newx(gary, i + 1, Groups_t); | ||
44 | else | ||
45 | Renew(gary, i + 1, Groups_t); | ||
46 | + endptr = realend; | ||
47 | if (grok_atoUV(p, &uv, &endptr)) | ||
48 | gary[i] = (Groups_t)uv; | ||
49 | else { | ||
diff --git a/meta/recipes-devtools/perl/files/perl-configpm-switch.patch b/meta/recipes-devtools/perl/files/perl-configpm-switch.patch index 3c2cecb8c1..80ce4a6de7 100644 --- a/meta/recipes-devtools/perl/files/perl-configpm-switch.patch +++ b/meta/recipes-devtools/perl/files/perl-configpm-switch.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 7f313cac31c55cbe62a4d0cdfa8321cc05a8eb3a Mon Sep 17 00:00:00 2001 | 1 | From 5120acaa2be5787d9657f6b91bc8ee3c2d664fbe Mon Sep 17 00:00:00 2001 |
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
3 | Date: Sun, 27 May 2007 21:04:11 +0000 | 3 | Date: Sun, 27 May 2007 21:04:11 +0000 |
4 | Subject: [PATCH] perl: 5.8.7 -> 5.8.8 (from OE) | 4 | Subject: [PATCH] perl: 5.8.7 -> 5.8.8 (from OE) |
@@ -20,7 +20,7 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | |||
20 | 1 file changed, 16 insertions(+), 2 deletions(-) | 20 | 1 file changed, 16 insertions(+), 2 deletions(-) |
21 | 21 | ||
22 | diff --git a/configpm b/configpm | 22 | diff --git a/configpm b/configpm |
23 | index 09c4a3b..6a0a680 100755 | 23 | index c8de8bf..204613c 100755 |
24 | --- a/configpm | 24 | --- a/configpm |
25 | +++ b/configpm | 25 | +++ b/configpm |
26 | @@ -687,7 +687,7 @@ sub FETCH { | 26 | @@ -687,7 +687,7 @@ sub FETCH { |
diff --git a/meta/recipes-devtools/perl/files/racefix.patch b/meta/recipes-devtools/perl/files/racefix.patch new file mode 100644 index 0000000000..bac42d26ae --- /dev/null +++ b/meta/recipes-devtools/perl/files/racefix.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | In our builds Config_heavy.pl sometimes has lines: | ||
2 | cwarnflags=XXX | ||
3 | ccstdflags=XXX | ||
4 | and sometimes does not. | ||
5 | The reason is that this information is pulled from cflags by configpm and yet | ||
6 | there is no dependency in the Makefile. Add one to fix this. | ||
7 | |||
8 | Upstream-Status: Submitted [https://github.com/arsv/perl-cross/pull/89] | ||
9 | RP 2020/2/19 | ||
10 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
11 | |||
12 | Index: perl-5.30.1/Makefile | ||
13 | =================================================================== | ||
14 | --- perl-5.30.1.orig/Makefile | ||
15 | +++ perl-5.30.1/Makefile | ||
16 | @@ -204,7 +204,7 @@ configpod: $(CONFIGPOD) | ||
17 | git_version.h lib/Config_git.pl: make_patchnum.pl | miniperl$X | ||
18 | ./miniperl_top make_patchnum.pl | ||
19 | |||
20 | -lib/Config.pm lib/Config_heavy.pl lib/Config.pod: config.sh \ | ||
21 | +lib/Config.pm lib/Config_heavy.pl lib/Config.pod: config.sh cflags \ | ||
22 | lib/Config_git.pl Porting/Glossary | miniperl$X | ||
23 | ./miniperl_top configpm | ||
24 | |||
diff --git a/meta/recipes-devtools/perl/liberror-perl_0.17028.bb b/meta/recipes-devtools/perl/liberror-perl_0.17029.bb index 8c6bbcba94..038808f0cd 100644 --- a/meta/recipes-devtools/perl/liberror-perl_0.17028.bb +++ b/meta/recipes-devtools/perl/liberror-perl_0.17029.bb | |||
@@ -32,8 +32,8 @@ RDEPENDS_${PN}-ptest += " \ | |||
32 | 32 | ||
33 | SRC_URI = "http://cpan.metacpan.org/authors/id/S/SH/SHLOMIF/Error-${PV}.tar.gz" | 33 | SRC_URI = "http://cpan.metacpan.org/authors/id/S/SH/SHLOMIF/Error-${PV}.tar.gz" |
34 | 34 | ||
35 | SRC_URI[md5sum] = "ec3522c60a43a368f19c0f89e2205cb1" | 35 | SRC_URI[md5sum] = "6732b1c6207e4a9a3e2987c88368039a" |
36 | SRC_URI[sha256sum] = "3ad85c5e58b31c8903006298424a51bba39f1840e324f5ae612eabc8b935e960" | 36 | SRC_URI[sha256sum] = "1a23f7913032aed6d4b68321373a3899ca66590f4727391a091ec19c95bf7adc" |
37 | 37 | ||
38 | S = "${WORKDIR}/Error-${PV}" | 38 | S = "${WORKDIR}/Error-${PV}" |
39 | 39 | ||
diff --git a/meta/recipes-devtools/perl/libmodule-build-perl/run-ptest b/meta/recipes-devtools/perl/libmodule-build-perl/run-ptest index 0d63d1513b..d802781f9e 100644 --- a/meta/recipes-devtools/perl/libmodule-build-perl/run-ptest +++ b/meta/recipes-devtools/perl/libmodule-build-perl/run-ptest | |||
@@ -6,8 +6,6 @@ for case in `find t -type f -name '*.t'`; do | |||
6 | cat $case.output | 6 | cat $case.output |
7 | if [ $ret -ne 0 ]; then | 7 | if [ $ret -ne 0 ]; then |
8 | echo "FAIL: ${case%.t}" | 8 | echo "FAIL: ${case%.t}" |
9 | elif grep -i 'SKIP' $case.output; then | ||
10 | echo "SKIP: ${case%.t}" | ||
11 | else | 9 | else |
12 | echo "PASS: ${case%.t}" | 10 | echo "PASS: ${case%.t}" |
13 | fi | 11 | fi |
diff --git a/meta/recipes-devtools/perl/libmodule-build-perl_0.4229.bb b/meta/recipes-devtools/perl/libmodule-build-perl_0.4229.bb index f759f862fb..e3ba40d96c 100644 --- a/meta/recipes-devtools/perl/libmodule-build-perl_0.4229.bb +++ b/meta/recipes-devtools/perl/libmodule-build-perl_0.4229.bb | |||
@@ -36,7 +36,10 @@ do_patch[postfuncs] += "do_patch_module_build" | |||
36 | do_install_ptest() { | 36 | do_install_ptest() { |
37 | cp -r ${B}/inc ${D}${PTEST_PATH} | 37 | cp -r ${B}/inc ${D}${PTEST_PATH} |
38 | cp -r ${B}/blib ${D}${PTEST_PATH} | 38 | cp -r ${B}/blib ${D}${PTEST_PATH} |
39 | cp -r ${B}/_build ${D}${PTEST_PATH} | ||
40 | cp -r ${B}/lib ${D}${PTEST_PATH} | ||
39 | chown -R root:root ${D}${PTEST_PATH} | 41 | chown -R root:root ${D}${PTEST_PATH} |
42 | sed -i -e "s,'perl' => .*,'perl' => '/usr/bin/perl'\,,g" ${D}${PTEST_PATH}/_build/build_params | ||
40 | } | 43 | } |
41 | 44 | ||
42 | RDEPENDS_${PN} += " \ | 45 | RDEPENDS_${PN} += " \ |
diff --git a/meta/recipes-devtools/perl/perl_5.30.0.bb b/meta/recipes-devtools/perl/perl_5.30.1.bb index 838e52c67b..b633acfcea 100644 --- a/meta/recipes-devtools/perl/perl_5.30.0.bb +++ b/meta/recipes-devtools/perl/perl_5.30.1.bb | |||
@@ -8,7 +8,7 @@ LIC_FILES_CHKSUM = "file://Copying;md5=5b122a36d0f6dc55279a0ebc69f3c60b \ | |||
8 | 8 | ||
9 | 9 | ||
10 | SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \ | 10 | SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \ |
11 | https://github.com/arsv/perl-cross/releases/download/1.3/perl-cross-1.3.tar.gz;name=perl-cross \ | 11 | https://github.com/arsv/perl-cross/releases/download/1.3.1/perl-cross-1.3.1.tar.gz;name=perl-cross \ |
12 | file://perl-rdepends.txt \ | 12 | file://perl-rdepends.txt \ |
13 | file://0001-configure_tool.sh-do-not-quote-the-argument-to-comma.patch \ | 13 | file://0001-configure_tool.sh-do-not-quote-the-argument-to-comma.patch \ |
14 | file://0001-ExtUtils-MakeMaker-add-LDFLAGS-when-linking-binary-m.patch \ | 14 | file://0001-ExtUtils-MakeMaker-add-LDFLAGS-when-linking-binary-m.patch \ |
@@ -18,19 +18,26 @@ SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \ | |||
18 | file://0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch \ | 18 | file://0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch \ |
19 | file://perl-dynloader.patch \ | 19 | file://perl-dynloader.patch \ |
20 | file://0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch \ | 20 | file://0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch \ |
21 | file://fix-setgroup.patch \ | ||
22 | file://0001-enc2xs-Add-environment-variable-to-suppress-comments.patch \ | 21 | file://0001-enc2xs-Add-environment-variable-to-suppress-comments.patch \ |
23 | file://0002-Constant-Fix-up-shebang.patch \ | 22 | file://0002-Constant-Fix-up-shebang.patch \ |
23 | file://0001-tests-adjust-to-correctly-exclude-unbuilt-extensions.patch \ | ||
24 | file://determinism.patch \ | 24 | file://determinism.patch \ |
25 | file://racefix.patch \ | ||
26 | file://CVE-2020-10543.patch \ | ||
27 | file://CVE-2020-10878_1.patch \ | ||
28 | file://CVE-2020-10878_2.patch \ | ||
25 | " | 29 | " |
26 | SRC_URI_append_class-native = " \ | 30 | SRC_URI_append_class-native = " \ |
27 | file://perl-configpm-switch.patch \ | 31 | file://perl-configpm-switch.patch \ |
28 | " | 32 | " |
33 | SRC_URI_append_class-target = " \ | ||
34 | file://encodefix.patch \ | ||
35 | " | ||
29 | 36 | ||
30 | SRC_URI[perl.md5sum] = "9770584cdf9b5631c38097645ce33549" | 37 | SRC_URI[perl.md5sum] = "6438eb7b8db9bbde28e01086de376a46" |
31 | SRC_URI[perl.sha256sum] = "851213c754d98ccff042caa40ba7a796b2cee88c5325f121be5cbb61bbf975f2" | 38 | SRC_URI[perl.sha256sum] = "bf3d25571ff1ee94186177c2cdef87867fd6a14aa5a84f0b1fb7bf798f42f964" |
32 | SRC_URI[perl-cross.md5sum] = "4dda3daf9c4fe42b3d6a5dd052852a48" | 39 | SRC_URI[perl-cross.md5sum] = "1e463b105cfa56d251a86979af23e3a7" |
33 | SRC_URI[perl-cross.sha256sum] = "49edea1ea2cd6c5c47386ca71beda8d150c748835781354dbe7f75b1df27e703" | 40 | SRC_URI[perl-cross.sha256sum] = "edce0b0c2f725e2db3f203d6d8e9f3f7161256f5d1590551e40694f21200141d" |
34 | 41 | ||
35 | S = "${WORKDIR}/perl-${PV}" | 42 | S = "${WORKDIR}/perl-${PV}" |
36 | 43 | ||
@@ -113,6 +120,14 @@ print(datetime.fromtimestamp($SOURCE_DATE_EPOCH, timezone.utc).strftime('%a %b % | |||
113 | 120 | ||
114 | do_compile() { | 121 | do_compile() { |
115 | oe_runmake | 122 | oe_runmake |
123 | # This isn't generated reliably so delete and re-generate. | ||
124 | # https://github.com/arsv/perl-cross/issues/86 | ||
125 | |||
126 | if [ -e pod/perltoc.pod ]; then | ||
127 | bbnote Rebuilding perltoc.pod | ||
128 | rm -f pod/perltoc.pod | ||
129 | oe_runmake pod/perltoc.pod | ||
130 | fi | ||
116 | } | 131 | } |
117 | 132 | ||
118 | do_install() { | 133 | do_install() { |
@@ -202,6 +217,7 @@ require perl-ptest.inc | |||
202 | FILES_${PN} = "${bindir}/perl ${bindir}/perl.real ${bindir}/perl${PV} ${libdir}/libperl.so* \ | 217 | FILES_${PN} = "${bindir}/perl ${bindir}/perl.real ${bindir}/perl${PV} ${libdir}/libperl.so* \ |
203 | ${libdir}/perl5/site_perl \ | 218 | ${libdir}/perl5/site_perl \ |
204 | ${libdir}/perl5/${PV}/Config.pm \ | 219 | ${libdir}/perl5/${PV}/Config.pm \ |
220 | ${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config.pm \ | ||
205 | ${libdir}/perl5/${PV}/*/Config_git.pl \ | 221 | ${libdir}/perl5/${PV}/*/Config_git.pl \ |
206 | ${libdir}/perl5/${PV}/*/Config_heavy-target.pl \ | 222 | ${libdir}/perl5/${PV}/*/Config_heavy-target.pl \ |
207 | ${libdir}/perl5/config.sh \ | 223 | ${libdir}/perl5/config.sh \ |
@@ -210,6 +226,9 @@ FILES_${PN} = "${bindir}/perl ${bindir}/perl.real ${bindir}/perl${PV} ${libdir}/ | |||
210 | ${libdir}/perl5/${PV}/warnings \ | 226 | ${libdir}/perl5/${PV}/warnings \ |
211 | ${libdir}/perl5/${PV}/vars.pm \ | 227 | ${libdir}/perl5/${PV}/vars.pm \ |
212 | ${libdir}/perl5/site_perl \ | 228 | ${libdir}/perl5/site_perl \ |
229 | ${libdir}/perl5/${PV}/ExtUtils/MANIFEST.SKIP \ | ||
230 | ${libdir}/perl5/${PV}/ExtUtils/xsubpp \ | ||
231 | ${libdir}/perl5/${PV}/ExtUtils/typemap \ | ||
213 | " | 232 | " |
214 | RPROVIDES_${PN} += "perl-module-strict perl-module-vars perl-module-config perl-module-warnings \ | 233 | RPROVIDES_${PN} += "perl-module-strict perl-module-vars perl-module-config perl-module-warnings \ |
215 | perl-module-warnings-register" | 234 | perl-module-warnings-register" |
@@ -220,9 +239,6 @@ FILES_${PN}-dev_append = " ${libdir}/perl5/${PV}/*/CORE" | |||
220 | 239 | ||
221 | FILES_${PN}-doc_append = " ${libdir}/perl5/${PV}/Unicode/Collate/*.txt \ | 240 | FILES_${PN}-doc_append = " ${libdir}/perl5/${PV}/Unicode/Collate/*.txt \ |
222 | ${libdir}/perl5/${PV}/*/.packlist \ | 241 | ${libdir}/perl5/${PV}/*/.packlist \ |
223 | ${libdir}/perl5/${PV}/ExtUtils/MANIFEST.SKIP \ | ||
224 | ${libdir}/perl5/${PV}/ExtUtils/xsubpp \ | ||
225 | ${libdir}/perl5/${PV}/ExtUtils/typemap \ | ||
226 | ${libdir}/perl5/${PV}/Encode/encode.h \ | 242 | ${libdir}/perl5/${PV}/Encode/encode.h \ |
227 | " | 243 | " |
228 | PACKAGES += "${PN}-misc" | 244 | PACKAGES += "${PN}-misc" |
@@ -258,7 +274,7 @@ python split_perl_packages () { | |||
258 | do_split_packages(d, libdir, r'Module/([^\/]*)\.pm', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False) | 274 | do_split_packages(d, libdir, r'Module/([^\/]*)\.pm', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False) |
259 | do_split_packages(d, libdir, r'Module/([^\/]*)/.*', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False) | 275 | do_split_packages(d, libdir, r'Module/([^\/]*)/.*', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False) |
260 | do_split_packages(d, libdir, r'.*linux/([^\/].*)\.(pm|pl|e2x)', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False) | 276 | do_split_packages(d, libdir, r'.*linux/([^\/].*)\.(pm|pl|e2x)', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False) |
261 | do_split_packages(d, libdir, r'(^(?!(CPAN\/|CPANPLUS\/|Module\/|unicore\/)[^\/]).*)\.(pm|pl|e2x)', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False) | 277 | do_split_packages(d, libdir, r'(^(?!(CPAN\/|CPANPLUS\/|Module\/|unicore\/|.*linux\/)[^\/]).*)\.(pm|pl|e2x)', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False) |
262 | 278 | ||
263 | # perl-modules should recommend every perl module, and only the | 279 | # perl-modules should recommend every perl module, and only the |
264 | # modules. Don't attempt to use the result of do_split_packages() as some | 280 | # modules. Don't attempt to use the result of do_split_packages() as some |
diff --git a/meta/recipes-devtools/pseudo/pseudo.inc b/meta/recipes-devtools/pseudo/pseudo.inc index 7ff8e449e9..50e30064bd 100644 --- a/meta/recipes-devtools/pseudo/pseudo.inc +++ b/meta/recipes-devtools/pseudo/pseudo.inc | |||
@@ -16,6 +16,7 @@ INSANE_SKIP_${PN}-dbg += "libdir" | |||
16 | PROVIDES += "virtual/fakeroot" | 16 | PROVIDES += "virtual/fakeroot" |
17 | 17 | ||
18 | MAKEOPTS = "" | 18 | MAKEOPTS = "" |
19 | MAKEOPTS_class-native = "'RPATH=-Wl,--rpath=XORIGIN/../../../sqlite3-native/usr/lib/'" | ||
19 | 20 | ||
20 | inherit siteinfo pkgconfig | 21 | inherit siteinfo pkgconfig |
21 | 22 | ||
@@ -115,6 +116,7 @@ do_install () { | |||
115 | } | 116 | } |
116 | 117 | ||
117 | do_install_append_class-native () { | 118 | do_install_append_class-native () { |
119 | chrpath ${D}${bindir}/pseudo -r `chrpath ${D}${bindir}/pseudo | cut -d = -f 2 | sed s/XORIGIN/\\$ORIGIN/` | ||
118 | install -d ${D}${sysconfdir} | 120 | install -d ${D}${sysconfdir} |
119 | # The fallback files should never be modified | 121 | # The fallback files should never be modified |
120 | install -m 444 ${WORKDIR}/fallback-passwd ${D}${sysconfdir}/passwd | 122 | install -m 444 ${WORKDIR}/fallback-passwd ${D}${sysconfdir}/passwd |
diff --git a/meta/recipes-devtools/python-numpy/files/aarch64/_numpyconfig.h b/meta/recipes-devtools/python-numpy/files/aarch64/_numpyconfig.h deleted file mode 100644 index 109deb0435..0000000000 --- a/meta/recipes-devtools/python-numpy/files/aarch64/_numpyconfig.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 16 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 | ||
11 | #define NPY_SIZEOF_PY_INTPTR_T 8 | ||
12 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
13 | #define NPY_SIZEOF_LONGLONG 8 | ||
14 | #define NPY_SIZEOF_OFF_T 8 | ||
15 | #define NPY_NO_SMP 0 | ||
16 | #define NPY_HAVE_DECL_ISNAN | ||
17 | #define NPY_HAVE_DECL_ISINF | ||
18 | #define NPY_HAVE_DECL_ISFINITE | ||
19 | #define NPY_HAVE_DECL_SIGNBIT | ||
20 | #define NPY_USE_C99_COMPLEX 1 | ||
21 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
22 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
23 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
24 | #define NPY_ENABLE_SEPARATE_COMPILATION 1 | ||
25 | #define NPY_USE_C99_FORMATS 1 | ||
26 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
27 | #define NPY_ABI_VERSION 0x01000009 | ||
28 | #define NPY_API_VERSION 0x0000000A | ||
29 | |||
30 | #ifndef __STDC_FORMAT_MACROS | ||
31 | #define __STDC_FORMAT_MACROS 1 | ||
32 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/aarch64/config.h b/meta/recipes-devtools/python-numpy/files/aarch64/config.h deleted file mode 100644 index c30b868f2f..0000000000 --- a/meta/recipes-devtools/python-numpy/files/aarch64/config.h +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | #define HAVE_ENDIAN_H 1 | ||
2 | #define SIZEOF_PY_INTPTR_T 8 | ||
3 | #define SIZEOF_PY_LONG_LONG 8 | ||
4 | #define MATHLIB m | ||
5 | #define HAVE_SIN 1 | ||
6 | #define HAVE_COS 1 | ||
7 | #define HAVE_TAN 1 | ||
8 | #define HAVE_SINH 1 | ||
9 | #define HAVE_COSH 1 | ||
10 | #define HAVE_TANH 1 | ||
11 | #define HAVE_FABS 1 | ||
12 | #define HAVE_FLOOR 1 | ||
13 | #define HAVE_CEIL 1 | ||
14 | #define HAVE_SQRT 1 | ||
15 | #define HAVE_LOG10 1 | ||
16 | #define HAVE_LOG 1 | ||
17 | #define HAVE_EXP 1 | ||
18 | #define HAVE_ASIN 1 | ||
19 | #define HAVE_ACOS 1 | ||
20 | #define HAVE_ATAN 1 | ||
21 | #define HAVE_FMOD 1 | ||
22 | #define HAVE_MODF 1 | ||
23 | #define HAVE_FREXP 1 | ||
24 | #define HAVE_LDEXP 1 | ||
25 | #define HAVE_RINT 1 | ||
26 | #define HAVE_TRUNC 1 | ||
27 | #define HAVE_EXP2 1 | ||
28 | #define HAVE_LOG2 1 | ||
29 | #define HAVE_ATAN2 1 | ||
30 | #define HAVE_POW 1 | ||
31 | #define HAVE_NEXTAFTER 1 | ||
32 | #define HAVE_SINF 1 | ||
33 | #define HAVE_COSF 1 | ||
34 | #define HAVE_TANF 1 | ||
35 | #define HAVE_SINHF 1 | ||
36 | #define HAVE_COSHF 1 | ||
37 | #define HAVE_TANHF 1 | ||
38 | #define HAVE_FABSF 1 | ||
39 | #define HAVE_FLOORF 1 | ||
40 | #define HAVE_CEILF 1 | ||
41 | #define HAVE_RINTF 1 | ||
42 | #define HAVE_TRUNCF 1 | ||
43 | #define HAVE_SQRTF 1 | ||
44 | #define HAVE_LOG10F 1 | ||
45 | #define HAVE_LOGF 1 | ||
46 | #define HAVE_LOG1PF 1 | ||
47 | #define HAVE_EXPF 1 | ||
48 | #define HAVE_EXPM1F 1 | ||
49 | #define HAVE_ASINF 1 | ||
50 | #define HAVE_ACOSF 1 | ||
51 | #define HAVE_ATANF 1 | ||
52 | #define HAVE_ASINHF 1 | ||
53 | #define HAVE_ACOSHF 1 | ||
54 | #define HAVE_ATANHF 1 | ||
55 | #define HAVE_HYPOTF 1 | ||
56 | #define HAVE_ATAN2F 1 | ||
57 | #define HAVE_POWF 1 | ||
58 | #define HAVE_FMODF 1 | ||
59 | #define HAVE_MODFF 1 | ||
60 | #define HAVE_FREXPF 1 | ||
61 | #define HAVE_LDEXPF 1 | ||
62 | #define HAVE_EXP2F 1 | ||
63 | #define HAVE_LOG2F 1 | ||
64 | #define HAVE_COPYSIGNF 1 | ||
65 | #define HAVE_NEXTAFTERF 1 | ||
66 | #define HAVE_SINL 1 | ||
67 | #define HAVE_COSL 1 | ||
68 | #define HAVE_TANL 1 | ||
69 | #define HAVE_SINHL 1 | ||
70 | #define HAVE_COSHL 1 | ||
71 | #define HAVE_TANHL 1 | ||
72 | #define HAVE_FABSL 1 | ||
73 | #define HAVE_FLOORL 1 | ||
74 | #define HAVE_CEILL 1 | ||
75 | #define HAVE_RINTL 1 | ||
76 | #define HAVE_TRUNCL 1 | ||
77 | #define HAVE_SQRTL 1 | ||
78 | #define HAVE_LOG10L 1 | ||
79 | #define HAVE_LOGL 1 | ||
80 | #define HAVE_LOG1PL 1 | ||
81 | #define HAVE_EXPL 1 | ||
82 | #define HAVE_EXPM1L 1 | ||
83 | #define HAVE_ASINL 1 | ||
84 | #define HAVE_ACOSL 1 | ||
85 | #define HAVE_ATANL 1 | ||
86 | #define HAVE_ASINHL 1 | ||
87 | #define HAVE_ACOSHL 1 | ||
88 | #define HAVE_ATANHL 1 | ||
89 | #define HAVE_HYPOTL 1 | ||
90 | #define HAVE_ATAN2L 1 | ||
91 | #define HAVE_POWL 1 | ||
92 | #define HAVE_FMODL 1 | ||
93 | #define HAVE_MODFL 1 | ||
94 | #define HAVE_FREXPL 1 | ||
95 | #define HAVE_LDEXPL 1 | ||
96 | #define HAVE_EXP2L 1 | ||
97 | #define HAVE_LOG2L 1 | ||
98 | #define HAVE_COPYSIGNL 1 | ||
99 | #define HAVE_NEXTAFTERL 1 | ||
100 | #define HAVE_DECL_SIGNBIT | ||
101 | #define HAVE_COMPLEX_H 1 | ||
102 | #define HAVE_CREAL 1 | ||
103 | #define HAVE_CIMAG 1 | ||
104 | #define HAVE_CABS 1 | ||
105 | #define HAVE_CARG 1 | ||
106 | #define HAVE_CEXP 1 | ||
107 | #define HAVE_CSQRT 1 | ||
108 | #define HAVE_CLOG 1 | ||
109 | #define HAVE_CCOS 1 | ||
110 | #define HAVE_CSIN 1 | ||
111 | #define HAVE_CPOW 1 | ||
112 | #define HAVE_CREALF 1 | ||
113 | #define HAVE_CIMAGF 1 | ||
114 | #define HAVE_CABSF 1 | ||
115 | #define HAVE_CARGF 1 | ||
116 | #define HAVE_CEXPF 1 | ||
117 | #define HAVE_CSQRTF 1 | ||
118 | #define HAVE_CLOGF 1 | ||
119 | #define HAVE_CCOSF 1 | ||
120 | #define HAVE_CSINF 1 | ||
121 | #define HAVE_CPOWF 1 | ||
122 | #define HAVE_CREALL 1 | ||
123 | #define HAVE_CIMAGL 1 | ||
124 | #define HAVE_CABSL 1 | ||
125 | #define HAVE_CARGL 1 | ||
126 | #define HAVE_CEXPL 1 | ||
127 | #define HAVE_CSQRTL 1 | ||
128 | #define HAVE_CLOGL 1 | ||
129 | #define HAVE_CCOSL 1 | ||
130 | #define HAVE_CSINL 1 | ||
131 | #define HAVE_CPOWL 1 | ||
132 | #define HAVE_LDOUBLE_IEEE_QUAD_LE 1 | ||
133 | #ifndef __cplusplus | ||
134 | /* #undef inline */ | ||
135 | #endif | ||
136 | |||
137 | #ifndef _NPY_NPY_CONFIG_H_ | ||
138 | #error config.h should never be included directly, include npy_config.h instead | ||
139 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/arm/config.h b/meta/recipes-devtools/python-numpy/files/arm/config.h deleted file mode 100644 index 17ef186d56..0000000000 --- a/meta/recipes-devtools/python-numpy/files/arm/config.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */ | ||
2 | /* #define SIZEOF_SHORT 2 */ | ||
3 | /* #define SIZEOF_INT 4 */ | ||
4 | /* #define SIZEOF_LONG 4 */ | ||
5 | /* #define SIZEOF_FLOAT 4 */ | ||
6 | /* #define SIZEOF_DOUBLE 8 */ | ||
7 | #define SIZEOF_LONG_DOUBLE 12 | ||
8 | #define SIZEOF_PY_INTPTR_T 4 | ||
9 | /* #define SIZEOF_LONG_LONG 8 */ | ||
10 | #define SIZEOF_PY_LONG_LONG 8 | ||
11 | /* #define CHAR_BIT 8 */ | ||
12 | #define MATHLIB m | ||
13 | #define HAVE_FLOAT_FUNCS | ||
14 | #define HAVE_LOG1P | ||
15 | #define HAVE_EXPM1 | ||
16 | #define HAVE_INVERSE_HYPERBOLIC | ||
17 | #define HAVE_INVERSE_HYPERBOLIC_FLOAT | ||
18 | #define HAVE_ISNAN | ||
19 | #define HAVE_ISINF | ||
20 | #define HAVE_RINT | ||
21 | |||
diff --git a/meta/recipes-devtools/python-numpy/files/arm/numpyconfig.h b/meta/recipes-devtools/python-numpy/files/arm/numpyconfig.h deleted file mode 100644 index c4bf6547f0..0000000000 --- a/meta/recipes-devtools/python-numpy/files/arm/numpyconfig.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */ | ||
2 | /* | ||
3 | * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT | ||
4 | * */ | ||
5 | #define NPY_SIZEOF_SHORT 2 | ||
6 | #define NPY_SIZEOF_INT 4 | ||
7 | #define NPY_SIZEOF_LONG 4 | ||
8 | #define NPY_SIZEOF_FLOAT 4 | ||
9 | #define NPY_SIZEOF_DOUBLE 8 | ||
10 | #define NPY_SIZEOF_LONGDOUBLE 12 | ||
11 | #define NPY_SIZEOF_PY_INTPTR_T 4 | ||
12 | #define NPY_NO_SMP 0 | ||
13 | |||
14 | #define NPY_SIZEOF_LONGLONG 8 | ||
15 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
16 | /* #define CHAR_BIT 8 */ | ||
17 | |||
diff --git a/meta/recipes-devtools/python-numpy/files/armeb/config.h b/meta/recipes-devtools/python-numpy/files/armeb/config.h deleted file mode 100644 index 17ef186d56..0000000000 --- a/meta/recipes-devtools/python-numpy/files/armeb/config.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */ | ||
2 | /* #define SIZEOF_SHORT 2 */ | ||
3 | /* #define SIZEOF_INT 4 */ | ||
4 | /* #define SIZEOF_LONG 4 */ | ||
5 | /* #define SIZEOF_FLOAT 4 */ | ||
6 | /* #define SIZEOF_DOUBLE 8 */ | ||
7 | #define SIZEOF_LONG_DOUBLE 12 | ||
8 | #define SIZEOF_PY_INTPTR_T 4 | ||
9 | /* #define SIZEOF_LONG_LONG 8 */ | ||
10 | #define SIZEOF_PY_LONG_LONG 8 | ||
11 | /* #define CHAR_BIT 8 */ | ||
12 | #define MATHLIB m | ||
13 | #define HAVE_FLOAT_FUNCS | ||
14 | #define HAVE_LOG1P | ||
15 | #define HAVE_EXPM1 | ||
16 | #define HAVE_INVERSE_HYPERBOLIC | ||
17 | #define HAVE_INVERSE_HYPERBOLIC_FLOAT | ||
18 | #define HAVE_ISNAN | ||
19 | #define HAVE_ISINF | ||
20 | #define HAVE_RINT | ||
21 | |||
diff --git a/meta/recipes-devtools/python-numpy/files/armeb/numpyconfig.h b/meta/recipes-devtools/python-numpy/files/armeb/numpyconfig.h deleted file mode 100644 index c4bf6547f0..0000000000 --- a/meta/recipes-devtools/python-numpy/files/armeb/numpyconfig.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */ | ||
2 | /* | ||
3 | * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT | ||
4 | * */ | ||
5 | #define NPY_SIZEOF_SHORT 2 | ||
6 | #define NPY_SIZEOF_INT 4 | ||
7 | #define NPY_SIZEOF_LONG 4 | ||
8 | #define NPY_SIZEOF_FLOAT 4 | ||
9 | #define NPY_SIZEOF_DOUBLE 8 | ||
10 | #define NPY_SIZEOF_LONGDOUBLE 12 | ||
11 | #define NPY_SIZEOF_PY_INTPTR_T 4 | ||
12 | #define NPY_NO_SMP 0 | ||
13 | |||
14 | #define NPY_SIZEOF_LONGLONG 8 | ||
15 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
16 | /* #define CHAR_BIT 8 */ | ||
17 | |||
diff --git a/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/_numpyconfig.h b/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/_numpyconfig.h deleted file mode 100644 index debb390094..0000000000 --- a/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/_numpyconfig.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 16 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 | ||
11 | #define NPY_ENABLE_SEPARATE_COMPILATION 1 | ||
12 | #define NPY_SIZEOF_PY_INTPTR_T 8 | ||
13 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
14 | #define NPY_SIZEOF_LONGLONG 8 | ||
15 | #define NPY_SIZEOF_OFF_T 8 | ||
16 | #define NPY_NO_SMP 0 | ||
17 | #define NPY_HAVE_DECL_ISNAN | ||
18 | #define NPY_HAVE_DECL_ISINF | ||
19 | #define NPY_HAVE_DECL_ISFINITE | ||
20 | #define NPY_HAVE_DECL_SIGNBIT | ||
21 | #define NPY_USE_C99_COMPLEX 1 | ||
22 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
23 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
24 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
25 | #define NPY_USE_C99_FORMATS 1 | ||
26 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
27 | #define NPY_ABI_VERSION 0x01000009 | ||
28 | #define NPY_API_VERSION 0x0000000A | ||
29 | |||
30 | #ifndef __STDC_FORMAT_MACROS | ||
31 | #define __STDC_FORMAT_MACROS 1 | ||
32 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/config.h b/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/config.h deleted file mode 100644 index c30b868f2f..0000000000 --- a/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/config.h +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | #define HAVE_ENDIAN_H 1 | ||
2 | #define SIZEOF_PY_INTPTR_T 8 | ||
3 | #define SIZEOF_PY_LONG_LONG 8 | ||
4 | #define MATHLIB m | ||
5 | #define HAVE_SIN 1 | ||
6 | #define HAVE_COS 1 | ||
7 | #define HAVE_TAN 1 | ||
8 | #define HAVE_SINH 1 | ||
9 | #define HAVE_COSH 1 | ||
10 | #define HAVE_TANH 1 | ||
11 | #define HAVE_FABS 1 | ||
12 | #define HAVE_FLOOR 1 | ||
13 | #define HAVE_CEIL 1 | ||
14 | #define HAVE_SQRT 1 | ||
15 | #define HAVE_LOG10 1 | ||
16 | #define HAVE_LOG 1 | ||
17 | #define HAVE_EXP 1 | ||
18 | #define HAVE_ASIN 1 | ||
19 | #define HAVE_ACOS 1 | ||
20 | #define HAVE_ATAN 1 | ||
21 | #define HAVE_FMOD 1 | ||
22 | #define HAVE_MODF 1 | ||
23 | #define HAVE_FREXP 1 | ||
24 | #define HAVE_LDEXP 1 | ||
25 | #define HAVE_RINT 1 | ||
26 | #define HAVE_TRUNC 1 | ||
27 | #define HAVE_EXP2 1 | ||
28 | #define HAVE_LOG2 1 | ||
29 | #define HAVE_ATAN2 1 | ||
30 | #define HAVE_POW 1 | ||
31 | #define HAVE_NEXTAFTER 1 | ||
32 | #define HAVE_SINF 1 | ||
33 | #define HAVE_COSF 1 | ||
34 | #define HAVE_TANF 1 | ||
35 | #define HAVE_SINHF 1 | ||
36 | #define HAVE_COSHF 1 | ||
37 | #define HAVE_TANHF 1 | ||
38 | #define HAVE_FABSF 1 | ||
39 | #define HAVE_FLOORF 1 | ||
40 | #define HAVE_CEILF 1 | ||
41 | #define HAVE_RINTF 1 | ||
42 | #define HAVE_TRUNCF 1 | ||
43 | #define HAVE_SQRTF 1 | ||
44 | #define HAVE_LOG10F 1 | ||
45 | #define HAVE_LOGF 1 | ||
46 | #define HAVE_LOG1PF 1 | ||
47 | #define HAVE_EXPF 1 | ||
48 | #define HAVE_EXPM1F 1 | ||
49 | #define HAVE_ASINF 1 | ||
50 | #define HAVE_ACOSF 1 | ||
51 | #define HAVE_ATANF 1 | ||
52 | #define HAVE_ASINHF 1 | ||
53 | #define HAVE_ACOSHF 1 | ||
54 | #define HAVE_ATANHF 1 | ||
55 | #define HAVE_HYPOTF 1 | ||
56 | #define HAVE_ATAN2F 1 | ||
57 | #define HAVE_POWF 1 | ||
58 | #define HAVE_FMODF 1 | ||
59 | #define HAVE_MODFF 1 | ||
60 | #define HAVE_FREXPF 1 | ||
61 | #define HAVE_LDEXPF 1 | ||
62 | #define HAVE_EXP2F 1 | ||
63 | #define HAVE_LOG2F 1 | ||
64 | #define HAVE_COPYSIGNF 1 | ||
65 | #define HAVE_NEXTAFTERF 1 | ||
66 | #define HAVE_SINL 1 | ||
67 | #define HAVE_COSL 1 | ||
68 | #define HAVE_TANL 1 | ||
69 | #define HAVE_SINHL 1 | ||
70 | #define HAVE_COSHL 1 | ||
71 | #define HAVE_TANHL 1 | ||
72 | #define HAVE_FABSL 1 | ||
73 | #define HAVE_FLOORL 1 | ||
74 | #define HAVE_CEILL 1 | ||
75 | #define HAVE_RINTL 1 | ||
76 | #define HAVE_TRUNCL 1 | ||
77 | #define HAVE_SQRTL 1 | ||
78 | #define HAVE_LOG10L 1 | ||
79 | #define HAVE_LOGL 1 | ||
80 | #define HAVE_LOG1PL 1 | ||
81 | #define HAVE_EXPL 1 | ||
82 | #define HAVE_EXPM1L 1 | ||
83 | #define HAVE_ASINL 1 | ||
84 | #define HAVE_ACOSL 1 | ||
85 | #define HAVE_ATANL 1 | ||
86 | #define HAVE_ASINHL 1 | ||
87 | #define HAVE_ACOSHL 1 | ||
88 | #define HAVE_ATANHL 1 | ||
89 | #define HAVE_HYPOTL 1 | ||
90 | #define HAVE_ATAN2L 1 | ||
91 | #define HAVE_POWL 1 | ||
92 | #define HAVE_FMODL 1 | ||
93 | #define HAVE_MODFL 1 | ||
94 | #define HAVE_FREXPL 1 | ||
95 | #define HAVE_LDEXPL 1 | ||
96 | #define HAVE_EXP2L 1 | ||
97 | #define HAVE_LOG2L 1 | ||
98 | #define HAVE_COPYSIGNL 1 | ||
99 | #define HAVE_NEXTAFTERL 1 | ||
100 | #define HAVE_DECL_SIGNBIT | ||
101 | #define HAVE_COMPLEX_H 1 | ||
102 | #define HAVE_CREAL 1 | ||
103 | #define HAVE_CIMAG 1 | ||
104 | #define HAVE_CABS 1 | ||
105 | #define HAVE_CARG 1 | ||
106 | #define HAVE_CEXP 1 | ||
107 | #define HAVE_CSQRT 1 | ||
108 | #define HAVE_CLOG 1 | ||
109 | #define HAVE_CCOS 1 | ||
110 | #define HAVE_CSIN 1 | ||
111 | #define HAVE_CPOW 1 | ||
112 | #define HAVE_CREALF 1 | ||
113 | #define HAVE_CIMAGF 1 | ||
114 | #define HAVE_CABSF 1 | ||
115 | #define HAVE_CARGF 1 | ||
116 | #define HAVE_CEXPF 1 | ||
117 | #define HAVE_CSQRTF 1 | ||
118 | #define HAVE_CLOGF 1 | ||
119 | #define HAVE_CCOSF 1 | ||
120 | #define HAVE_CSINF 1 | ||
121 | #define HAVE_CPOWF 1 | ||
122 | #define HAVE_CREALL 1 | ||
123 | #define HAVE_CIMAGL 1 | ||
124 | #define HAVE_CABSL 1 | ||
125 | #define HAVE_CARGL 1 | ||
126 | #define HAVE_CEXPL 1 | ||
127 | #define HAVE_CSQRTL 1 | ||
128 | #define HAVE_CLOGL 1 | ||
129 | #define HAVE_CCOSL 1 | ||
130 | #define HAVE_CSINL 1 | ||
131 | #define HAVE_CPOWL 1 | ||
132 | #define HAVE_LDOUBLE_IEEE_QUAD_LE 1 | ||
133 | #ifndef __cplusplus | ||
134 | /* #undef inline */ | ||
135 | #endif | ||
136 | |||
137 | #ifndef _NPY_NPY_CONFIG_H_ | ||
138 | #error config.h should never be included directly, include npy_config.h instead | ||
139 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/mipsarchn32el/_numpyconfig.h b/meta/recipes-devtools/python-numpy/files/mipsarchn32el/_numpyconfig.h deleted file mode 100644 index 8e2b5d0940..0000000000 --- a/meta/recipes-devtools/python-numpy/files/mipsarchn32el/_numpyconfig.h +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 16 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 | ||
11 | #define NPY_ENABLE_SEPARATE_COMPILATION 1 | ||
12 | #define NPY_SIZEOF_PY_INTPTR_T 8 | ||
13 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
14 | #define NPY_SIZEOF_LONGLONG 8 | ||
15 | #define NPY_NO_SMP 0 | ||
16 | #define NPY_HAVE_DECL_ISNAN | ||
17 | #define NPY_HAVE_DECL_ISINF | ||
18 | #define NPY_HAVE_DECL_ISFINITE | ||
19 | #define NPY_HAVE_DECL_SIGNBIT | ||
20 | #define NPY_USE_C99_COMPLEX 1 | ||
21 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
22 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
23 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
24 | #define NPY_USE_C99_FORMATS 1 | ||
25 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
26 | #define NPY_ABI_VERSION 0x01000009 | ||
27 | #define NPY_API_VERSION 0x0000000A | ||
28 | |||
29 | #ifndef __STDC_FORMAT_MACROS | ||
30 | #define __STDC_FORMAT_MACROS 1 | ||
31 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/mipsarchn32el/config.h b/meta/recipes-devtools/python-numpy/files/mipsarchn32el/config.h deleted file mode 100644 index 48727039ae..0000000000 --- a/meta/recipes-devtools/python-numpy/files/mipsarchn32el/config.h +++ /dev/null | |||
@@ -1,138 +0,0 @@ | |||
1 | #define SIZEOF_PY_INTPTR_T 8 | ||
2 | #define SIZEOF_PY_LONG_LONG 8 | ||
3 | #define MATHLIB m | ||
4 | #define HAVE_SIN 1 | ||
5 | #define HAVE_COS 1 | ||
6 | #define HAVE_TAN 1 | ||
7 | #define HAVE_SINH 1 | ||
8 | #define HAVE_COSH 1 | ||
9 | #define HAVE_TANH 1 | ||
10 | #define HAVE_FABS 1 | ||
11 | #define HAVE_FLOOR 1 | ||
12 | #define HAVE_CEIL 1 | ||
13 | #define HAVE_SQRT 1 | ||
14 | #define HAVE_LOG10 1 | ||
15 | #define HAVE_LOG 1 | ||
16 | #define HAVE_EXP 1 | ||
17 | #define HAVE_ASIN 1 | ||
18 | #define HAVE_ACOS 1 | ||
19 | #define HAVE_ATAN 1 | ||
20 | #define HAVE_FMOD 1 | ||
21 | #define HAVE_MODF 1 | ||
22 | #define HAVE_FREXP 1 | ||
23 | #define HAVE_LDEXP 1 | ||
24 | #define HAVE_RINT 1 | ||
25 | #define HAVE_TRUNC 1 | ||
26 | #define HAVE_EXP2 1 | ||
27 | #define HAVE_LOG2 1 | ||
28 | #define HAVE_ATAN2 1 | ||
29 | #define HAVE_POW 1 | ||
30 | #define HAVE_NEXTAFTER 1 | ||
31 | #define HAVE_SINF 1 | ||
32 | #define HAVE_COSF 1 | ||
33 | #define HAVE_TANF 1 | ||
34 | #define HAVE_SINHF 1 | ||
35 | #define HAVE_COSHF 1 | ||
36 | #define HAVE_TANHF 1 | ||
37 | #define HAVE_FABSF 1 | ||
38 | #define HAVE_FLOORF 1 | ||
39 | #define HAVE_CEILF 1 | ||
40 | #define HAVE_RINTF 1 | ||
41 | #define HAVE_TRUNCF 1 | ||
42 | #define HAVE_SQRTF 1 | ||
43 | #define HAVE_LOG10F 1 | ||
44 | #define HAVE_LOGF 1 | ||
45 | #define HAVE_LOG1PF 1 | ||
46 | #define HAVE_EXPF 1 | ||
47 | #define HAVE_EXPM1F 1 | ||
48 | #define HAVE_ASINF 1 | ||
49 | #define HAVE_ACOSF 1 | ||
50 | #define HAVE_ATANF 1 | ||
51 | #define HAVE_ASINHF 1 | ||
52 | #define HAVE_ACOSHF 1 | ||
53 | #define HAVE_ATANHF 1 | ||
54 | #define HAVE_HYPOTF 1 | ||
55 | #define HAVE_ATAN2F 1 | ||
56 | #define HAVE_POWF 1 | ||
57 | #define HAVE_FMODF 1 | ||
58 | #define HAVE_MODFF 1 | ||
59 | #define HAVE_FREXPF 1 | ||
60 | #define HAVE_LDEXPF 1 | ||
61 | #define HAVE_EXP2F 1 | ||
62 | #define HAVE_LOG2F 1 | ||
63 | #define HAVE_COPYSIGNF 1 | ||
64 | #define HAVE_NEXTAFTERF 1 | ||
65 | #define HAVE_SINL 1 | ||
66 | #define HAVE_COSL 1 | ||
67 | #define HAVE_TANL 1 | ||
68 | #define HAVE_SINHL 1 | ||
69 | #define HAVE_COSHL 1 | ||
70 | #define HAVE_TANHL 1 | ||
71 | #define HAVE_FABSL 1 | ||
72 | #define HAVE_FLOORL 1 | ||
73 | #define HAVE_CEILL 1 | ||
74 | #define HAVE_RINTL 1 | ||
75 | #define HAVE_TRUNCL 1 | ||
76 | #define HAVE_SQRTL 1 | ||
77 | #define HAVE_LOG10L 1 | ||
78 | #define HAVE_LOGL 1 | ||
79 | #define HAVE_LOG1PL 1 | ||
80 | #define HAVE_EXPL 1 | ||
81 | #define HAVE_EXPM1L 1 | ||
82 | #define HAVE_ASINL 1 | ||
83 | #define HAVE_ACOSL 1 | ||
84 | #define HAVE_ATANL 1 | ||
85 | #define HAVE_ASINHL 1 | ||
86 | #define HAVE_ACOSHL 1 | ||
87 | #define HAVE_ATANHL 1 | ||
88 | #define HAVE_HYPOTL 1 | ||
89 | #define HAVE_ATAN2L 1 | ||
90 | #define HAVE_POWL 1 | ||
91 | #define HAVE_FMODL 1 | ||
92 | #define HAVE_MODFL 1 | ||
93 | #define HAVE_FREXPL 1 | ||
94 | #define HAVE_LDEXPL 1 | ||
95 | #define HAVE_EXP2L 1 | ||
96 | #define HAVE_LOG2L 1 | ||
97 | #define HAVE_COPYSIGNL 1 | ||
98 | #define HAVE_NEXTAFTERL 1 | ||
99 | #define HAVE_DECL_SIGNBIT | ||
100 | #define HAVE_COMPLEX_H 1 | ||
101 | #define HAVE_CREAL 1 | ||
102 | #define HAVE_CIMAG 1 | ||
103 | #define HAVE_CABS 1 | ||
104 | #define HAVE_CARG 1 | ||
105 | #define HAVE_CEXP 1 | ||
106 | #define HAVE_CSQRT 1 | ||
107 | #define HAVE_CLOG 1 | ||
108 | #define HAVE_CCOS 1 | ||
109 | #define HAVE_CSIN 1 | ||
110 | #define HAVE_CPOW 1 | ||
111 | #define HAVE_CREALF 1 | ||
112 | #define HAVE_CIMAGF 1 | ||
113 | #define HAVE_CABSF 1 | ||
114 | #define HAVE_CARGF 1 | ||
115 | #define HAVE_CEXPF 1 | ||
116 | #define HAVE_CSQRTF 1 | ||
117 | #define HAVE_CLOGF 1 | ||
118 | #define HAVE_CCOSF 1 | ||
119 | #define HAVE_CSINF 1 | ||
120 | #define HAVE_CPOWF 1 | ||
121 | #define HAVE_CREALL 1 | ||
122 | #define HAVE_CIMAGL 1 | ||
123 | #define HAVE_CABSL 1 | ||
124 | #define HAVE_CARGL 1 | ||
125 | #define HAVE_CEXPL 1 | ||
126 | #define HAVE_CSQRTL 1 | ||
127 | #define HAVE_CLOGL 1 | ||
128 | #define HAVE_CCOSL 1 | ||
129 | #define HAVE_CSINL 1 | ||
130 | #define HAVE_CPOWL 1 | ||
131 | #define HAVE_LDOUBLE_IEEE_QUAD_LE 1 | ||
132 | #ifndef __cplusplus | ||
133 | /* #undef inline */ | ||
134 | #endif | ||
135 | |||
136 | #ifndef _NPY_NPY_CONFIG_H_ | ||
137 | #error config.h should never be included directly, include npy_config.h instead | ||
138 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/_numpyconfig.h b/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/_numpyconfig.h deleted file mode 100644 index debb390094..0000000000 --- a/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/_numpyconfig.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 16 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 | ||
11 | #define NPY_ENABLE_SEPARATE_COMPILATION 1 | ||
12 | #define NPY_SIZEOF_PY_INTPTR_T 8 | ||
13 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
14 | #define NPY_SIZEOF_LONGLONG 8 | ||
15 | #define NPY_SIZEOF_OFF_T 8 | ||
16 | #define NPY_NO_SMP 0 | ||
17 | #define NPY_HAVE_DECL_ISNAN | ||
18 | #define NPY_HAVE_DECL_ISINF | ||
19 | #define NPY_HAVE_DECL_ISFINITE | ||
20 | #define NPY_HAVE_DECL_SIGNBIT | ||
21 | #define NPY_USE_C99_COMPLEX 1 | ||
22 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
23 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
24 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
25 | #define NPY_USE_C99_FORMATS 1 | ||
26 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
27 | #define NPY_ABI_VERSION 0x01000009 | ||
28 | #define NPY_API_VERSION 0x0000000A | ||
29 | |||
30 | #ifndef __STDC_FORMAT_MACROS | ||
31 | #define __STDC_FORMAT_MACROS 1 | ||
32 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/config.h b/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/config.h deleted file mode 100644 index c30b868f2f..0000000000 --- a/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/config.h +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | #define HAVE_ENDIAN_H 1 | ||
2 | #define SIZEOF_PY_INTPTR_T 8 | ||
3 | #define SIZEOF_PY_LONG_LONG 8 | ||
4 | #define MATHLIB m | ||
5 | #define HAVE_SIN 1 | ||
6 | #define HAVE_COS 1 | ||
7 | #define HAVE_TAN 1 | ||
8 | #define HAVE_SINH 1 | ||
9 | #define HAVE_COSH 1 | ||
10 | #define HAVE_TANH 1 | ||
11 | #define HAVE_FABS 1 | ||
12 | #define HAVE_FLOOR 1 | ||
13 | #define HAVE_CEIL 1 | ||
14 | #define HAVE_SQRT 1 | ||
15 | #define HAVE_LOG10 1 | ||
16 | #define HAVE_LOG 1 | ||
17 | #define HAVE_EXP 1 | ||
18 | #define HAVE_ASIN 1 | ||
19 | #define HAVE_ACOS 1 | ||
20 | #define HAVE_ATAN 1 | ||
21 | #define HAVE_FMOD 1 | ||
22 | #define HAVE_MODF 1 | ||
23 | #define HAVE_FREXP 1 | ||
24 | #define HAVE_LDEXP 1 | ||
25 | #define HAVE_RINT 1 | ||
26 | #define HAVE_TRUNC 1 | ||
27 | #define HAVE_EXP2 1 | ||
28 | #define HAVE_LOG2 1 | ||
29 | #define HAVE_ATAN2 1 | ||
30 | #define HAVE_POW 1 | ||
31 | #define HAVE_NEXTAFTER 1 | ||
32 | #define HAVE_SINF 1 | ||
33 | #define HAVE_COSF 1 | ||
34 | #define HAVE_TANF 1 | ||
35 | #define HAVE_SINHF 1 | ||
36 | #define HAVE_COSHF 1 | ||
37 | #define HAVE_TANHF 1 | ||
38 | #define HAVE_FABSF 1 | ||
39 | #define HAVE_FLOORF 1 | ||
40 | #define HAVE_CEILF 1 | ||
41 | #define HAVE_RINTF 1 | ||
42 | #define HAVE_TRUNCF 1 | ||
43 | #define HAVE_SQRTF 1 | ||
44 | #define HAVE_LOG10F 1 | ||
45 | #define HAVE_LOGF 1 | ||
46 | #define HAVE_LOG1PF 1 | ||
47 | #define HAVE_EXPF 1 | ||
48 | #define HAVE_EXPM1F 1 | ||
49 | #define HAVE_ASINF 1 | ||
50 | #define HAVE_ACOSF 1 | ||
51 | #define HAVE_ATANF 1 | ||
52 | #define HAVE_ASINHF 1 | ||
53 | #define HAVE_ACOSHF 1 | ||
54 | #define HAVE_ATANHF 1 | ||
55 | #define HAVE_HYPOTF 1 | ||
56 | #define HAVE_ATAN2F 1 | ||
57 | #define HAVE_POWF 1 | ||
58 | #define HAVE_FMODF 1 | ||
59 | #define HAVE_MODFF 1 | ||
60 | #define HAVE_FREXPF 1 | ||
61 | #define HAVE_LDEXPF 1 | ||
62 | #define HAVE_EXP2F 1 | ||
63 | #define HAVE_LOG2F 1 | ||
64 | #define HAVE_COPYSIGNF 1 | ||
65 | #define HAVE_NEXTAFTERF 1 | ||
66 | #define HAVE_SINL 1 | ||
67 | #define HAVE_COSL 1 | ||
68 | #define HAVE_TANL 1 | ||
69 | #define HAVE_SINHL 1 | ||
70 | #define HAVE_COSHL 1 | ||
71 | #define HAVE_TANHL 1 | ||
72 | #define HAVE_FABSL 1 | ||
73 | #define HAVE_FLOORL 1 | ||
74 | #define HAVE_CEILL 1 | ||
75 | #define HAVE_RINTL 1 | ||
76 | #define HAVE_TRUNCL 1 | ||
77 | #define HAVE_SQRTL 1 | ||
78 | #define HAVE_LOG10L 1 | ||
79 | #define HAVE_LOGL 1 | ||
80 | #define HAVE_LOG1PL 1 | ||
81 | #define HAVE_EXPL 1 | ||
82 | #define HAVE_EXPM1L 1 | ||
83 | #define HAVE_ASINL 1 | ||
84 | #define HAVE_ACOSL 1 | ||
85 | #define HAVE_ATANL 1 | ||
86 | #define HAVE_ASINHL 1 | ||
87 | #define HAVE_ACOSHL 1 | ||
88 | #define HAVE_ATANHL 1 | ||
89 | #define HAVE_HYPOTL 1 | ||
90 | #define HAVE_ATAN2L 1 | ||
91 | #define HAVE_POWL 1 | ||
92 | #define HAVE_FMODL 1 | ||
93 | #define HAVE_MODFL 1 | ||
94 | #define HAVE_FREXPL 1 | ||
95 | #define HAVE_LDEXPL 1 | ||
96 | #define HAVE_EXP2L 1 | ||
97 | #define HAVE_LOG2L 1 | ||
98 | #define HAVE_COPYSIGNL 1 | ||
99 | #define HAVE_NEXTAFTERL 1 | ||
100 | #define HAVE_DECL_SIGNBIT | ||
101 | #define HAVE_COMPLEX_H 1 | ||
102 | #define HAVE_CREAL 1 | ||
103 | #define HAVE_CIMAG 1 | ||
104 | #define HAVE_CABS 1 | ||
105 | #define HAVE_CARG 1 | ||
106 | #define HAVE_CEXP 1 | ||
107 | #define HAVE_CSQRT 1 | ||
108 | #define HAVE_CLOG 1 | ||
109 | #define HAVE_CCOS 1 | ||
110 | #define HAVE_CSIN 1 | ||
111 | #define HAVE_CPOW 1 | ||
112 | #define HAVE_CREALF 1 | ||
113 | #define HAVE_CIMAGF 1 | ||
114 | #define HAVE_CABSF 1 | ||
115 | #define HAVE_CARGF 1 | ||
116 | #define HAVE_CEXPF 1 | ||
117 | #define HAVE_CSQRTF 1 | ||
118 | #define HAVE_CLOGF 1 | ||
119 | #define HAVE_CCOSF 1 | ||
120 | #define HAVE_CSINF 1 | ||
121 | #define HAVE_CPOWF 1 | ||
122 | #define HAVE_CREALL 1 | ||
123 | #define HAVE_CIMAGL 1 | ||
124 | #define HAVE_CABSL 1 | ||
125 | #define HAVE_CARGL 1 | ||
126 | #define HAVE_CEXPL 1 | ||
127 | #define HAVE_CSQRTL 1 | ||
128 | #define HAVE_CLOGL 1 | ||
129 | #define HAVE_CCOSL 1 | ||
130 | #define HAVE_CSINL 1 | ||
131 | #define HAVE_CPOWL 1 | ||
132 | #define HAVE_LDOUBLE_IEEE_QUAD_LE 1 | ||
133 | #ifndef __cplusplus | ||
134 | /* #undef inline */ | ||
135 | #endif | ||
136 | |||
137 | #ifndef _NPY_NPY_CONFIG_H_ | ||
138 | #error config.h should never be included directly, include npy_config.h instead | ||
139 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/mipsarchn64el/_numpyconfig.h b/meta/recipes-devtools/python-numpy/files/mipsarchn64el/_numpyconfig.h deleted file mode 100644 index debb390094..0000000000 --- a/meta/recipes-devtools/python-numpy/files/mipsarchn64el/_numpyconfig.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 16 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 | ||
11 | #define NPY_ENABLE_SEPARATE_COMPILATION 1 | ||
12 | #define NPY_SIZEOF_PY_INTPTR_T 8 | ||
13 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
14 | #define NPY_SIZEOF_LONGLONG 8 | ||
15 | #define NPY_SIZEOF_OFF_T 8 | ||
16 | #define NPY_NO_SMP 0 | ||
17 | #define NPY_HAVE_DECL_ISNAN | ||
18 | #define NPY_HAVE_DECL_ISINF | ||
19 | #define NPY_HAVE_DECL_ISFINITE | ||
20 | #define NPY_HAVE_DECL_SIGNBIT | ||
21 | #define NPY_USE_C99_COMPLEX 1 | ||
22 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
23 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
24 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
25 | #define NPY_USE_C99_FORMATS 1 | ||
26 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
27 | #define NPY_ABI_VERSION 0x01000009 | ||
28 | #define NPY_API_VERSION 0x0000000A | ||
29 | |||
30 | #ifndef __STDC_FORMAT_MACROS | ||
31 | #define __STDC_FORMAT_MACROS 1 | ||
32 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/mipsarchn64el/config.h b/meta/recipes-devtools/python-numpy/files/mipsarchn64el/config.h deleted file mode 100644 index 48727039ae..0000000000 --- a/meta/recipes-devtools/python-numpy/files/mipsarchn64el/config.h +++ /dev/null | |||
@@ -1,138 +0,0 @@ | |||
1 | #define SIZEOF_PY_INTPTR_T 8 | ||
2 | #define SIZEOF_PY_LONG_LONG 8 | ||
3 | #define MATHLIB m | ||
4 | #define HAVE_SIN 1 | ||
5 | #define HAVE_COS 1 | ||
6 | #define HAVE_TAN 1 | ||
7 | #define HAVE_SINH 1 | ||
8 | #define HAVE_COSH 1 | ||
9 | #define HAVE_TANH 1 | ||
10 | #define HAVE_FABS 1 | ||
11 | #define HAVE_FLOOR 1 | ||
12 | #define HAVE_CEIL 1 | ||
13 | #define HAVE_SQRT 1 | ||
14 | #define HAVE_LOG10 1 | ||
15 | #define HAVE_LOG 1 | ||
16 | #define HAVE_EXP 1 | ||
17 | #define HAVE_ASIN 1 | ||
18 | #define HAVE_ACOS 1 | ||
19 | #define HAVE_ATAN 1 | ||
20 | #define HAVE_FMOD 1 | ||
21 | #define HAVE_MODF 1 | ||
22 | #define HAVE_FREXP 1 | ||
23 | #define HAVE_LDEXP 1 | ||
24 | #define HAVE_RINT 1 | ||
25 | #define HAVE_TRUNC 1 | ||
26 | #define HAVE_EXP2 1 | ||
27 | #define HAVE_LOG2 1 | ||
28 | #define HAVE_ATAN2 1 | ||
29 | #define HAVE_POW 1 | ||
30 | #define HAVE_NEXTAFTER 1 | ||
31 | #define HAVE_SINF 1 | ||
32 | #define HAVE_COSF 1 | ||
33 | #define HAVE_TANF 1 | ||
34 | #define HAVE_SINHF 1 | ||
35 | #define HAVE_COSHF 1 | ||
36 | #define HAVE_TANHF 1 | ||
37 | #define HAVE_FABSF 1 | ||
38 | #define HAVE_FLOORF 1 | ||
39 | #define HAVE_CEILF 1 | ||
40 | #define HAVE_RINTF 1 | ||
41 | #define HAVE_TRUNCF 1 | ||
42 | #define HAVE_SQRTF 1 | ||
43 | #define HAVE_LOG10F 1 | ||
44 | #define HAVE_LOGF 1 | ||
45 | #define HAVE_LOG1PF 1 | ||
46 | #define HAVE_EXPF 1 | ||
47 | #define HAVE_EXPM1F 1 | ||
48 | #define HAVE_ASINF 1 | ||
49 | #define HAVE_ACOSF 1 | ||
50 | #define HAVE_ATANF 1 | ||
51 | #define HAVE_ASINHF 1 | ||
52 | #define HAVE_ACOSHF 1 | ||
53 | #define HAVE_ATANHF 1 | ||
54 | #define HAVE_HYPOTF 1 | ||
55 | #define HAVE_ATAN2F 1 | ||
56 | #define HAVE_POWF 1 | ||
57 | #define HAVE_FMODF 1 | ||
58 | #define HAVE_MODFF 1 | ||
59 | #define HAVE_FREXPF 1 | ||
60 | #define HAVE_LDEXPF 1 | ||
61 | #define HAVE_EXP2F 1 | ||
62 | #define HAVE_LOG2F 1 | ||
63 | #define HAVE_COPYSIGNF 1 | ||
64 | #define HAVE_NEXTAFTERF 1 | ||
65 | #define HAVE_SINL 1 | ||
66 | #define HAVE_COSL 1 | ||
67 | #define HAVE_TANL 1 | ||
68 | #define HAVE_SINHL 1 | ||
69 | #define HAVE_COSHL 1 | ||
70 | #define HAVE_TANHL 1 | ||
71 | #define HAVE_FABSL 1 | ||
72 | #define HAVE_FLOORL 1 | ||
73 | #define HAVE_CEILL 1 | ||
74 | #define HAVE_RINTL 1 | ||
75 | #define HAVE_TRUNCL 1 | ||
76 | #define HAVE_SQRTL 1 | ||
77 | #define HAVE_LOG10L 1 | ||
78 | #define HAVE_LOGL 1 | ||
79 | #define HAVE_LOG1PL 1 | ||
80 | #define HAVE_EXPL 1 | ||
81 | #define HAVE_EXPM1L 1 | ||
82 | #define HAVE_ASINL 1 | ||
83 | #define HAVE_ACOSL 1 | ||
84 | #define HAVE_ATANL 1 | ||
85 | #define HAVE_ASINHL 1 | ||
86 | #define HAVE_ACOSHL 1 | ||
87 | #define HAVE_ATANHL 1 | ||
88 | #define HAVE_HYPOTL 1 | ||
89 | #define HAVE_ATAN2L 1 | ||
90 | #define HAVE_POWL 1 | ||
91 | #define HAVE_FMODL 1 | ||
92 | #define HAVE_MODFL 1 | ||
93 | #define HAVE_FREXPL 1 | ||
94 | #define HAVE_LDEXPL 1 | ||
95 | #define HAVE_EXP2L 1 | ||
96 | #define HAVE_LOG2L 1 | ||
97 | #define HAVE_COPYSIGNL 1 | ||
98 | #define HAVE_NEXTAFTERL 1 | ||
99 | #define HAVE_DECL_SIGNBIT | ||
100 | #define HAVE_COMPLEX_H 1 | ||
101 | #define HAVE_CREAL 1 | ||
102 | #define HAVE_CIMAG 1 | ||
103 | #define HAVE_CABS 1 | ||
104 | #define HAVE_CARG 1 | ||
105 | #define HAVE_CEXP 1 | ||
106 | #define HAVE_CSQRT 1 | ||
107 | #define HAVE_CLOG 1 | ||
108 | #define HAVE_CCOS 1 | ||
109 | #define HAVE_CSIN 1 | ||
110 | #define HAVE_CPOW 1 | ||
111 | #define HAVE_CREALF 1 | ||
112 | #define HAVE_CIMAGF 1 | ||
113 | #define HAVE_CABSF 1 | ||
114 | #define HAVE_CARGF 1 | ||
115 | #define HAVE_CEXPF 1 | ||
116 | #define HAVE_CSQRTF 1 | ||
117 | #define HAVE_CLOGF 1 | ||
118 | #define HAVE_CCOSF 1 | ||
119 | #define HAVE_CSINF 1 | ||
120 | #define HAVE_CPOWF 1 | ||
121 | #define HAVE_CREALL 1 | ||
122 | #define HAVE_CIMAGL 1 | ||
123 | #define HAVE_CABSL 1 | ||
124 | #define HAVE_CARGL 1 | ||
125 | #define HAVE_CEXPL 1 | ||
126 | #define HAVE_CSQRTL 1 | ||
127 | #define HAVE_CLOGL 1 | ||
128 | #define HAVE_CCOSL 1 | ||
129 | #define HAVE_CSINL 1 | ||
130 | #define HAVE_CPOWL 1 | ||
131 | #define HAVE_LDOUBLE_IEEE_QUAD_LE 1 | ||
132 | #ifndef __cplusplus | ||
133 | /* #undef inline */ | ||
134 | #endif | ||
135 | |||
136 | #ifndef _NPY_NPY_CONFIG_H_ | ||
137 | #error config.h should never be included directly, include npy_config.h instead | ||
138 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/_numpyconfig.h b/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/_numpyconfig.h deleted file mode 100644 index 4c465c216c..0000000000 --- a/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/_numpyconfig.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 8 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 16 | ||
11 | #define NPY_ENABLE_SEPARATE_COMPILATION 1 | ||
12 | #define NPY_SIZEOF_PY_INTPTR_T 4 | ||
13 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
14 | #define NPY_SIZEOF_LONGLONG 8 | ||
15 | #define NPY_SIZEOF_OFF_T 8 | ||
16 | #define NPY_NO_SMP 0 | ||
17 | #define NPY_HAVE_DECL_ISNAN | ||
18 | #define NPY_HAVE_DECL_ISINF | ||
19 | #define NPY_HAVE_DECL_ISFINITE | ||
20 | #define NPY_HAVE_DECL_SIGNBIT | ||
21 | #define NPY_USE_C99_COMPLEX 1 | ||
22 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
23 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
24 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
25 | #define NPY_USE_C99_FORMATS 1 | ||
26 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
27 | #define NPY_ABI_VERSION 0x01000009 | ||
28 | #define NPY_API_VERSION 0x0000000A | ||
29 | |||
30 | #ifndef __STDC_FORMAT_MACROS | ||
31 | #define __STDC_FORMAT_MACROS 1 | ||
32 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/config.h b/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/config.h deleted file mode 100644 index 2f6135adce..0000000000 --- a/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/config.h +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | #define HAVE_ENDIAN_H 1 | ||
2 | #define SIZEOF_PY_INTPTR_T 4 | ||
3 | #define SIZEOF_PY_LONG_LONG 8 | ||
4 | #define MATHLIB m | ||
5 | #define HAVE_SIN 1 | ||
6 | #define HAVE_COS 1 | ||
7 | #define HAVE_TAN 1 | ||
8 | #define HAVE_SINH 1 | ||
9 | #define HAVE_COSH 1 | ||
10 | #define HAVE_TANH 1 | ||
11 | #define HAVE_FABS 1 | ||
12 | #define HAVE_FLOOR 1 | ||
13 | #define HAVE_CEIL 1 | ||
14 | #define HAVE_SQRT 1 | ||
15 | #define HAVE_LOG10 1 | ||
16 | #define HAVE_LOG 1 | ||
17 | #define HAVE_EXP 1 | ||
18 | #define HAVE_ASIN 1 | ||
19 | #define HAVE_ACOS 1 | ||
20 | #define HAVE_ATAN 1 | ||
21 | #define HAVE_FMOD 1 | ||
22 | #define HAVE_MODF 1 | ||
23 | #define HAVE_FREXP 1 | ||
24 | #define HAVE_LDEXP 1 | ||
25 | #define HAVE_RINT 1 | ||
26 | #define HAVE_TRUNC 1 | ||
27 | #define HAVE_EXP2 1 | ||
28 | #define HAVE_LOG2 1 | ||
29 | #define HAVE_ATAN2 1 | ||
30 | #define HAVE_POW 1 | ||
31 | #define HAVE_NEXTAFTER 1 | ||
32 | #define HAVE_SINF 1 | ||
33 | #define HAVE_COSF 1 | ||
34 | #define HAVE_TANF 1 | ||
35 | #define HAVE_SINHF 1 | ||
36 | #define HAVE_COSHF 1 | ||
37 | #define HAVE_TANHF 1 | ||
38 | #define HAVE_FABSF 1 | ||
39 | #define HAVE_FLOORF 1 | ||
40 | #define HAVE_CEILF 1 | ||
41 | #define HAVE_RINTF 1 | ||
42 | #define HAVE_TRUNCF 1 | ||
43 | #define HAVE_SQRTF 1 | ||
44 | #define HAVE_LOG10F 1 | ||
45 | #define HAVE_LOGF 1 | ||
46 | #define HAVE_LOG1PF 1 | ||
47 | #define HAVE_EXPF 1 | ||
48 | #define HAVE_EXPM1F 1 | ||
49 | #define HAVE_ASINF 1 | ||
50 | #define HAVE_ACOSF 1 | ||
51 | #define HAVE_ATANF 1 | ||
52 | #define HAVE_ASINHF 1 | ||
53 | #define HAVE_ACOSHF 1 | ||
54 | #define HAVE_ATANHF 1 | ||
55 | #define HAVE_HYPOTF 1 | ||
56 | #define HAVE_ATAN2F 1 | ||
57 | #define HAVE_POWF 1 | ||
58 | #define HAVE_FMODF 1 | ||
59 | #define HAVE_MODFF 1 | ||
60 | #define HAVE_FREXPF 1 | ||
61 | #define HAVE_LDEXPF 1 | ||
62 | #define HAVE_EXP2F 1 | ||
63 | #define HAVE_LOG2F 1 | ||
64 | #define HAVE_COPYSIGNF 1 | ||
65 | #define HAVE_NEXTAFTERF 1 | ||
66 | #define HAVE_SINL 1 | ||
67 | #define HAVE_COSL 1 | ||
68 | #define HAVE_TANL 1 | ||
69 | #define HAVE_SINHL 1 | ||
70 | #define HAVE_COSHL 1 | ||
71 | #define HAVE_TANHL 1 | ||
72 | #define HAVE_FABSL 1 | ||
73 | #define HAVE_FLOORL 1 | ||
74 | #define HAVE_CEILL 1 | ||
75 | #define HAVE_RINTL 1 | ||
76 | #define HAVE_TRUNCL 1 | ||
77 | #define HAVE_SQRTL 1 | ||
78 | #define HAVE_LOG10L 1 | ||
79 | #define HAVE_LOGL 1 | ||
80 | #define HAVE_LOG1PL 1 | ||
81 | #define HAVE_EXPL 1 | ||
82 | #define HAVE_EXPM1L 1 | ||
83 | #define HAVE_ASINL 1 | ||
84 | #define HAVE_ACOSL 1 | ||
85 | #define HAVE_ATANL 1 | ||
86 | #define HAVE_ASINHL 1 | ||
87 | #define HAVE_ACOSHL 1 | ||
88 | #define HAVE_ATANHL 1 | ||
89 | #define HAVE_HYPOTL 1 | ||
90 | #define HAVE_ATAN2L 1 | ||
91 | #define HAVE_POWL 1 | ||
92 | #define HAVE_FMODL 1 | ||
93 | #define HAVE_MODFL 1 | ||
94 | #define HAVE_FREXPL 1 | ||
95 | #define HAVE_LDEXPL 1 | ||
96 | #define HAVE_EXP2L 1 | ||
97 | #define HAVE_LOG2L 1 | ||
98 | #define HAVE_COPYSIGNL 1 | ||
99 | #define HAVE_NEXTAFTERL 1 | ||
100 | #define HAVE_DECL_SIGNBIT | ||
101 | #define HAVE_COMPLEX_H 1 | ||
102 | #define HAVE_CREAL 1 | ||
103 | #define HAVE_CIMAG 1 | ||
104 | #define HAVE_CABS 1 | ||
105 | #define HAVE_CARG 1 | ||
106 | #define HAVE_CEXP 1 | ||
107 | #define HAVE_CSQRT 1 | ||
108 | #define HAVE_CLOG 1 | ||
109 | #define HAVE_CCOS 1 | ||
110 | #define HAVE_CSIN 1 | ||
111 | #define HAVE_CPOW 1 | ||
112 | #define HAVE_CREALF 1 | ||
113 | #define HAVE_CIMAGF 1 | ||
114 | #define HAVE_CABSF 1 | ||
115 | #define HAVE_CARGF 1 | ||
116 | #define HAVE_CEXPF 1 | ||
117 | #define HAVE_CSQRTF 1 | ||
118 | #define HAVE_CLOGF 1 | ||
119 | #define HAVE_CCOSF 1 | ||
120 | #define HAVE_CSINF 1 | ||
121 | #define HAVE_CPOWF 1 | ||
122 | #define HAVE_CREALL 1 | ||
123 | #define HAVE_CIMAGL 1 | ||
124 | #define HAVE_CABSL 1 | ||
125 | #define HAVE_CARGL 1 | ||
126 | #define HAVE_CEXPL 1 | ||
127 | #define HAVE_CSQRTL 1 | ||
128 | #define HAVE_CLOGL 1 | ||
129 | #define HAVE_CCOSL 1 | ||
130 | #define HAVE_CSINL 1 | ||
131 | #define HAVE_CPOWL 1 | ||
132 | #define HAVE_LDOUBLE_IEEE_DOUBLE_BE 1 | ||
133 | #ifndef __cplusplus | ||
134 | /* #undef inline */ | ||
135 | #endif | ||
136 | |||
137 | #ifndef _NPY_NPY_CONFIG_H_ | ||
138 | #error config.h should never be included directly, include npy_config.h instead | ||
139 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/mipsarcho32el/config.h b/meta/recipes-devtools/python-numpy/files/mipsarcho32el/config.h deleted file mode 100644 index 17ef186d56..0000000000 --- a/meta/recipes-devtools/python-numpy/files/mipsarcho32el/config.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */ | ||
2 | /* #define SIZEOF_SHORT 2 */ | ||
3 | /* #define SIZEOF_INT 4 */ | ||
4 | /* #define SIZEOF_LONG 4 */ | ||
5 | /* #define SIZEOF_FLOAT 4 */ | ||
6 | /* #define SIZEOF_DOUBLE 8 */ | ||
7 | #define SIZEOF_LONG_DOUBLE 12 | ||
8 | #define SIZEOF_PY_INTPTR_T 4 | ||
9 | /* #define SIZEOF_LONG_LONG 8 */ | ||
10 | #define SIZEOF_PY_LONG_LONG 8 | ||
11 | /* #define CHAR_BIT 8 */ | ||
12 | #define MATHLIB m | ||
13 | #define HAVE_FLOAT_FUNCS | ||
14 | #define HAVE_LOG1P | ||
15 | #define HAVE_EXPM1 | ||
16 | #define HAVE_INVERSE_HYPERBOLIC | ||
17 | #define HAVE_INVERSE_HYPERBOLIC_FLOAT | ||
18 | #define HAVE_ISNAN | ||
19 | #define HAVE_ISINF | ||
20 | #define HAVE_RINT | ||
21 | |||
diff --git a/meta/recipes-devtools/python-numpy/files/mipsarcho32el/numpyconfig.h b/meta/recipes-devtools/python-numpy/files/mipsarcho32el/numpyconfig.h deleted file mode 100644 index 0b7cd51af4..0000000000 --- a/meta/recipes-devtools/python-numpy/files/mipsarcho32el/numpyconfig.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | /* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */ | ||
2 | /* | ||
3 | * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT | ||
4 | * */ | ||
5 | #define NPY_SIZEOF_SHORT 2 | ||
6 | #define NPY_SIZEOF_INT 4 | ||
7 | #define NPY_SIZEOF_LONG 4 | ||
8 | #define NPY_SIZEOF_FLOAT 4 | ||
9 | #define NPY_SIZEOF_DOUBLE 8 | ||
10 | #define NPY_SIZEOF_LONGDOUBLE 12 | ||
11 | #define NPY_SIZEOF_PY_INTPTR_T 4 | ||
12 | #define NPY_NO_SMP 0 | ||
13 | |||
14 | #define NPY_SIZEOF_LONGLONG 8 | ||
15 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
16 | #define NPY_SIZEOF_OFF_T 8 | ||
17 | /* #define CHAR_BIT 8 */ | ||
18 | |||
diff --git a/meta/recipes-devtools/python-numpy/files/powerpc/_numpyconfig.h b/meta/recipes-devtools/python-numpy/files/powerpc/_numpyconfig.h deleted file mode 100644 index 6e7262ad91..0000000000 --- a/meta/recipes-devtools/python-numpy/files/powerpc/_numpyconfig.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 16 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 | ||
11 | #define NPY_ENABLE_SEPARATE_COMPILATION 1 | ||
12 | #define NPY_SIZEOF_PY_INTPTR_T 4 | ||
13 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
14 | #define NPY_SIZEOF_LONGLONG 8 | ||
15 | #define NPY_SIZEOF_OFF_T 8 | ||
16 | #define NPY_NO_SMP 0 | ||
17 | #define NPY_HAVE_DECL_ISNAN | ||
18 | #define NPY_HAVE_DECL_ISINF | ||
19 | #define NPY_HAVE_DECL_ISFINITE | ||
20 | #define NPY_HAVE_DECL_SIGNBIT | ||
21 | #define NPY_USE_C99_COMPLEX 1 | ||
22 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
23 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
24 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
25 | #define NPY_USE_C99_FORMATS 1 | ||
26 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
27 | #define NPY_ABI_VERSION 0x01000009 | ||
28 | #define NPY_API_VERSION 0x0000000A | ||
29 | |||
30 | #ifndef __STDC_FORMAT_MACROS | ||
31 | #define __STDC_FORMAT_MACROS 1 | ||
32 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/powerpc/config.h b/meta/recipes-devtools/python-numpy/files/powerpc/config.h deleted file mode 100644 index f65d39d5de..0000000000 --- a/meta/recipes-devtools/python-numpy/files/powerpc/config.h +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | #define HAVE_ENDIAN_H 1 | ||
2 | #define SIZEOF_PY_INTPTR_T 4 | ||
3 | #define SIZEOF_PY_LONG_LONG 8 | ||
4 | #define MATHLIB m | ||
5 | #define HAVE_SIN 1 | ||
6 | #define HAVE_COS 1 | ||
7 | #define HAVE_TAN 1 | ||
8 | #define HAVE_SINH 1 | ||
9 | #define HAVE_COSH 1 | ||
10 | #define HAVE_TANH 1 | ||
11 | #define HAVE_FABS 1 | ||
12 | #define HAVE_FLOOR 1 | ||
13 | #define HAVE_CEIL 1 | ||
14 | #define HAVE_SQRT 1 | ||
15 | #define HAVE_LOG10 1 | ||
16 | #define HAVE_LOG 1 | ||
17 | #define HAVE_EXP 1 | ||
18 | #define HAVE_ASIN 1 | ||
19 | #define HAVE_ACOS 1 | ||
20 | #define HAVE_ATAN 1 | ||
21 | #define HAVE_FMOD 1 | ||
22 | #define HAVE_MODF 1 | ||
23 | #define HAVE_FREXP 1 | ||
24 | #define HAVE_LDEXP 1 | ||
25 | #define HAVE_RINT 1 | ||
26 | #define HAVE_TRUNC 1 | ||
27 | #define HAVE_EXP2 1 | ||
28 | #define HAVE_LOG2 1 | ||
29 | #define HAVE_ATAN2 1 | ||
30 | #define HAVE_POW 1 | ||
31 | #define HAVE_NEXTAFTER 1 | ||
32 | #define HAVE_SINF 1 | ||
33 | #define HAVE_COSF 1 | ||
34 | #define HAVE_TANF 1 | ||
35 | #define HAVE_SINHF 1 | ||
36 | #define HAVE_COSHF 1 | ||
37 | #define HAVE_TANHF 1 | ||
38 | #define HAVE_FABSF 1 | ||
39 | #define HAVE_FLOORF 1 | ||
40 | #define HAVE_CEILF 1 | ||
41 | #define HAVE_RINTF 1 | ||
42 | #define HAVE_TRUNCF 1 | ||
43 | #define HAVE_SQRTF 1 | ||
44 | #define HAVE_LOG10F 1 | ||
45 | #define HAVE_LOGF 1 | ||
46 | #define HAVE_LOG1PF 1 | ||
47 | #define HAVE_EXPF 1 | ||
48 | #define HAVE_EXPM1F 1 | ||
49 | #define HAVE_ASINF 1 | ||
50 | #define HAVE_ACOSF 1 | ||
51 | #define HAVE_ATANF 1 | ||
52 | #define HAVE_ASINHF 1 | ||
53 | #define HAVE_ACOSHF 1 | ||
54 | #define HAVE_ATANHF 1 | ||
55 | #define HAVE_HYPOTF 1 | ||
56 | #define HAVE_ATAN2F 1 | ||
57 | #define HAVE_POWF 1 | ||
58 | #define HAVE_FMODF 1 | ||
59 | #define HAVE_MODFF 1 | ||
60 | #define HAVE_FREXPF 1 | ||
61 | #define HAVE_LDEXPF 1 | ||
62 | #define HAVE_EXP2F 1 | ||
63 | #define HAVE_LOG2F 1 | ||
64 | #define HAVE_COPYSIGNF 1 | ||
65 | #define HAVE_NEXTAFTERF 1 | ||
66 | #define HAVE_SINL 1 | ||
67 | #define HAVE_COSL 1 | ||
68 | #define HAVE_TANL 1 | ||
69 | #define HAVE_SINHL 1 | ||
70 | #define HAVE_COSHL 1 | ||
71 | #define HAVE_TANHL 1 | ||
72 | #define HAVE_FABSL 1 | ||
73 | #define HAVE_FLOORL 1 | ||
74 | #define HAVE_CEILL 1 | ||
75 | #define HAVE_RINTL 1 | ||
76 | #define HAVE_TRUNCL 1 | ||
77 | #define HAVE_SQRTL 1 | ||
78 | #define HAVE_LOG10L 1 | ||
79 | #define HAVE_LOGL 1 | ||
80 | #define HAVE_LOG1PL 1 | ||
81 | #define HAVE_EXPL 1 | ||
82 | #define HAVE_EXPM1L 1 | ||
83 | #define HAVE_ASINL 1 | ||
84 | #define HAVE_ACOSL 1 | ||
85 | #define HAVE_ATANL 1 | ||
86 | #define HAVE_ASINHL 1 | ||
87 | #define HAVE_ACOSHL 1 | ||
88 | #define HAVE_ATANHL 1 | ||
89 | #define HAVE_HYPOTL 1 | ||
90 | #define HAVE_ATAN2L 1 | ||
91 | #define HAVE_POWL 1 | ||
92 | #define HAVE_FMODL 1 | ||
93 | #define HAVE_MODFL 1 | ||
94 | #define HAVE_FREXPL 1 | ||
95 | #define HAVE_LDEXPL 1 | ||
96 | #define HAVE_EXP2L 1 | ||
97 | #define HAVE_LOG2L 1 | ||
98 | #define HAVE_COPYSIGNL 1 | ||
99 | #define HAVE_NEXTAFTERL 1 | ||
100 | #define HAVE_DECL_SIGNBIT | ||
101 | #define HAVE_COMPLEX_H 1 | ||
102 | #define HAVE_CREAL 1 | ||
103 | #define HAVE_CIMAG 1 | ||
104 | #define HAVE_CABS 1 | ||
105 | #define HAVE_CARG 1 | ||
106 | #define HAVE_CEXP 1 | ||
107 | #define HAVE_CSQRT 1 | ||
108 | #define HAVE_CLOG 1 | ||
109 | #define HAVE_CCOS 1 | ||
110 | #define HAVE_CSIN 1 | ||
111 | #define HAVE_CPOW 1 | ||
112 | #define HAVE_CREALF 1 | ||
113 | #define HAVE_CIMAGF 1 | ||
114 | #define HAVE_CABSF 1 | ||
115 | #define HAVE_CARGF 1 | ||
116 | #define HAVE_CEXPF 1 | ||
117 | #define HAVE_CSQRTF 1 | ||
118 | #define HAVE_CLOGF 1 | ||
119 | #define HAVE_CCOSF 1 | ||
120 | #define HAVE_CSINF 1 | ||
121 | #define HAVE_CPOWF 1 | ||
122 | #define HAVE_CREALL 1 | ||
123 | #define HAVE_CIMAGL 1 | ||
124 | #define HAVE_CABSL 1 | ||
125 | #define HAVE_CARGL 1 | ||
126 | #define HAVE_CEXPL 1 | ||
127 | #define HAVE_CSQRTL 1 | ||
128 | #define HAVE_CLOGL 1 | ||
129 | #define HAVE_CCOSL 1 | ||
130 | #define HAVE_CSINL 1 | ||
131 | #define HAVE_CPOWL 1 | ||
132 | #define HAVE_LDOUBLE_DOUBLE_DOUBLE_BE 1 | ||
133 | #ifndef __cplusplus | ||
134 | /* #undef inline */ | ||
135 | #endif | ||
136 | |||
137 | #ifndef _NPY_NPY_CONFIG_H_ | ||
138 | #error config.h should never be included directly, include npy_config.h instead | ||
139 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/powerpc64/_numpyconfig.h b/meta/recipes-devtools/python-numpy/files/powerpc64/_numpyconfig.h deleted file mode 100644 index debb390094..0000000000 --- a/meta/recipes-devtools/python-numpy/files/powerpc64/_numpyconfig.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 16 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 | ||
11 | #define NPY_ENABLE_SEPARATE_COMPILATION 1 | ||
12 | #define NPY_SIZEOF_PY_INTPTR_T 8 | ||
13 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
14 | #define NPY_SIZEOF_LONGLONG 8 | ||
15 | #define NPY_SIZEOF_OFF_T 8 | ||
16 | #define NPY_NO_SMP 0 | ||
17 | #define NPY_HAVE_DECL_ISNAN | ||
18 | #define NPY_HAVE_DECL_ISINF | ||
19 | #define NPY_HAVE_DECL_ISFINITE | ||
20 | #define NPY_HAVE_DECL_SIGNBIT | ||
21 | #define NPY_USE_C99_COMPLEX 1 | ||
22 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
23 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
24 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
25 | #define NPY_USE_C99_FORMATS 1 | ||
26 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
27 | #define NPY_ABI_VERSION 0x01000009 | ||
28 | #define NPY_API_VERSION 0x0000000A | ||
29 | |||
30 | #ifndef __STDC_FORMAT_MACROS | ||
31 | #define __STDC_FORMAT_MACROS 1 | ||
32 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/powerpc64/config.h b/meta/recipes-devtools/python-numpy/files/powerpc64/config.h deleted file mode 100644 index c30b868f2f..0000000000 --- a/meta/recipes-devtools/python-numpy/files/powerpc64/config.h +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | #define HAVE_ENDIAN_H 1 | ||
2 | #define SIZEOF_PY_INTPTR_T 8 | ||
3 | #define SIZEOF_PY_LONG_LONG 8 | ||
4 | #define MATHLIB m | ||
5 | #define HAVE_SIN 1 | ||
6 | #define HAVE_COS 1 | ||
7 | #define HAVE_TAN 1 | ||
8 | #define HAVE_SINH 1 | ||
9 | #define HAVE_COSH 1 | ||
10 | #define HAVE_TANH 1 | ||
11 | #define HAVE_FABS 1 | ||
12 | #define HAVE_FLOOR 1 | ||
13 | #define HAVE_CEIL 1 | ||
14 | #define HAVE_SQRT 1 | ||
15 | #define HAVE_LOG10 1 | ||
16 | #define HAVE_LOG 1 | ||
17 | #define HAVE_EXP 1 | ||
18 | #define HAVE_ASIN 1 | ||
19 | #define HAVE_ACOS 1 | ||
20 | #define HAVE_ATAN 1 | ||
21 | #define HAVE_FMOD 1 | ||
22 | #define HAVE_MODF 1 | ||
23 | #define HAVE_FREXP 1 | ||
24 | #define HAVE_LDEXP 1 | ||
25 | #define HAVE_RINT 1 | ||
26 | #define HAVE_TRUNC 1 | ||
27 | #define HAVE_EXP2 1 | ||
28 | #define HAVE_LOG2 1 | ||
29 | #define HAVE_ATAN2 1 | ||
30 | #define HAVE_POW 1 | ||
31 | #define HAVE_NEXTAFTER 1 | ||
32 | #define HAVE_SINF 1 | ||
33 | #define HAVE_COSF 1 | ||
34 | #define HAVE_TANF 1 | ||
35 | #define HAVE_SINHF 1 | ||
36 | #define HAVE_COSHF 1 | ||
37 | #define HAVE_TANHF 1 | ||
38 | #define HAVE_FABSF 1 | ||
39 | #define HAVE_FLOORF 1 | ||
40 | #define HAVE_CEILF 1 | ||
41 | #define HAVE_RINTF 1 | ||
42 | #define HAVE_TRUNCF 1 | ||
43 | #define HAVE_SQRTF 1 | ||
44 | #define HAVE_LOG10F 1 | ||
45 | #define HAVE_LOGF 1 | ||
46 | #define HAVE_LOG1PF 1 | ||
47 | #define HAVE_EXPF 1 | ||
48 | #define HAVE_EXPM1F 1 | ||
49 | #define HAVE_ASINF 1 | ||
50 | #define HAVE_ACOSF 1 | ||
51 | #define HAVE_ATANF 1 | ||
52 | #define HAVE_ASINHF 1 | ||
53 | #define HAVE_ACOSHF 1 | ||
54 | #define HAVE_ATANHF 1 | ||
55 | #define HAVE_HYPOTF 1 | ||
56 | #define HAVE_ATAN2F 1 | ||
57 | #define HAVE_POWF 1 | ||
58 | #define HAVE_FMODF 1 | ||
59 | #define HAVE_MODFF 1 | ||
60 | #define HAVE_FREXPF 1 | ||
61 | #define HAVE_LDEXPF 1 | ||
62 | #define HAVE_EXP2F 1 | ||
63 | #define HAVE_LOG2F 1 | ||
64 | #define HAVE_COPYSIGNF 1 | ||
65 | #define HAVE_NEXTAFTERF 1 | ||
66 | #define HAVE_SINL 1 | ||
67 | #define HAVE_COSL 1 | ||
68 | #define HAVE_TANL 1 | ||
69 | #define HAVE_SINHL 1 | ||
70 | #define HAVE_COSHL 1 | ||
71 | #define HAVE_TANHL 1 | ||
72 | #define HAVE_FABSL 1 | ||
73 | #define HAVE_FLOORL 1 | ||
74 | #define HAVE_CEILL 1 | ||
75 | #define HAVE_RINTL 1 | ||
76 | #define HAVE_TRUNCL 1 | ||
77 | #define HAVE_SQRTL 1 | ||
78 | #define HAVE_LOG10L 1 | ||
79 | #define HAVE_LOGL 1 | ||
80 | #define HAVE_LOG1PL 1 | ||
81 | #define HAVE_EXPL 1 | ||
82 | #define HAVE_EXPM1L 1 | ||
83 | #define HAVE_ASINL 1 | ||
84 | #define HAVE_ACOSL 1 | ||
85 | #define HAVE_ATANL 1 | ||
86 | #define HAVE_ASINHL 1 | ||
87 | #define HAVE_ACOSHL 1 | ||
88 | #define HAVE_ATANHL 1 | ||
89 | #define HAVE_HYPOTL 1 | ||
90 | #define HAVE_ATAN2L 1 | ||
91 | #define HAVE_POWL 1 | ||
92 | #define HAVE_FMODL 1 | ||
93 | #define HAVE_MODFL 1 | ||
94 | #define HAVE_FREXPL 1 | ||
95 | #define HAVE_LDEXPL 1 | ||
96 | #define HAVE_EXP2L 1 | ||
97 | #define HAVE_LOG2L 1 | ||
98 | #define HAVE_COPYSIGNL 1 | ||
99 | #define HAVE_NEXTAFTERL 1 | ||
100 | #define HAVE_DECL_SIGNBIT | ||
101 | #define HAVE_COMPLEX_H 1 | ||
102 | #define HAVE_CREAL 1 | ||
103 | #define HAVE_CIMAG 1 | ||
104 | #define HAVE_CABS 1 | ||
105 | #define HAVE_CARG 1 | ||
106 | #define HAVE_CEXP 1 | ||
107 | #define HAVE_CSQRT 1 | ||
108 | #define HAVE_CLOG 1 | ||
109 | #define HAVE_CCOS 1 | ||
110 | #define HAVE_CSIN 1 | ||
111 | #define HAVE_CPOW 1 | ||
112 | #define HAVE_CREALF 1 | ||
113 | #define HAVE_CIMAGF 1 | ||
114 | #define HAVE_CABSF 1 | ||
115 | #define HAVE_CARGF 1 | ||
116 | #define HAVE_CEXPF 1 | ||
117 | #define HAVE_CSQRTF 1 | ||
118 | #define HAVE_CLOGF 1 | ||
119 | #define HAVE_CCOSF 1 | ||
120 | #define HAVE_CSINF 1 | ||
121 | #define HAVE_CPOWF 1 | ||
122 | #define HAVE_CREALL 1 | ||
123 | #define HAVE_CIMAGL 1 | ||
124 | #define HAVE_CABSL 1 | ||
125 | #define HAVE_CARGL 1 | ||
126 | #define HAVE_CEXPL 1 | ||
127 | #define HAVE_CSQRTL 1 | ||
128 | #define HAVE_CLOGL 1 | ||
129 | #define HAVE_CCOSL 1 | ||
130 | #define HAVE_CSINL 1 | ||
131 | #define HAVE_CPOWL 1 | ||
132 | #define HAVE_LDOUBLE_IEEE_QUAD_LE 1 | ||
133 | #ifndef __cplusplus | ||
134 | /* #undef inline */ | ||
135 | #endif | ||
136 | |||
137 | #ifndef _NPY_NPY_CONFIG_H_ | ||
138 | #error config.h should never be included directly, include npy_config.h instead | ||
139 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/riscv64/_numpyconfig.h b/meta/recipes-devtools/python-numpy/files/riscv64/_numpyconfig.h deleted file mode 100644 index 109deb0435..0000000000 --- a/meta/recipes-devtools/python-numpy/files/riscv64/_numpyconfig.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
9 | #define NPY_SIZEOF_LONGDOUBLE 16 | ||
10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 | ||
11 | #define NPY_SIZEOF_PY_INTPTR_T 8 | ||
12 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
13 | #define NPY_SIZEOF_LONGLONG 8 | ||
14 | #define NPY_SIZEOF_OFF_T 8 | ||
15 | #define NPY_NO_SMP 0 | ||
16 | #define NPY_HAVE_DECL_ISNAN | ||
17 | #define NPY_HAVE_DECL_ISINF | ||
18 | #define NPY_HAVE_DECL_ISFINITE | ||
19 | #define NPY_HAVE_DECL_SIGNBIT | ||
20 | #define NPY_USE_C99_COMPLEX 1 | ||
21 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
22 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
23 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
24 | #define NPY_ENABLE_SEPARATE_COMPILATION 1 | ||
25 | #define NPY_USE_C99_FORMATS 1 | ||
26 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
27 | #define NPY_ABI_VERSION 0x01000009 | ||
28 | #define NPY_API_VERSION 0x0000000A | ||
29 | |||
30 | #ifndef __STDC_FORMAT_MACROS | ||
31 | #define __STDC_FORMAT_MACROS 1 | ||
32 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/riscv64/config.h b/meta/recipes-devtools/python-numpy/files/riscv64/config.h deleted file mode 100644 index c30b868f2f..0000000000 --- a/meta/recipes-devtools/python-numpy/files/riscv64/config.h +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | #define HAVE_ENDIAN_H 1 | ||
2 | #define SIZEOF_PY_INTPTR_T 8 | ||
3 | #define SIZEOF_PY_LONG_LONG 8 | ||
4 | #define MATHLIB m | ||
5 | #define HAVE_SIN 1 | ||
6 | #define HAVE_COS 1 | ||
7 | #define HAVE_TAN 1 | ||
8 | #define HAVE_SINH 1 | ||
9 | #define HAVE_COSH 1 | ||
10 | #define HAVE_TANH 1 | ||
11 | #define HAVE_FABS 1 | ||
12 | #define HAVE_FLOOR 1 | ||
13 | #define HAVE_CEIL 1 | ||
14 | #define HAVE_SQRT 1 | ||
15 | #define HAVE_LOG10 1 | ||
16 | #define HAVE_LOG 1 | ||
17 | #define HAVE_EXP 1 | ||
18 | #define HAVE_ASIN 1 | ||
19 | #define HAVE_ACOS 1 | ||
20 | #define HAVE_ATAN 1 | ||
21 | #define HAVE_FMOD 1 | ||
22 | #define HAVE_MODF 1 | ||
23 | #define HAVE_FREXP 1 | ||
24 | #define HAVE_LDEXP 1 | ||
25 | #define HAVE_RINT 1 | ||
26 | #define HAVE_TRUNC 1 | ||
27 | #define HAVE_EXP2 1 | ||
28 | #define HAVE_LOG2 1 | ||
29 | #define HAVE_ATAN2 1 | ||
30 | #define HAVE_POW 1 | ||
31 | #define HAVE_NEXTAFTER 1 | ||
32 | #define HAVE_SINF 1 | ||
33 | #define HAVE_COSF 1 | ||
34 | #define HAVE_TANF 1 | ||
35 | #define HAVE_SINHF 1 | ||
36 | #define HAVE_COSHF 1 | ||
37 | #define HAVE_TANHF 1 | ||
38 | #define HAVE_FABSF 1 | ||
39 | #define HAVE_FLOORF 1 | ||
40 | #define HAVE_CEILF 1 | ||
41 | #define HAVE_RINTF 1 | ||
42 | #define HAVE_TRUNCF 1 | ||
43 | #define HAVE_SQRTF 1 | ||
44 | #define HAVE_LOG10F 1 | ||
45 | #define HAVE_LOGF 1 | ||
46 | #define HAVE_LOG1PF 1 | ||
47 | #define HAVE_EXPF 1 | ||
48 | #define HAVE_EXPM1F 1 | ||
49 | #define HAVE_ASINF 1 | ||
50 | #define HAVE_ACOSF 1 | ||
51 | #define HAVE_ATANF 1 | ||
52 | #define HAVE_ASINHF 1 | ||
53 | #define HAVE_ACOSHF 1 | ||
54 | #define HAVE_ATANHF 1 | ||
55 | #define HAVE_HYPOTF 1 | ||
56 | #define HAVE_ATAN2F 1 | ||
57 | #define HAVE_POWF 1 | ||
58 | #define HAVE_FMODF 1 | ||
59 | #define HAVE_MODFF 1 | ||
60 | #define HAVE_FREXPF 1 | ||
61 | #define HAVE_LDEXPF 1 | ||
62 | #define HAVE_EXP2F 1 | ||
63 | #define HAVE_LOG2F 1 | ||
64 | #define HAVE_COPYSIGNF 1 | ||
65 | #define HAVE_NEXTAFTERF 1 | ||
66 | #define HAVE_SINL 1 | ||
67 | #define HAVE_COSL 1 | ||
68 | #define HAVE_TANL 1 | ||
69 | #define HAVE_SINHL 1 | ||
70 | #define HAVE_COSHL 1 | ||
71 | #define HAVE_TANHL 1 | ||
72 | #define HAVE_FABSL 1 | ||
73 | #define HAVE_FLOORL 1 | ||
74 | #define HAVE_CEILL 1 | ||
75 | #define HAVE_RINTL 1 | ||
76 | #define HAVE_TRUNCL 1 | ||
77 | #define HAVE_SQRTL 1 | ||
78 | #define HAVE_LOG10L 1 | ||
79 | #define HAVE_LOGL 1 | ||
80 | #define HAVE_LOG1PL 1 | ||
81 | #define HAVE_EXPL 1 | ||
82 | #define HAVE_EXPM1L 1 | ||
83 | #define HAVE_ASINL 1 | ||
84 | #define HAVE_ACOSL 1 | ||
85 | #define HAVE_ATANL 1 | ||
86 | #define HAVE_ASINHL 1 | ||
87 | #define HAVE_ACOSHL 1 | ||
88 | #define HAVE_ATANHL 1 | ||
89 | #define HAVE_HYPOTL 1 | ||
90 | #define HAVE_ATAN2L 1 | ||
91 | #define HAVE_POWL 1 | ||
92 | #define HAVE_FMODL 1 | ||
93 | #define HAVE_MODFL 1 | ||
94 | #define HAVE_FREXPL 1 | ||
95 | #define HAVE_LDEXPL 1 | ||
96 | #define HAVE_EXP2L 1 | ||
97 | #define HAVE_LOG2L 1 | ||
98 | #define HAVE_COPYSIGNL 1 | ||
99 | #define HAVE_NEXTAFTERL 1 | ||
100 | #define HAVE_DECL_SIGNBIT | ||
101 | #define HAVE_COMPLEX_H 1 | ||
102 | #define HAVE_CREAL 1 | ||
103 | #define HAVE_CIMAG 1 | ||
104 | #define HAVE_CABS 1 | ||
105 | #define HAVE_CARG 1 | ||
106 | #define HAVE_CEXP 1 | ||
107 | #define HAVE_CSQRT 1 | ||
108 | #define HAVE_CLOG 1 | ||
109 | #define HAVE_CCOS 1 | ||
110 | #define HAVE_CSIN 1 | ||
111 | #define HAVE_CPOW 1 | ||
112 | #define HAVE_CREALF 1 | ||
113 | #define HAVE_CIMAGF 1 | ||
114 | #define HAVE_CABSF 1 | ||
115 | #define HAVE_CARGF 1 | ||
116 | #define HAVE_CEXPF 1 | ||
117 | #define HAVE_CSQRTF 1 | ||
118 | #define HAVE_CLOGF 1 | ||
119 | #define HAVE_CCOSF 1 | ||
120 | #define HAVE_CSINF 1 | ||
121 | #define HAVE_CPOWF 1 | ||
122 | #define HAVE_CREALL 1 | ||
123 | #define HAVE_CIMAGL 1 | ||
124 | #define HAVE_CABSL 1 | ||
125 | #define HAVE_CARGL 1 | ||
126 | #define HAVE_CEXPL 1 | ||
127 | #define HAVE_CSQRTL 1 | ||
128 | #define HAVE_CLOGL 1 | ||
129 | #define HAVE_CCOSL 1 | ||
130 | #define HAVE_CSINL 1 | ||
131 | #define HAVE_CPOWL 1 | ||
132 | #define HAVE_LDOUBLE_IEEE_QUAD_LE 1 | ||
133 | #ifndef __cplusplus | ||
134 | /* #undef inline */ | ||
135 | #endif | ||
136 | |||
137 | #ifndef _NPY_NPY_CONFIG_H_ | ||
138 | #error config.h should never be included directly, include npy_config.h instead | ||
139 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/x86-64/_numpyconfig.h b/meta/recipes-devtools/python-numpy/files/x86-64/_numpyconfig.h deleted file mode 100644 index b330361649..0000000000 --- a/meta/recipes-devtools/python-numpy/files/x86-64/_numpyconfig.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | #define NPY_HAVE_ENDIAN_H 1 | ||
2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT | ||
3 | #define NPY_SIZEOF_INT SIZEOF_INT | ||
4 | #define NPY_SIZEOF_LONG SIZEOF_LONG | ||
5 | #define NPY_SIZEOF_FLOAT 4 | ||
6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 | ||
7 | #define NPY_SIZEOF_DOUBLE 8 | ||
8 | #define NPY_SIZEOF_OFF_T 8 | ||
9 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 | ||
10 | #define NPY_SIZEOF_LONGDOUBLE 16 | ||
11 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 | ||
12 | #define NPY_ENABLE_SEPARATE_COMPILATION 1 | ||
13 | #define NPY_SIZEOF_PY_INTPTR_T 8 | ||
14 | #define NPY_SIZEOF_PY_LONG_LONG 8 | ||
15 | #define NPY_SIZEOF_LONGLONG 8 | ||
16 | #define NPY_NO_SMP 0 | ||
17 | #define NPY_HAVE_DECL_ISNAN | ||
18 | #define NPY_HAVE_DECL_ISINF | ||
19 | #define NPY_HAVE_DECL_ISFINITE | ||
20 | #define NPY_HAVE_DECL_SIGNBIT | ||
21 | #define NPY_USE_C99_COMPLEX 1 | ||
22 | #define NPY_HAVE_COMPLEX_DOUBLE 1 | ||
23 | #define NPY_HAVE_COMPLEX_FLOAT 1 | ||
24 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 | ||
25 | #define NPY_USE_C99_FORMATS 1 | ||
26 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) | ||
27 | #define NPY_ABI_VERSION 0x01000009 | ||
28 | #define NPY_API_VERSION 0x0000000A | ||
29 | |||
30 | #ifndef __STDC_FORMAT_MACROS | ||
31 | #define __STDC_FORMAT_MACROS 1 | ||
32 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/x86-64/config.h b/meta/recipes-devtools/python-numpy/files/x86-64/config.h deleted file mode 100644 index 0ce63b7d22..0000000000 --- a/meta/recipes-devtools/python-numpy/files/x86-64/config.h +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | #define HAVE_ENDIAN_H 1 | ||
2 | #define SIZEOF_PY_INTPTR_T 8 | ||
3 | #define SIZEOF_PY_LONG_LONG 8 | ||
4 | #define MATHLIB m | ||
5 | #define HAVE_SIN 1 | ||
6 | #define HAVE_COS 1 | ||
7 | #define HAVE_TAN 1 | ||
8 | #define HAVE_SINH 1 | ||
9 | #define HAVE_COSH 1 | ||
10 | #define HAVE_TANH 1 | ||
11 | #define HAVE_FABS 1 | ||
12 | #define HAVE_FLOOR 1 | ||
13 | #define HAVE_CEIL 1 | ||
14 | #define HAVE_SQRT 1 | ||
15 | #define HAVE_LOG10 1 | ||
16 | #define HAVE_LOG 1 | ||
17 | #define HAVE_EXP 1 | ||
18 | #define HAVE_ASIN 1 | ||
19 | #define HAVE_ACOS 1 | ||
20 | #define HAVE_ATAN 1 | ||
21 | #define HAVE_FMOD 1 | ||
22 | #define HAVE_MODF 1 | ||
23 | #define HAVE_FREXP 1 | ||
24 | #define HAVE_LDEXP 1 | ||
25 | #define HAVE_RINT 1 | ||
26 | #define HAVE_TRUNC 1 | ||
27 | #define HAVE_EXP2 1 | ||
28 | #define HAVE_LOG2 1 | ||
29 | #define HAVE_ATAN2 1 | ||
30 | #define HAVE_POW 1 | ||
31 | #define HAVE_NEXTAFTER 1 | ||
32 | #define HAVE_SINF 1 | ||
33 | #define HAVE_COSF 1 | ||
34 | #define HAVE_TANF 1 | ||
35 | #define HAVE_SINHF 1 | ||
36 | #define HAVE_COSHF 1 | ||
37 | #define HAVE_TANHF 1 | ||
38 | #define HAVE_FABSF 1 | ||
39 | #define HAVE_FLOORF 1 | ||
40 | #define HAVE_CEILF 1 | ||
41 | #define HAVE_RINTF 1 | ||
42 | #define HAVE_TRUNCF 1 | ||
43 | #define HAVE_SQRTF 1 | ||
44 | #define HAVE_LOG10F 1 | ||
45 | #define HAVE_LOGF 1 | ||
46 | #define HAVE_LOG1PF 1 | ||
47 | #define HAVE_EXPF 1 | ||
48 | #define HAVE_EXPM1F 1 | ||
49 | #define HAVE_ASINF 1 | ||
50 | #define HAVE_ACOSF 1 | ||
51 | #define HAVE_ATANF 1 | ||
52 | #define HAVE_ASINHF 1 | ||
53 | #define HAVE_ACOSHF 1 | ||
54 | #define HAVE_ATANHF 1 | ||
55 | #define HAVE_HYPOTF 1 | ||
56 | #define HAVE_ATAN2F 1 | ||
57 | #define HAVE_POWF 1 | ||
58 | #define HAVE_FMODF 1 | ||
59 | #define HAVE_MODFF 1 | ||
60 | #define HAVE_FREXPF 1 | ||
61 | #define HAVE_LDEXPF 1 | ||
62 | #define HAVE_EXP2F 1 | ||
63 | #define HAVE_LOG2F 1 | ||
64 | #define HAVE_COPYSIGNF 1 | ||
65 | #define HAVE_NEXTAFTERF 1 | ||
66 | #define HAVE_SINL 1 | ||
67 | #define HAVE_COSL 1 | ||
68 | #define HAVE_TANL 1 | ||
69 | #define HAVE_SINHL 1 | ||
70 | #define HAVE_COSHL 1 | ||
71 | #define HAVE_TANHL 1 | ||
72 | #define HAVE_FABSL 1 | ||
73 | #define HAVE_FLOORL 1 | ||
74 | #define HAVE_CEILL 1 | ||
75 | #define HAVE_RINTL 1 | ||
76 | #define HAVE_TRUNCL 1 | ||
77 | #define HAVE_SQRTL 1 | ||
78 | #define HAVE_LOG10L 1 | ||
79 | #define HAVE_LOGL 1 | ||
80 | #define HAVE_LOG1PL 1 | ||
81 | #define HAVE_EXPL 1 | ||
82 | #define HAVE_EXPM1L 1 | ||
83 | #define HAVE_ASINL 1 | ||
84 | #define HAVE_ACOSL 1 | ||
85 | #define HAVE_ATANL 1 | ||
86 | #define HAVE_ASINHL 1 | ||
87 | #define HAVE_ACOSHL 1 | ||
88 | #define HAVE_ATANHL 1 | ||
89 | #define HAVE_HYPOTL 1 | ||
90 | #define HAVE_ATAN2L 1 | ||
91 | #define HAVE_POWL 1 | ||
92 | #define HAVE_FMODL 1 | ||
93 | #define HAVE_MODFL 1 | ||
94 | #define HAVE_FREXPL 1 | ||
95 | #define HAVE_LDEXPL 1 | ||
96 | #define HAVE_EXP2L 1 | ||
97 | #define HAVE_LOG2L 1 | ||
98 | #define HAVE_COPYSIGNL 1 | ||
99 | #define HAVE_NEXTAFTERL 1 | ||
100 | #define HAVE_DECL_SIGNBIT | ||
101 | #define HAVE_COMPLEX_H 1 | ||
102 | #define HAVE_CREAL 1 | ||
103 | #define HAVE_CIMAG 1 | ||
104 | #define HAVE_CABS 1 | ||
105 | #define HAVE_CARG 1 | ||
106 | #define HAVE_CEXP 1 | ||
107 | #define HAVE_CSQRT 1 | ||
108 | #define HAVE_CLOG 1 | ||
109 | #define HAVE_CCOS 1 | ||
110 | #define HAVE_CSIN 1 | ||
111 | #define HAVE_CPOW 1 | ||
112 | #define HAVE_CREALF 1 | ||
113 | #define HAVE_CIMAGF 1 | ||
114 | #define HAVE_CABSF 1 | ||
115 | #define HAVE_CARGF 1 | ||
116 | #define HAVE_CEXPF 1 | ||
117 | #define HAVE_CSQRTF 1 | ||
118 | #define HAVE_CLOGF 1 | ||
119 | #define HAVE_CCOSF 1 | ||
120 | #define HAVE_CSINF 1 | ||
121 | #define HAVE_CPOWF 1 | ||
122 | #define HAVE_CREALL 1 | ||
123 | #define HAVE_CIMAGL 1 | ||
124 | #define HAVE_CABSL 1 | ||
125 | #define HAVE_CARGL 1 | ||
126 | #define HAVE_CEXPL 1 | ||
127 | #define HAVE_CSQRTL 1 | ||
128 | #define HAVE_CLOGL 1 | ||
129 | #define HAVE_CCOSL 1 | ||
130 | #define HAVE_CSINL 1 | ||
131 | #define HAVE_CPOWL 1 | ||
132 | #define HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE 1 | ||
133 | #ifndef __cplusplus | ||
134 | /* #undef inline */ | ||
135 | #endif | ||
136 | |||
137 | #ifndef _NPY_NPY_CONFIG_H_ | ||
138 | #error config.h should never be included directly, include npy_config.h instead | ||
139 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/x86/config.h b/meta/recipes-devtools/python-numpy/files/x86/config.h deleted file mode 100644 index 08e41e3d99..0000000000 --- a/meta/recipes-devtools/python-numpy/files/x86/config.h +++ /dev/null | |||
@@ -1,108 +0,0 @@ | |||
1 | #define SIZEOF_PY_INTPTR_T 4 | ||
2 | #define SIZEOF_PY_LONG_LONG 8 | ||
3 | #define MATHLIB m | ||
4 | #define HAVE_SIN | ||
5 | #define HAVE_COS | ||
6 | #define HAVE_TAN | ||
7 | #define HAVE_SINH | ||
8 | #define HAVE_COSH | ||
9 | #define HAVE_TANH | ||
10 | #define HAVE_FABS | ||
11 | #define HAVE_FLOOR | ||
12 | #define HAVE_CEIL | ||
13 | #define HAVE_SQRT | ||
14 | #define HAVE_LOG10 | ||
15 | #define HAVE_LOG | ||
16 | #define HAVE_EXP | ||
17 | #define HAVE_ASIN | ||
18 | #define HAVE_ACOS | ||
19 | #define HAVE_ATAN | ||
20 | #define HAVE_FMOD | ||
21 | #define HAVE_MODF | ||
22 | #define HAVE_FREXP | ||
23 | #define HAVE_LDEXP | ||
24 | #define HAVE_RINT | ||
25 | #define HAVE_TRUNC | ||
26 | #define HAVE_EXP2 | ||
27 | #define HAVE_LOG2 | ||
28 | #define HAVE_ATAN2 | ||
29 | #define HAVE_POW | ||
30 | #define HAVE_NEXTAFTER | ||
31 | #define HAVE_SINF | ||
32 | #define HAVE_COSF | ||
33 | #define HAVE_TANF | ||
34 | #define HAVE_SINHF | ||
35 | #define HAVE_COSHF | ||
36 | #define HAVE_TANHF | ||
37 | #define HAVE_FABSF | ||
38 | #define HAVE_FLOORF | ||
39 | #define HAVE_CEILF | ||
40 | #define HAVE_RINTF | ||
41 | #define HAVE_TRUNCF | ||
42 | #define HAVE_SQRTF | ||
43 | #define HAVE_LOG10F | ||
44 | #define HAVE_LOGF | ||
45 | #define HAVE_LOG1PF | ||
46 | #define HAVE_EXPF | ||
47 | #define HAVE_EXPM1F | ||
48 | #define HAVE_ASINF | ||
49 | #define HAVE_ACOSF | ||
50 | #define HAVE_ATANF | ||
51 | #define HAVE_ASINHF | ||
52 | #define HAVE_ACOSHF | ||
53 | #define HAVE_ATANHF | ||
54 | #define HAVE_HYPOTF | ||
55 | #define HAVE_ATAN2F | ||
56 | #define HAVE_POWF | ||
57 | #define HAVE_FMODF | ||
58 | #define HAVE_MODFF | ||
59 | #define HAVE_FREXPF | ||
60 | #define HAVE_LDEXPF | ||
61 | #define HAVE_EXP2F | ||
62 | #define HAVE_LOG2F | ||
63 | #define HAVE_COPYSIGNF | ||
64 | #define HAVE_NEXTAFTERF | ||
65 | #define HAVE_SINL | ||
66 | #define HAVE_COSL | ||
67 | #define HAVE_TANL | ||
68 | #define HAVE_SINHL | ||
69 | #define HAVE_COSHL | ||
70 | #define HAVE_TANHL | ||
71 | #define HAVE_FABSL | ||
72 | #define HAVE_FLOORL | ||
73 | #define HAVE_CEILL | ||
74 | #define HAVE_RINTL | ||
75 | #define HAVE_TRUNCL | ||
76 | #define HAVE_SQRTL | ||
77 | #define HAVE_LOG10L | ||
78 | #define HAVE_LOGL | ||
79 | #define HAVE_LOG1PL | ||
80 | #define HAVE_EXPL | ||
81 | #define HAVE_EXPM1L | ||
82 | #define HAVE_ASINL | ||
83 | #define HAVE_ACOSL | ||
84 | #define HAVE_ATANL | ||
85 | #define HAVE_ASINHL | ||
86 | #define HAVE_ACOSHL | ||
87 | #define HAVE_ATANHL | ||
88 | #define HAVE_HYPOTL | ||
89 | #define HAVE_ATAN2L | ||
90 | #define HAVE_POWL | ||
91 | #define HAVE_FMODL | ||
92 | #define HAVE_MODFL | ||
93 | #define HAVE_FREXPL | ||
94 | #define HAVE_LDEXPL | ||
95 | #define HAVE_EXP2L | ||
96 | #define HAVE_LOG2L | ||
97 | #define HAVE_COPYSIGNL | ||
98 | #define HAVE_NEXTAFTERL | ||
99 | #define HAVE_DECL_SIGNBIT | ||
100 | #define HAVE_COMPLEX_H | ||
101 | #define HAVE_LDOUBLE_INTEL_EXTENDED_12_BYTES_LE 1 | ||
102 | #ifndef __cplusplus | ||
103 | /* #undef inline */ | ||
104 | #endif | ||
105 | |||
106 | #ifndef _NPY_NPY_CONFIG_H_ | ||
107 | #error config.h should never be included directly, include npy_config.h instead | ||
108 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/files/x86/numpyconfig.h b/meta/recipes-devtools/python-numpy/files/x86/numpyconfig.h deleted file mode 100644 index ff7938cd96..0000000000 --- a/meta/recipes-devtools/python-numpy/files/x86/numpyconfig.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | #ifndef _NPY_NUMPYCONFIG_H_ | ||
2 | #define _NPY_NUMPYCONFIG_H_ | ||
3 | |||
4 | #include "_numpyconfig.h" | ||
5 | |||
6 | /* | ||
7 | * On Mac OS X, because there is only one configuration stage for all the archs | ||
8 | * in universal builds, any macro which depends on the arch needs to be | ||
9 | * harcoded | ||
10 | */ | ||
11 | #ifdef __APPLE__ | ||
12 | #undef NPY_SIZEOF_LONG | ||
13 | #undef NPY_SIZEOF_PY_INTPTR_T | ||
14 | |||
15 | #ifdef __LP64__ | ||
16 | #define NPY_SIZEOF_LONG 8 | ||
17 | #define NPY_SIZEOF_PY_INTPTR_T 8 | ||
18 | #else | ||
19 | #define NPY_SIZEOF_LONG 4 | ||
20 | #define NPY_SIZEOF_PY_INTPTR_T 4 | ||
21 | #endif | ||
22 | #endif | ||
23 | |||
24 | #endif | ||
diff --git a/meta/recipes-devtools/python-numpy/python-numpy.inc b/meta/recipes-devtools/python-numpy/python-numpy.inc index a12e72f964..f68b90e6b9 100644 --- a/meta/recipes-devtools/python-numpy/python-numpy.inc +++ b/meta/recipes-devtools/python-numpy/python-numpy.inc | |||
@@ -8,7 +8,6 @@ SRCNAME = "numpy" | |||
8 | SRC_URI = "https://github.com/${SRCNAME}/${SRCNAME}/releases/download/v${PV}/${SRCNAME}-${PV}.tar.gz \ | 8 | SRC_URI = "https://github.com/${SRCNAME}/${SRCNAME}/releases/download/v${PV}/${SRCNAME}-${PV}.tar.gz \ |
9 | file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \ | 9 | file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \ |
10 | file://0001-npy_cpu-Add-riscv-support.patch \ | 10 | file://0001-npy_cpu-Add-riscv-support.patch \ |
11 | ${CONFIGFILESURI} \ | ||
12 | file://0001-numpy-random-setup.py-remove-the-detection-of-x86-ta.patch \ | 11 | file://0001-numpy-random-setup.py-remove-the-detection-of-x86-ta.patch \ |
13 | " | 12 | " |
14 | SRC_URI[md5sum] = "c48b2ad785f82cdfe28c907ce35e2a71" | 13 | SRC_URI[md5sum] = "c48b2ad785f82cdfe28c907ce35e2a71" |
@@ -20,77 +19,10 @@ UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar" | |||
20 | # Needed for building with gcc 4.x from centos 7 | 19 | # Needed for building with gcc 4.x from centos 7 |
21 | CFLAGS_append_class-native = " -std=c99" | 20 | CFLAGS_append_class-native = " -std=c99" |
22 | 21 | ||
23 | CONFIGFILESURI ?= "" | ||
24 | |||
25 | CONFIGFILESURI_aarch64 = " \ | ||
26 | file://config.h \ | ||
27 | file://_numpyconfig.h \ | ||
28 | " | ||
29 | CONFIGFILESURI_arm = " \ | ||
30 | file://config.h \ | ||
31 | file://numpyconfig.h \ | ||
32 | " | ||
33 | CONFIGFILESURI_armeb = " \ | ||
34 | file://config.h \ | ||
35 | file://numpyconfig.h \ | ||
36 | " | ||
37 | CONFIGFILESURI_mipsarcho32el = " \ | ||
38 | file://config.h \ | ||
39 | file://numpyconfig.h \ | ||
40 | " | ||
41 | CONFIGFILESURI_x86 = " \ | ||
42 | file://config.h \ | ||
43 | file://numpyconfig.h \ | ||
44 | " | ||
45 | CONFIGFILESURI_x86-64 = " \ | ||
46 | file://config.h \ | ||
47 | file://_numpyconfig.h \ | ||
48 | " | ||
49 | CONFIGFILESURI_mipsarcho32eb = " \ | ||
50 | file://config.h \ | ||
51 | file://_numpyconfig.h \ | ||
52 | " | ||
53 | CONFIGFILESURI_powerpc = " \ | ||
54 | file://config.h \ | ||
55 | file://_numpyconfig.h \ | ||
56 | " | ||
57 | CONFIGFILESURI_powerpc64 = " \ | ||
58 | file://config.h \ | ||
59 | file://_numpyconfig.h \ | ||
60 | " | ||
61 | CONFIGFILESURI_mipsarchn64eb = " \ | ||
62 | file://config.h \ | ||
63 | file://_numpyconfig.h \ | ||
64 | " | ||
65 | CONFIGFILESURI_mipsarchn64el = " \ | ||
66 | file://config.h \ | ||
67 | file://_numpyconfig.h \ | ||
68 | " | ||
69 | CONFIGFILESURI_mipsarchn32eb = " \ | ||
70 | file://config.h \ | ||
71 | file://_numpyconfig.h \ | ||
72 | " | ||
73 | CONFIGFILESURI_mipsarchn32el = " \ | ||
74 | file://config.h \ | ||
75 | file://_numpyconfig.h \ | ||
76 | " | ||
77 | CONFIGFILESURI_riscv64 = " \ | ||
78 | file://config.h \ | ||
79 | file://_numpyconfig.h \ | ||
80 | " | ||
81 | |||
82 | S = "${WORKDIR}/numpy-${PV}" | 22 | S = "${WORKDIR}/numpy-${PV}" |
83 | 23 | ||
84 | CLEANBROKEN = "1" | 24 | CLEANBROKEN = "1" |
85 | 25 | ||
86 | # Make the build fail and replace *config.h with proper one | ||
87 | # This is a ugly, ugly hack - Koen | ||
88 | do_compile_prepend_class-target() { | ||
89 | ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py build ${DISTUTILS_BUILD_ARGS} || \ | ||
90 | true | ||
91 | cp ${WORKDIR}/*config.h ${S}/build/$(ls ${S}/build | grep src)/numpy/core/include/numpy/ | ||
92 | } | ||
93 | |||
94 | FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a" | 26 | FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a" |
95 | 27 | ||
96 | # install what is needed for numpy.test() | 28 | # install what is needed for numpy.test() |
diff --git a/meta/recipes-devtools/python/python-native_2.7.17.bb b/meta/recipes-devtools/python/python-native_2.7.18.bb index 335318bab8..335318bab8 100644 --- a/meta/recipes-devtools/python/python-native_2.7.17.bb +++ b/meta/recipes-devtools/python/python-native_2.7.18.bb | |||
diff --git a/meta/recipes-devtools/python/python.inc b/meta/recipes-devtools/python/python.inc index 19a2f3e743..fe281586fc 100644 --- a/meta/recipes-devtools/python/python.inc +++ b/meta/recipes-devtools/python/python.inc | |||
@@ -5,13 +5,13 @@ SECTION = "devel/python" | |||
5 | # bump this on every change in contrib/python/generate-manifest-2.7.py | 5 | # bump this on every change in contrib/python/generate-manifest-2.7.py |
6 | INC_PR = "r1" | 6 | INC_PR = "r1" |
7 | 7 | ||
8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e466242989bd33c1bd2b6a526a742498" | 8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=203a6dbc802ee896020a47161e759642" |
9 | 9 | ||
10 | SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ | 10 | SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ |
11 | " | 11 | " |
12 | 12 | ||
13 | SRC_URI[md5sum] = "b3b6d2c92f42a60667814358ab9f0cfd" | 13 | SRC_URI[md5sum] = "fd6cc8ec0a78c44036f825e739f36e5a" |
14 | SRC_URI[sha256sum] = "4d43f033cdbd0aa7b7023c81b0e986fd11e653b5248dac9144d508f11812ba41" | 14 | SRC_URI[sha256sum] = "b62c0e7937551d0cc02b8fd5cb0f544f9405bafc9a54d3808ed4594812edef43" |
15 | 15 | ||
16 | # python recipe is actually python 2.x | 16 | # python recipe is actually python 2.x |
17 | # also, exclude pre-releases for both python 2.x and 3.x | 17 | # also, exclude pre-releases for both python 2.x and 3.x |
diff --git a/meta/recipes-devtools/python/python3-testtools/no_traceback2.patch b/meta/recipes-devtools/python/python3-testtools/no_traceback2.patch new file mode 100644 index 0000000000..594510342b --- /dev/null +++ b/meta/recipes-devtools/python/python3-testtools/no_traceback2.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | traceback2 adds traceback for python2. Rather than depend on traceback2, we're | ||
2 | python3 only so just use traceback. | ||
3 | This caused breakage in oe-selftest -j which uses testtools on the autobuilder | ||
4 | using buildtools-tarball. | ||
5 | |||
6 | Upstream-Status: Inappropriate [Our recipe is python3 specific] | ||
7 | (Once py2 is EOL upstream probably could/should take this) | ||
8 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
9 | |||
10 | Index: testtools-2.3.0/testtools/content.py | ||
11 | =================================================================== | ||
12 | --- testtools-2.3.0.orig/testtools/content.py | ||
13 | +++ testtools-2.3.0/testtools/content.py | ||
14 | @@ -19,8 +19,7 @@ import os | ||
15 | import sys | ||
16 | |||
17 | from extras import try_import | ||
18 | -# To let setup.py work, make this a conditional import. | ||
19 | -traceback = try_import('traceback2') | ||
20 | +import traceback | ||
21 | |||
22 | from testtools.compat import ( | ||
23 | _b, | ||
diff --git a/meta/recipes-devtools/python/python3-testtools_2.3.0.bb b/meta/recipes-devtools/python/python3-testtools_2.3.0.bb index 896ecee65c..a254b90a75 100644 --- a/meta/recipes-devtools/python/python3-testtools_2.3.0.bb +++ b/meta/recipes-devtools/python/python3-testtools_2.3.0.bb | |||
@@ -1,2 +1,4 @@ | |||
1 | inherit setuptools3 | 1 | inherit setuptools3 |
2 | require python-testtools.inc | 2 | require python-testtools.inc |
3 | |||
4 | SRC_URI += "file://no_traceback2.patch" | ||
diff --git a/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch b/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch new file mode 100644 index 0000000000..acf8e1e9b5 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 85e8f86ad2b7dec0848cd55b8e810a5e2722b20a Mon Sep 17 00:00:00 2001 | ||
2 | From: Jeremy Puhlman <jpuhlman@mvista.com> | ||
3 | Date: Wed, 4 Mar 2020 00:06:42 +0000 | ||
4 | Subject: [PATCH] Don't search system for headers/libraries | ||
5 | |||
6 | Upstream-Status: Inappropriate [oe-core specific] | ||
7 | Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com> | ||
8 | --- | ||
9 | setup.py | 4 ++-- | ||
10 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
11 | |||
12 | diff --git a/setup.py b/setup.py | ||
13 | index 9da1b3a..59782c0 100644 | ||
14 | --- a/setup.py | ||
15 | +++ b/setup.py | ||
16 | @@ -674,8 +674,8 @@ class PyBuildExt(build_ext): | ||
17 | add_dir_to_list(self.compiler.include_dirs, | ||
18 | sysconfig.get_config_var("INCLUDEDIR")) | ||
19 | |||
20 | - system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib'] | ||
21 | - system_include_dirs = ['/usr/include'] | ||
22 | + system_lib_dirs = [] | ||
23 | + system_include_dirs = [] | ||
24 | # lib_dirs and inc_dirs are used to search for files; | ||
25 | # if a file is found in one of those directories, it can | ||
26 | # be assumed that no additional -I,-L directives are needed. | ||
27 | -- | ||
28 | 2.24.1 | ||
29 | |||
diff --git a/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch b/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch new file mode 100644 index 0000000000..c15295c034 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From e3b59cb9658e1d3efa3535840939a0fa92a70a5a Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | ||
3 | Date: Mon, 7 Oct 2019 13:22:14 +0200 | ||
4 | Subject: [PATCH] setup.py: do not report missing dependencies for disabled | ||
5 | modules | ||
6 | |||
7 | Reporting those missing dependencies is misleading as the modules would not | ||
8 | have been built anyway. This particularly matters in oe-core's automated | ||
9 | build completeness checker which relies on the report. | ||
10 | |||
11 | Upstream-Status: Inappropriate [oe-core specific] | ||
12 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | ||
13 | --- | ||
14 | setup.py | 4 ++++ | ||
15 | 1 file changed, 4 insertions(+) | ||
16 | |||
17 | diff --git a/setup.py b/setup.py | ||
18 | index 4b53668..0097643 100644 | ||
19 | --- a/setup.py | ||
20 | +++ b/setup.py | ||
21 | @@ -365,6 +365,10 @@ class PyBuildExt(build_ext): | ||
22 | print("%-*s %-*s %-*s" % (longest, e, longest, f, | ||
23 | longest, g)) | ||
24 | |||
25 | + # There is no need to report missing module dependencies, | ||
26 | + # if the modules have been disabled in the first place. | ||
27 | + missing = list(set(missing) - set(sysconf_dis)) | ||
28 | + | ||
29 | if missing: | ||
30 | print() | ||
31 | print("Python build finished successfully!") | ||
diff --git a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch index 0bafec73c0..d49604ba4d 100644 --- a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch +++ b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 6229502e5ae6cbb22240594f002638e9ef78f831 Mon Sep 17 00:00:00 2001 | 1 | From a274ba778838824efcacaba57c415b7262f779ec Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Tue, 14 May 2013 15:00:26 -0700 | 3 | Date: Tue, 14 May 2013 15:00:26 -0700 |
4 | Subject: [PATCH] python3: Add target and native recipes | 4 | Subject: [PATCH] python3: Add target and native recipes |
diff --git a/meta/recipes-devtools/python/python3/CVE-2020-14422.patch b/meta/recipes-devtools/python/python3/CVE-2020-14422.patch new file mode 100644 index 0000000000..31ad82d7c5 --- /dev/null +++ b/meta/recipes-devtools/python/python3/CVE-2020-14422.patch | |||
@@ -0,0 +1,79 @@ | |||
1 | From b98e7790c77a4378ec4b1c71b84138cb930b69b7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Tapas Kundu <39723251+tapakund@users.noreply.github.com> | ||
3 | Date: Wed, 1 Jul 2020 00:50:21 +0530 | ||
4 | Subject: [PATCH] [3.7] bpo-41004: Resolve hash collisions for IPv4Interface | ||
5 | and IPv6Interface (GH-21033) (GH-21231) | ||
6 | |||
7 | CVE-2020-14422 | ||
8 | The __hash__() methods of classes IPv4Interface and IPv6Interface had issue | ||
9 | of generating constant hash values of 32 and 128 respectively causing hash collisions. | ||
10 | The fix uses the hash() function to generate hash values for the objects | ||
11 | instead of XOR operation | ||
12 | (cherry picked from commit b30ee26e366bf509b7538d79bfec6c6d38d53f28) | ||
13 | |||
14 | Co-authored-by: Ravi Teja P <rvteja92@gmail.com> | ||
15 | |||
16 | Signed-off-by: Tapas Kundu <tkundu@vmware.com> | ||
17 | |||
18 | Upstream-Status: Backport [https://github.com/python/cpython/commit/b98e7790c77a4378ec4b1c71b84138cb930b69b7] | ||
19 | CVE: CVE-2020-14422 | ||
20 | Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> | ||
21 | |||
22 | --- | ||
23 | Lib/ipaddress.py | 4 ++-- | ||
24 | Lib/test/test_ipaddress.py | 11 +++++++++++ | ||
25 | .../Security/2020-06-29-16-02-29.bpo-41004.ovF0KZ.rst | 1 + | ||
26 | 3 files changed, 14 insertions(+), 2 deletions(-) | ||
27 | create mode 100644 Misc/NEWS.d/next/Security/2020-06-29-16-02-29.bpo-41004.ovF0KZ.rst | ||
28 | |||
29 | diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py | ||
30 | index 80249288d73ab..54882934c3dc1 100644 | ||
31 | --- a/Lib/ipaddress.py | ||
32 | +++ b/Lib/ipaddress.py | ||
33 | @@ -1442,7 +1442,7 @@ def __lt__(self, other): | ||
34 | return False | ||
35 | |||
36 | def __hash__(self): | ||
37 | - return self._ip ^ self._prefixlen ^ int(self.network.network_address) | ||
38 | + return hash((self._ip, self._prefixlen, int(self.network.network_address))) | ||
39 | |||
40 | __reduce__ = _IPAddressBase.__reduce__ | ||
41 | |||
42 | @@ -2088,7 +2088,7 @@ def __lt__(self, other): | ||
43 | return False | ||
44 | |||
45 | def __hash__(self): | ||
46 | - return self._ip ^ self._prefixlen ^ int(self.network.network_address) | ||
47 | + return hash((self._ip, self._prefixlen, int(self.network.network_address))) | ||
48 | |||
49 | __reduce__ = _IPAddressBase.__reduce__ | ||
50 | |||
51 | diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py | ||
52 | index 455b893fb126f..1fb6a929dc2d9 100644 | ||
53 | --- a/Lib/test/test_ipaddress.py | ||
54 | +++ b/Lib/test/test_ipaddress.py | ||
55 | @@ -2091,6 +2091,17 @@ def testsixtofour(self): | ||
56 | sixtofouraddr.sixtofour) | ||
57 | self.assertFalse(bad_addr.sixtofour) | ||
58 | |||
59 | + # issue41004 Hash collisions in IPv4Interface and IPv6Interface | ||
60 | + def testV4HashIsNotConstant(self): | ||
61 | + ipv4_address1 = ipaddress.IPv4Interface("1.2.3.4") | ||
62 | + ipv4_address2 = ipaddress.IPv4Interface("2.3.4.5") | ||
63 | + self.assertNotEqual(ipv4_address1.__hash__(), ipv4_address2.__hash__()) | ||
64 | + | ||
65 | + # issue41004 Hash collisions in IPv4Interface and IPv6Interface | ||
66 | + def testV6HashIsNotConstant(self): | ||
67 | + ipv6_address1 = ipaddress.IPv6Interface("2001:658:22a:cafe:200:0:0:1") | ||
68 | + ipv6_address2 = ipaddress.IPv6Interface("2001:658:22a:cafe:200:0:0:2") | ||
69 | + self.assertNotEqual(ipv6_address1.__hash__(), ipv6_address2.__hash__()) | ||
70 | |||
71 | if __name__ == '__main__': | ||
72 | unittest.main() | ||
73 | diff --git a/Misc/NEWS.d/next/Security/2020-06-29-16-02-29.bpo-41004.ovF0KZ.rst b/Misc/NEWS.d/next/Security/2020-06-29-16-02-29.bpo-41004.ovF0KZ.rst | ||
74 | new file mode 100644 | ||
75 | index 0000000000000..f5a9db52fff52 | ||
76 | --- /dev/null | ||
77 | +++ b/Misc/NEWS.d/next/Security/2020-06-29-16-02-29.bpo-41004.ovF0KZ.rst | ||
78 | @@ -0,0 +1 @@ | ||
79 | +CVE-2020-14422: The __hash__() methods of ipaddress.IPv4Interface and ipaddress.IPv6Interface incorrectly generated constant hash values of 32 and 128 respectively. This resulted in always causing hash collisions. The fix uses hash() to generate hash values for the tuple of (address, mask length, network address). | ||
diff --git a/meta/recipes-devtools/python/python3_3.7.6.bb b/meta/recipes-devtools/python/python3_3.7.8.bb index b33b7028d4..b18b3cd47d 100644 --- a/meta/recipes-devtools/python/python3_3.7.6.bb +++ b/meta/recipes-devtools/python/python3_3.7.8.bb | |||
@@ -3,7 +3,7 @@ HOMEPAGE = "http://www.python.org" | |||
3 | LICENSE = "PSFv2" | 3 | LICENSE = "PSFv2" |
4 | SECTION = "devel/python" | 4 | SECTION = "devel/python" |
5 | 5 | ||
6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e466242989bd33c1bd2b6a526a742498" | 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=203a6dbc802ee896020a47161e759642" |
7 | 7 | ||
8 | SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ | 8 | SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ |
9 | file://run-ptest \ | 9 | file://run-ptest \ |
@@ -28,18 +28,21 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ | |||
28 | file://reformat_sysconfig.py \ | 28 | file://reformat_sysconfig.py \ |
29 | file://0001-Use-FLAG_REF-always-for-interned-strings.patch \ | 29 | file://0001-Use-FLAG_REF-always-for-interned-strings.patch \ |
30 | file://0001-test_locale.py-correct-the-test-output-format.patch \ | 30 | file://0001-test_locale.py-correct-the-test-output-format.patch \ |
31 | file://0017-setup.py-do-not-report-missing-dependencies-for-disa.patch \ | ||
32 | file://CVE-2020-14422.patch \ | ||
31 | " | 33 | " |
32 | 34 | ||
33 | SRC_URI_append_class-native = " \ | 35 | SRC_URI_append_class-native = " \ |
34 | file://0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch \ | 36 | file://0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch \ |
35 | file://12-distutils-prefix-is-inside-staging-area.patch \ | 37 | file://12-distutils-prefix-is-inside-staging-area.patch \ |
38 | file://0001-Don-t-search-system-for-headers-libraries.patch \ | ||
36 | " | 39 | " |
37 | SRC_URI_append_class-nativesdk = " \ | 40 | SRC_URI_append_class-nativesdk = " \ |
38 | file://0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch \ | 41 | file://0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch \ |
39 | " | 42 | " |
40 | 43 | ||
41 | SRC_URI[md5sum] = "c08fbee72ad5c2c95b0f4e44bf6fd72c" | 44 | SRC_URI[md5sum] = "a224ef2249a18824f48fba9812f4006f" |
42 | SRC_URI[sha256sum] = "55a2cce72049f0794e9a11a84862e9039af9183603b78bc60d89539f82cf533f" | 45 | SRC_URI[sha256sum] = "43a543404b363f0037f89df8478f19db2dbc0d6f3ffee310bc2997fa71854a63" |
43 | 46 | ||
44 | # exclude pre-releases for both python 2.x and 3.x | 47 | # exclude pre-releases for both python 2.x and 3.x |
45 | UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar" | 48 | UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar" |
@@ -65,7 +68,7 @@ ALTERNATIVE_LINK_NAME[python-config] = "${bindir}/python${PYTHON_BINABI}-config" | |||
65 | ALTERNATIVE_TARGET[python-config] = "${bindir}/python${PYTHON_BINABI}-config-${MULTILIB_SUFFIX}" | 68 | ALTERNATIVE_TARGET[python-config] = "${bindir}/python${PYTHON_BINABI}-config-${MULTILIB_SUFFIX}" |
66 | 69 | ||
67 | 70 | ||
68 | DEPENDS = "bzip2-replacement-native libffi bzip2 gdbm openssl sqlite3 zlib virtual/libintl xz virtual/crypt util-linux libtirpc libnsl2" | 71 | DEPENDS = "bzip2-replacement-native libffi bzip2 openssl sqlite3 zlib virtual/libintl xz virtual/crypt util-linux libtirpc libnsl2" |
69 | DEPENDS_append_class-target = " python3-native" | 72 | DEPENDS_append_class-target = " python3-native" |
70 | DEPENDS_append_class-nativesdk = " python3-native" | 73 | DEPENDS_append_class-nativesdk = " python3-native" |
71 | 74 | ||
@@ -90,13 +93,23 @@ python() { | |||
90 | d.setVar('PACKAGECONFIG_PGO', '') | 93 | d.setVar('PACKAGECONFIG_PGO', '') |
91 | } | 94 | } |
92 | 95 | ||
93 | PACKAGECONFIG_class-target ??= "readline ${PACKAGECONFIG_PGO}" | 96 | PACKAGECONFIG_class-target ??= "readline ${PACKAGECONFIG_PGO} gdbm" |
94 | PACKAGECONFIG_class-native ??= "readline" | 97 | PACKAGECONFIG_class-native ??= "readline gdbm" |
95 | PACKAGECONFIG_class-nativesdk ??= "readline" | 98 | PACKAGECONFIG_class-nativesdk ??= "readline gdbm" |
96 | PACKAGECONFIG[readline] = ",,readline" | 99 | PACKAGECONFIG[readline] = ",,readline" |
97 | # Use profile guided optimisation by running PyBench inside qemu-user | 100 | # Use profile guided optimisation by running PyBench inside qemu-user |
98 | PACKAGECONFIG[pgo] = "--enable-optimizations,,qemu-native" | 101 | PACKAGECONFIG[pgo] = "--enable-optimizations,,qemu-native" |
99 | PACKAGECONFIG[tk] = ",,tk" | 102 | PACKAGECONFIG[tk] = ",,tk" |
103 | PACKAGECONFIG[gdbm] = ",,gdbm" | ||
104 | |||
105 | do_configure_prepend () { | ||
106 | mkdir -p ${B}/Modules | ||
107 | cat > ${B}/Modules/Setup.local << EOF | ||
108 | *disabled* | ||
109 | ${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '_gdbm _dbm', d)} | ||
110 | ${@bb.utils.contains('PACKAGECONFIG', 'readline', '', 'readline', d)} | ||
111 | EOF | ||
112 | } | ||
100 | 113 | ||
101 | CPPFLAGS_append = " -I${STAGING_INCDIR}/ncursesw -I${STAGING_INCDIR}/uuid" | 114 | CPPFLAGS_append = " -I${STAGING_INCDIR}/ncursesw -I${STAGING_INCDIR}/uuid" |
102 | 115 | ||
diff --git a/meta/recipes-devtools/python/python_2.7.17.bb b/meta/recipes-devtools/python/python_2.7.18.bb index 5b856a5097..5b856a5097 100644 --- a/meta/recipes-devtools/python/python_2.7.17.bb +++ b/meta/recipes-devtools/python/python_2.7.18.bb | |||
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index bb444b63d9..ec32c90ad5 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
@@ -27,9 +27,23 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
27 | file://0008-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \ | 27 | file://0008-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \ |
28 | file://0009-Fix-webkitgtk-builds.patch \ | 28 | file://0009-Fix-webkitgtk-builds.patch \ |
29 | file://0010-configure-Add-pkg-config-handling-for-libgcrypt.patch \ | 29 | file://0010-configure-Add-pkg-config-handling-for-libgcrypt.patch \ |
30 | file://0011-linux-user-remove-host-stime-syscall.patch \ | ||
30 | file://CVE-2019-15890.patch \ | 31 | file://CVE-2019-15890.patch \ |
31 | file://CVE-2019-12068.patch \ | 32 | file://CVE-2019-12068.patch \ |
32 | " | 33 | file://CVE-2020-1711.patch \ |
34 | file://CVE-2019-20382.patch \ | ||
35 | file://CVE-2020-7039-1.patch \ | ||
36 | file://CVE-2020-7039-2.patch \ | ||
37 | file://CVE-2020-7039-3.patch \ | ||
38 | file://CVE-2020-7211.patch \ | ||
39 | file://CVE-2020-11869.patch \ | ||
40 | file://CVE-2020-13765.patch \ | ||
41 | file://CVE-2020-10702.patch \ | ||
42 | file://CVE-2020-16092.patch \ | ||
43 | file://CVE-2020-10756.patch \ | ||
44 | file://CVE-2020-15863.patch \ | ||
45 | file://CVE-2020-14364.patch \ | ||
46 | " | ||
33 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 47 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
34 | 48 | ||
35 | SRC_URI[md5sum] = "cdf2b5ca52b9abac9bacb5842fa420f8" | 49 | SRC_URI[md5sum] = "cdf2b5ca52b9abac9bacb5842fa420f8" |
@@ -164,6 +178,7 @@ PACKAGECONFIG[spice] = "--enable-spice,--disable-spice,spice" | |||
164 | # usbredir will be in meta-networking layer | 178 | # usbredir will be in meta-networking layer |
165 | PACKAGECONFIG[usb-redir] = "--enable-usb-redir,--disable-usb-redir,usbredir" | 179 | PACKAGECONFIG[usb-redir] = "--enable-usb-redir,--disable-usb-redir,usbredir" |
166 | PACKAGECONFIG[snappy] = "--enable-snappy,--disable-snappy,snappy" | 180 | PACKAGECONFIG[snappy] = "--enable-snappy,--disable-snappy,snappy" |
181 | PACKAGECONFIG[glusterfs] = "--enable-glusterfs,--disable-glusterfs,glusterfs" | ||
167 | 182 | ||
168 | INSANE_SKIP_${PN} = "arch" | 183 | INSANE_SKIP_${PN} = "arch" |
169 | 184 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/0011-linux-user-remove-host-stime-syscall.patch b/meta/recipes-devtools/qemu/qemu/0011-linux-user-remove-host-stime-syscall.patch new file mode 100644 index 0000000000..659e6be45d --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/0011-linux-user-remove-host-stime-syscall.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From 0f1f2d4596aee037d3ccbcf10592466daa54107f Mon Sep 17 00:00:00 2001 | ||
2 | From: Laurent Vivier <laurent@vivier.eu> | ||
3 | Date: Tue, 12 Nov 2019 15:25:56 +0100 | ||
4 | Subject: [PATCH] linux-user: remove host stime() syscall | ||
5 | |||
6 | stime() has been withdrawn from glibc | ||
7 | (12cbde1dae6f "Use clock_settime to implement stime; withdraw stime.") | ||
8 | |||
9 | Implement the target stime() syscall using host | ||
10 | clock_settime(CLOCK_REALTIME, ...) as it is done internally in glibc. | ||
11 | |||
12 | Tested qemu-ppc/x86_64 with: | ||
13 | |||
14 | #include <time.h> | ||
15 | #include <stdio.h> | ||
16 | |||
17 | int main(void) | ||
18 | { | ||
19 | time_t t; | ||
20 | int ret; | ||
21 | |||
22 | /* date -u -d"2019-11-12T15:11:00" "+%s" */ | ||
23 | t = 1573571460; | ||
24 | ret = stime(&t); | ||
25 | printf("ret %d\n", ret); | ||
26 | return 0; | ||
27 | } | ||
28 | |||
29 | # date; ./stime; date | ||
30 | Tue Nov 12 14:18:32 UTC 2019 | ||
31 | ret 0 | ||
32 | Tue Nov 12 15:11:00 UTC 2019 | ||
33 | |||
34 | Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commit;h=0f1f2d4596aee037d3ccbcf10592466daa54107f] | ||
35 | Buglink: https://bugs.launchpad.net/qemu/+bug/1852115 | ||
36 | Reported-by: Cole Robinson <crobinso@redhat.com> | ||
37 | Signed-off-by: Laurent Vivier <laurent@vivier.eu> | ||
38 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
39 | Message-Id: <20191112142556.6335-1-laurent@vivier.eu> | ||
40 | --- | ||
41 | linux-user/syscall.c | 8 +++++--- | ||
42 | 1 file changed, 5 insertions(+), 3 deletions(-) | ||
43 | |||
44 | --- a/linux-user/syscall.c | ||
45 | +++ b/linux-user/syscall.c | ||
46 | @@ -7651,10 +7651,12 @@ static abi_long do_syscall1(void *cpu_en | ||
47 | #ifdef TARGET_NR_stime /* not on alpha */ | ||
48 | case TARGET_NR_stime: | ||
49 | { | ||
50 | - time_t host_time; | ||
51 | - if (get_user_sal(host_time, arg1)) | ||
52 | + struct timespec ts; | ||
53 | + ts.tv_nsec = 0; | ||
54 | + if (get_user_sal(ts.tv_sec, arg1)) { | ||
55 | return -TARGET_EFAULT; | ||
56 | - return get_errno(stime(&host_time)); | ||
57 | + } | ||
58 | + return get_errno(clock_settime(CLOCK_REALTIME, &ts)); | ||
59 | } | ||
60 | #endif | ||
61 | #ifdef TARGET_NR_alarm /* not on alpha */ | ||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2019-20382.patch b/meta/recipes-devtools/qemu/qemu/CVE-2019-20382.patch new file mode 100644 index 0000000000..183d100398 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2019-20382.patch | |||
@@ -0,0 +1,1018 @@ | |||
1 | From 6bf21f3d83e95bcc4ba35a7a07cc6655e8b010b0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Li Qiang <liq3ea@163.com> | ||
3 | Date: Sat, 31 Aug 2019 08:39:22 -0700 | ||
4 | Subject: [PATCH] vnc: fix memory leak when vnc disconnect | ||
5 | |||
6 | Currently when qemu receives a vnc connect, it creates a 'VncState' to | ||
7 | represent this connection. In 'vnc_worker_thread_loop' it creates a | ||
8 | local 'VncState'. The connection 'VcnState' and local 'VncState' exchange | ||
9 | data in 'vnc_async_encoding_start' and 'vnc_async_encoding_end'. | ||
10 | In 'zrle_compress_data' it calls 'deflateInit2' to allocate the libz library | ||
11 | opaque data. The 'VncState' used in 'zrle_compress_data' is the local | ||
12 | 'VncState'. In 'vnc_zrle_clear' it calls 'deflateEnd' to free the libz | ||
13 | library opaque data. The 'VncState' used in 'vnc_zrle_clear' is the connection | ||
14 | 'VncState'. In currently implementation there will be a memory leak when the | ||
15 | vnc disconnect. Following is the asan output backtrack: | ||
16 | |||
17 | Direct leak of 29760 byte(s) in 5 object(s) allocated from: | ||
18 | 0 0xffffa67ef3c3 in __interceptor_calloc (/lib64/libasan.so.4+0xd33c3) | ||
19 | 1 0xffffa65071cb in g_malloc0 (/lib64/libglib-2.0.so.0+0x571cb) | ||
20 | 2 0xffffa5e968f7 in deflateInit2_ (/lib64/libz.so.1+0x78f7) | ||
21 | 3 0xaaaacec58613 in zrle_compress_data ui/vnc-enc-zrle.c:87 | ||
22 | 4 0xaaaacec58613 in zrle_send_framebuffer_update ui/vnc-enc-zrle.c:344 | ||
23 | 5 0xaaaacec34e77 in vnc_send_framebuffer_update ui/vnc.c:919 | ||
24 | 6 0xaaaacec5e023 in vnc_worker_thread_loop ui/vnc-jobs.c:271 | ||
25 | 7 0xaaaacec5e5e7 in vnc_worker_thread ui/vnc-jobs.c:340 | ||
26 | 8 0xaaaacee4d3c3 in qemu_thread_start util/qemu-thread-posix.c:502 | ||
27 | 9 0xffffa544e8bb in start_thread (/lib64/libpthread.so.0+0x78bb) | ||
28 | 10 0xffffa53965cb in thread_start (/lib64/libc.so.6+0xd55cb) | ||
29 | |||
30 | This is because the opaque allocated in 'deflateInit2' is not freed in | ||
31 | 'deflateEnd'. The reason is that the 'deflateEnd' calls 'deflateStateCheck' | ||
32 | and in the latter will check whether 's->strm != strm'(libz's data structure). | ||
33 | This check will be true so in 'deflateEnd' it just return 'Z_STREAM_ERROR' and | ||
34 | not free the data allocated in 'deflateInit2'. | ||
35 | |||
36 | The reason this happens is that the 'VncState' contains the whole 'VncZrle', | ||
37 | so when calling 'deflateInit2', the 's->strm' will be the local address. | ||
38 | So 's->strm != strm' will be true. | ||
39 | |||
40 | To fix this issue, we need to make 'zrle' of 'VncState' to be a pointer. | ||
41 | Then the connection 'VncState' and local 'VncState' exchange mechanism will | ||
42 | work as expection. The 'tight' of 'VncState' has the same issue, let's also turn | ||
43 | it to a pointer. | ||
44 | |||
45 | Reported-by: Ying Fang <fangying1@huawei.com> | ||
46 | Signed-off-by: Li Qiang <liq3ea@163.com> | ||
47 | Message-id: 20190831153922.121308-1-liq3ea@163.com | ||
48 | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> | ||
49 | |||
50 | Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commit;h=6bf21f3d83e95bcc4ba35a7a07cc6655e8b010b0] | ||
51 | CVE: CVE-2019-20382 | ||
52 | Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> | ||
53 | |||
54 | --- | ||
55 | ui/vnc-enc-tight.c | 219 +++++++++++++++++++++++++------------------------- | ||
56 | ui/vnc-enc-zlib.c | 11 +-- | ||
57 | ui/vnc-enc-zrle.c | 68 ++++++++-------- | ||
58 | ui/vnc-enc-zrle.inc.c | 2 +- | ||
59 | ui/vnc.c | 28 ++++--- | ||
60 | ui/vnc.h | 4 +- | ||
61 | 6 files changed, 170 insertions(+), 162 deletions(-) | ||
62 | |||
63 | diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c | ||
64 | index 9084c22..1e08518 100644 | ||
65 | --- a/ui/vnc-enc-tight.c | ||
66 | +++ b/ui/vnc-enc-tight.c | ||
67 | @@ -116,7 +116,7 @@ static int send_png_rect(VncState *vs, int x, int y, int w, int h, | ||
68 | |||
69 | static bool tight_can_send_png_rect(VncState *vs, int w, int h) | ||
70 | { | ||
71 | - if (vs->tight.type != VNC_ENCODING_TIGHT_PNG) { | ||
72 | + if (vs->tight->type != VNC_ENCODING_TIGHT_PNG) { | ||
73 | return false; | ||
74 | } | ||
75 | |||
76 | @@ -144,7 +144,7 @@ tight_detect_smooth_image24(VncState *vs, int w, int h) | ||
77 | int pixels = 0; | ||
78 | int pix, left[3]; | ||
79 | unsigned int errors; | ||
80 | - unsigned char *buf = vs->tight.tight.buffer; | ||
81 | + unsigned char *buf = vs->tight->tight.buffer; | ||
82 | |||
83 | /* | ||
84 | * If client is big-endian, color samples begin from the second | ||
85 | @@ -215,7 +215,7 @@ tight_detect_smooth_image24(VncState *vs, int w, int h) | ||
86 | int pixels = 0; \ | ||
87 | int sample, sum, left[3]; \ | ||
88 | unsigned int errors; \ | ||
89 | - unsigned char *buf = vs->tight.tight.buffer; \ | ||
90 | + unsigned char *buf = vs->tight->tight.buffer; \ | ||
91 | \ | ||
92 | endian = 0; /* FIXME */ \ | ||
93 | \ | ||
94 | @@ -296,8 +296,8 @@ static int | ||
95 | tight_detect_smooth_image(VncState *vs, int w, int h) | ||
96 | { | ||
97 | unsigned int errors; | ||
98 | - int compression = vs->tight.compression; | ||
99 | - int quality = vs->tight.quality; | ||
100 | + int compression = vs->tight->compression; | ||
101 | + int quality = vs->tight->quality; | ||
102 | |||
103 | if (!vs->vd->lossy) { | ||
104 | return 0; | ||
105 | @@ -309,7 +309,7 @@ tight_detect_smooth_image(VncState *vs, int w, int h) | ||
106 | return 0; | ||
107 | } | ||
108 | |||
109 | - if (vs->tight.quality != (uint8_t)-1) { | ||
110 | + if (vs->tight->quality != (uint8_t)-1) { | ||
111 | if (w * h < VNC_TIGHT_JPEG_MIN_RECT_SIZE) { | ||
112 | return 0; | ||
113 | } | ||
114 | @@ -320,9 +320,9 @@ tight_detect_smooth_image(VncState *vs, int w, int h) | ||
115 | } | ||
116 | |||
117 | if (vs->client_pf.bytes_per_pixel == 4) { | ||
118 | - if (vs->tight.pixel24) { | ||
119 | + if (vs->tight->pixel24) { | ||
120 | errors = tight_detect_smooth_image24(vs, w, h); | ||
121 | - if (vs->tight.quality != (uint8_t)-1) { | ||
122 | + if (vs->tight->quality != (uint8_t)-1) { | ||
123 | return (errors < tight_conf[quality].jpeg_threshold24); | ||
124 | } | ||
125 | return (errors < tight_conf[compression].gradient_threshold24); | ||
126 | @@ -352,7 +352,7 @@ tight_detect_smooth_image(VncState *vs, int w, int h) | ||
127 | uint##bpp##_t c0, c1, ci; \ | ||
128 | int i, n0, n1; \ | ||
129 | \ | ||
130 | - data = (uint##bpp##_t *)vs->tight.tight.buffer; \ | ||
131 | + data = (uint##bpp##_t *)vs->tight->tight.buffer; \ | ||
132 | \ | ||
133 | c0 = data[0]; \ | ||
134 | i = 1; \ | ||
135 | @@ -423,9 +423,9 @@ static int tight_fill_palette(VncState *vs, int x, int y, | ||
136 | { | ||
137 | int max; | ||
138 | |||
139 | - max = count / tight_conf[vs->tight.compression].idx_max_colors_divisor; | ||
140 | + max = count / tight_conf[vs->tight->compression].idx_max_colors_divisor; | ||
141 | if (max < 2 && | ||
142 | - count >= tight_conf[vs->tight.compression].mono_min_rect_size) { | ||
143 | + count >= tight_conf[vs->tight->compression].mono_min_rect_size) { | ||
144 | max = 2; | ||
145 | } | ||
146 | if (max >= 256) { | ||
147 | @@ -558,7 +558,7 @@ tight_filter_gradient24(VncState *vs, uint8_t *buf, int w, int h) | ||
148 | int x, y, c; | ||
149 | |||
150 | buf32 = (uint32_t *)buf; | ||
151 | - memset(vs->tight.gradient.buffer, 0, w * 3 * sizeof(int)); | ||
152 | + memset(vs->tight->gradient.buffer, 0, w * 3 * sizeof(int)); | ||
153 | |||
154 | if (1 /* FIXME */) { | ||
155 | shift[0] = vs->client_pf.rshift; | ||
156 | @@ -575,7 +575,7 @@ tight_filter_gradient24(VncState *vs, uint8_t *buf, int w, int h) | ||
157 | upper[c] = 0; | ||
158 | here[c] = 0; | ||
159 | } | ||
160 | - prev = (int *)vs->tight.gradient.buffer; | ||
161 | + prev = (int *)vs->tight->gradient.buffer; | ||
162 | for (x = 0; x < w; x++) { | ||
163 | pix32 = *buf32++; | ||
164 | for (c = 0; c < 3; c++) { | ||
165 | @@ -615,7 +615,7 @@ tight_filter_gradient24(VncState *vs, uint8_t *buf, int w, int h) | ||
166 | int prediction; \ | ||
167 | int x, y, c; \ | ||
168 | \ | ||
169 | - memset (vs->tight.gradient.buffer, 0, w * 3 * sizeof(int)); \ | ||
170 | + memset(vs->tight->gradient.buffer, 0, w * 3 * sizeof(int)); \ | ||
171 | \ | ||
172 | endian = 0; /* FIXME */ \ | ||
173 | \ | ||
174 | @@ -631,7 +631,7 @@ tight_filter_gradient24(VncState *vs, uint8_t *buf, int w, int h) | ||
175 | upper[c] = 0; \ | ||
176 | here[c] = 0; \ | ||
177 | } \ | ||
178 | - prev = (int *)vs->tight.gradient.buffer; \ | ||
179 | + prev = (int *)vs->tight->gradient.buffer; \ | ||
180 | for (x = 0; x < w; x++) { \ | ||
181 | pix = *buf; \ | ||
182 | if (endian) { \ | ||
183 | @@ -785,7 +785,7 @@ static void extend_solid_area(VncState *vs, int x, int y, int w, int h, | ||
184 | static int tight_init_stream(VncState *vs, int stream_id, | ||
185 | int level, int strategy) | ||
186 | { | ||
187 | - z_streamp zstream = &vs->tight.stream[stream_id]; | ||
188 | + z_streamp zstream = &vs->tight->stream[stream_id]; | ||
189 | |||
190 | if (zstream->opaque == NULL) { | ||
191 | int err; | ||
192 | @@ -803,15 +803,15 @@ static int tight_init_stream(VncState *vs, int stream_id, | ||
193 | return -1; | ||
194 | } | ||
195 | |||
196 | - vs->tight.levels[stream_id] = level; | ||
197 | + vs->tight->levels[stream_id] = level; | ||
198 | zstream->opaque = vs; | ||
199 | } | ||
200 | |||
201 | - if (vs->tight.levels[stream_id] != level) { | ||
202 | + if (vs->tight->levels[stream_id] != level) { | ||
203 | if (deflateParams(zstream, level, strategy) != Z_OK) { | ||
204 | return -1; | ||
205 | } | ||
206 | - vs->tight.levels[stream_id] = level; | ||
207 | + vs->tight->levels[stream_id] = level; | ||
208 | } | ||
209 | return 0; | ||
210 | } | ||
211 | @@ -839,11 +839,11 @@ static void tight_send_compact_size(VncState *vs, size_t len) | ||
212 | static int tight_compress_data(VncState *vs, int stream_id, size_t bytes, | ||
213 | int level, int strategy) | ||
214 | { | ||
215 | - z_streamp zstream = &vs->tight.stream[stream_id]; | ||
216 | + z_streamp zstream = &vs->tight->stream[stream_id]; | ||
217 | int previous_out; | ||
218 | |||
219 | if (bytes < VNC_TIGHT_MIN_TO_COMPRESS) { | ||
220 | - vnc_write(vs, vs->tight.tight.buffer, vs->tight.tight.offset); | ||
221 | + vnc_write(vs, vs->tight->tight.buffer, vs->tight->tight.offset); | ||
222 | return bytes; | ||
223 | } | ||
224 | |||
225 | @@ -852,13 +852,13 @@ static int tight_compress_data(VncState *vs, int stream_id, size_t bytes, | ||
226 | } | ||
227 | |||
228 | /* reserve memory in output buffer */ | ||
229 | - buffer_reserve(&vs->tight.zlib, bytes + 64); | ||
230 | + buffer_reserve(&vs->tight->zlib, bytes + 64); | ||
231 | |||
232 | /* set pointers */ | ||
233 | - zstream->next_in = vs->tight.tight.buffer; | ||
234 | - zstream->avail_in = vs->tight.tight.offset; | ||
235 | - zstream->next_out = vs->tight.zlib.buffer + vs->tight.zlib.offset; | ||
236 | - zstream->avail_out = vs->tight.zlib.capacity - vs->tight.zlib.offset; | ||
237 | + zstream->next_in = vs->tight->tight.buffer; | ||
238 | + zstream->avail_in = vs->tight->tight.offset; | ||
239 | + zstream->next_out = vs->tight->zlib.buffer + vs->tight->zlib.offset; | ||
240 | + zstream->avail_out = vs->tight->zlib.capacity - vs->tight->zlib.offset; | ||
241 | previous_out = zstream->avail_out; | ||
242 | zstream->data_type = Z_BINARY; | ||
243 | |||
244 | @@ -868,14 +868,14 @@ static int tight_compress_data(VncState *vs, int stream_id, size_t bytes, | ||
245 | return -1; | ||
246 | } | ||
247 | |||
248 | - vs->tight.zlib.offset = vs->tight.zlib.capacity - zstream->avail_out; | ||
249 | + vs->tight->zlib.offset = vs->tight->zlib.capacity - zstream->avail_out; | ||
250 | /* ...how much data has actually been produced by deflate() */ | ||
251 | bytes = previous_out - zstream->avail_out; | ||
252 | |||
253 | tight_send_compact_size(vs, bytes); | ||
254 | - vnc_write(vs, vs->tight.zlib.buffer, bytes); | ||
255 | + vnc_write(vs, vs->tight->zlib.buffer, bytes); | ||
256 | |||
257 | - buffer_reset(&vs->tight.zlib); | ||
258 | + buffer_reset(&vs->tight->zlib); | ||
259 | |||
260 | return bytes; | ||
261 | } | ||
262 | @@ -927,16 +927,17 @@ static int send_full_color_rect(VncState *vs, int x, int y, int w, int h) | ||
263 | |||
264 | vnc_write_u8(vs, stream << 4); /* no flushing, no filter */ | ||
265 | |||
266 | - if (vs->tight.pixel24) { | ||
267 | - tight_pack24(vs, vs->tight.tight.buffer, w * h, &vs->tight.tight.offset); | ||
268 | + if (vs->tight->pixel24) { | ||
269 | + tight_pack24(vs, vs->tight->tight.buffer, w * h, | ||
270 | + &vs->tight->tight.offset); | ||
271 | bytes = 3; | ||
272 | } else { | ||
273 | bytes = vs->client_pf.bytes_per_pixel; | ||
274 | } | ||
275 | |||
276 | bytes = tight_compress_data(vs, stream, w * h * bytes, | ||
277 | - tight_conf[vs->tight.compression].raw_zlib_level, | ||
278 | - Z_DEFAULT_STRATEGY); | ||
279 | + tight_conf[vs->tight->compression].raw_zlib_level, | ||
280 | + Z_DEFAULT_STRATEGY); | ||
281 | |||
282 | return (bytes >= 0); | ||
283 | } | ||
284 | @@ -947,14 +948,14 @@ static int send_solid_rect(VncState *vs) | ||
285 | |||
286 | vnc_write_u8(vs, VNC_TIGHT_FILL << 4); /* no flushing, no filter */ | ||
287 | |||
288 | - if (vs->tight.pixel24) { | ||
289 | - tight_pack24(vs, vs->tight.tight.buffer, 1, &vs->tight.tight.offset); | ||
290 | + if (vs->tight->pixel24) { | ||
291 | + tight_pack24(vs, vs->tight->tight.buffer, 1, &vs->tight->tight.offset); | ||
292 | bytes = 3; | ||
293 | } else { | ||
294 | bytes = vs->client_pf.bytes_per_pixel; | ||
295 | } | ||
296 | |||
297 | - vnc_write(vs, vs->tight.tight.buffer, bytes); | ||
298 | + vnc_write(vs, vs->tight->tight.buffer, bytes); | ||
299 | return 1; | ||
300 | } | ||
301 | |||
302 | @@ -963,7 +964,7 @@ static int send_mono_rect(VncState *vs, int x, int y, | ||
303 | { | ||
304 | ssize_t bytes; | ||
305 | int stream = 1; | ||
306 | - int level = tight_conf[vs->tight.compression].mono_zlib_level; | ||
307 | + int level = tight_conf[vs->tight->compression].mono_zlib_level; | ||
308 | |||
309 | #ifdef CONFIG_VNC_PNG | ||
310 | if (tight_can_send_png_rect(vs, w, h)) { | ||
311 | @@ -991,26 +992,26 @@ static int send_mono_rect(VncState *vs, int x, int y, | ||
312 | uint32_t buf[2] = {bg, fg}; | ||
313 | size_t ret = sizeof (buf); | ||
314 | |||
315 | - if (vs->tight.pixel24) { | ||
316 | + if (vs->tight->pixel24) { | ||
317 | tight_pack24(vs, (unsigned char*)buf, 2, &ret); | ||
318 | } | ||
319 | vnc_write(vs, buf, ret); | ||
320 | |||
321 | - tight_encode_mono_rect32(vs->tight.tight.buffer, w, h, bg, fg); | ||
322 | + tight_encode_mono_rect32(vs->tight->tight.buffer, w, h, bg, fg); | ||
323 | break; | ||
324 | } | ||
325 | case 2: | ||
326 | vnc_write(vs, &bg, 2); | ||
327 | vnc_write(vs, &fg, 2); | ||
328 | - tight_encode_mono_rect16(vs->tight.tight.buffer, w, h, bg, fg); | ||
329 | + tight_encode_mono_rect16(vs->tight->tight.buffer, w, h, bg, fg); | ||
330 | break; | ||
331 | default: | ||
332 | vnc_write_u8(vs, bg); | ||
333 | vnc_write_u8(vs, fg); | ||
334 | - tight_encode_mono_rect8(vs->tight.tight.buffer, w, h, bg, fg); | ||
335 | + tight_encode_mono_rect8(vs->tight->tight.buffer, w, h, bg, fg); | ||
336 | break; | ||
337 | } | ||
338 | - vs->tight.tight.offset = bytes; | ||
339 | + vs->tight->tight.offset = bytes; | ||
340 | |||
341 | bytes = tight_compress_data(vs, stream, bytes, level, Z_DEFAULT_STRATEGY); | ||
342 | return (bytes >= 0); | ||
343 | @@ -1040,7 +1041,7 @@ static void write_palette(int idx, uint32_t color, void *opaque) | ||
344 | static bool send_gradient_rect(VncState *vs, int x, int y, int w, int h) | ||
345 | { | ||
346 | int stream = 3; | ||
347 | - int level = tight_conf[vs->tight.compression].gradient_zlib_level; | ||
348 | + int level = tight_conf[vs->tight->compression].gradient_zlib_level; | ||
349 | ssize_t bytes; | ||
350 | |||
351 | if (vs->client_pf.bytes_per_pixel == 1) { | ||
352 | @@ -1050,23 +1051,23 @@ static bool send_gradient_rect(VncState *vs, int x, int y, int w, int h) | ||
353 | vnc_write_u8(vs, (stream | VNC_TIGHT_EXPLICIT_FILTER) << 4); | ||
354 | vnc_write_u8(vs, VNC_TIGHT_FILTER_GRADIENT); | ||
355 | |||
356 | - buffer_reserve(&vs->tight.gradient, w * 3 * sizeof (int)); | ||
357 | + buffer_reserve(&vs->tight->gradient, w * 3 * sizeof(int)); | ||
358 | |||
359 | - if (vs->tight.pixel24) { | ||
360 | - tight_filter_gradient24(vs, vs->tight.tight.buffer, w, h); | ||
361 | + if (vs->tight->pixel24) { | ||
362 | + tight_filter_gradient24(vs, vs->tight->tight.buffer, w, h); | ||
363 | bytes = 3; | ||
364 | } else if (vs->client_pf.bytes_per_pixel == 4) { | ||
365 | - tight_filter_gradient32(vs, (uint32_t *)vs->tight.tight.buffer, w, h); | ||
366 | + tight_filter_gradient32(vs, (uint32_t *)vs->tight->tight.buffer, w, h); | ||
367 | bytes = 4; | ||
368 | } else { | ||
369 | - tight_filter_gradient16(vs, (uint16_t *)vs->tight.tight.buffer, w, h); | ||
370 | + tight_filter_gradient16(vs, (uint16_t *)vs->tight->tight.buffer, w, h); | ||
371 | bytes = 2; | ||
372 | } | ||
373 | |||
374 | - buffer_reset(&vs->tight.gradient); | ||
375 | + buffer_reset(&vs->tight->gradient); | ||
376 | |||
377 | bytes = w * h * bytes; | ||
378 | - vs->tight.tight.offset = bytes; | ||
379 | + vs->tight->tight.offset = bytes; | ||
380 | |||
381 | bytes = tight_compress_data(vs, stream, bytes, | ||
382 | level, Z_FILTERED); | ||
383 | @@ -1077,7 +1078,7 @@ static int send_palette_rect(VncState *vs, int x, int y, | ||
384 | int w, int h, VncPalette *palette) | ||
385 | { | ||
386 | int stream = 2; | ||
387 | - int level = tight_conf[vs->tight.compression].idx_zlib_level; | ||
388 | + int level = tight_conf[vs->tight->compression].idx_zlib_level; | ||
389 | int colors; | ||
390 | ssize_t bytes; | ||
391 | |||
392 | @@ -1104,12 +1105,12 @@ static int send_palette_rect(VncState *vs, int x, int y, | ||
393 | palette_iter(palette, write_palette, &priv); | ||
394 | vnc_write(vs, header, sizeof(header)); | ||
395 | |||
396 | - if (vs->tight.pixel24) { | ||
397 | + if (vs->tight->pixel24) { | ||
398 | tight_pack24(vs, vs->output.buffer + old_offset, colors, &offset); | ||
399 | vs->output.offset = old_offset + offset; | ||
400 | } | ||
401 | |||
402 | - tight_encode_indexed_rect32(vs->tight.tight.buffer, w * h, palette); | ||
403 | + tight_encode_indexed_rect32(vs->tight->tight.buffer, w * h, palette); | ||
404 | break; | ||
405 | } | ||
406 | case 2: | ||
407 | @@ -1119,7 +1120,7 @@ static int send_palette_rect(VncState *vs, int x, int y, | ||
408 | |||
409 | palette_iter(palette, write_palette, &priv); | ||
410 | vnc_write(vs, header, sizeof(header)); | ||
411 | - tight_encode_indexed_rect16(vs->tight.tight.buffer, w * h, palette); | ||
412 | + tight_encode_indexed_rect16(vs->tight->tight.buffer, w * h, palette); | ||
413 | break; | ||
414 | } | ||
415 | default: | ||
416 | @@ -1127,7 +1128,7 @@ static int send_palette_rect(VncState *vs, int x, int y, | ||
417 | break; | ||
418 | } | ||
419 | bytes = w * h; | ||
420 | - vs->tight.tight.offset = bytes; | ||
421 | + vs->tight->tight.offset = bytes; | ||
422 | |||
423 | bytes = tight_compress_data(vs, stream, bytes, | ||
424 | level, Z_DEFAULT_STRATEGY); | ||
425 | @@ -1146,7 +1147,7 @@ static int send_palette_rect(VncState *vs, int x, int y, | ||
426 | static void jpeg_init_destination(j_compress_ptr cinfo) | ||
427 | { | ||
428 | VncState *vs = cinfo->client_data; | ||
429 | - Buffer *buffer = &vs->tight.jpeg; | ||
430 | + Buffer *buffer = &vs->tight->jpeg; | ||
431 | |||
432 | cinfo->dest->next_output_byte = (JOCTET *)buffer->buffer + buffer->offset; | ||
433 | cinfo->dest->free_in_buffer = (size_t)(buffer->capacity - buffer->offset); | ||
434 | @@ -1156,7 +1157,7 @@ static void jpeg_init_destination(j_compress_ptr cinfo) | ||
435 | static boolean jpeg_empty_output_buffer(j_compress_ptr cinfo) | ||
436 | { | ||
437 | VncState *vs = cinfo->client_data; | ||
438 | - Buffer *buffer = &vs->tight.jpeg; | ||
439 | + Buffer *buffer = &vs->tight->jpeg; | ||
440 | |||
441 | buffer->offset = buffer->capacity; | ||
442 | buffer_reserve(buffer, 2048); | ||
443 | @@ -1168,7 +1169,7 @@ static boolean jpeg_empty_output_buffer(j_compress_ptr cinfo) | ||
444 | static void jpeg_term_destination(j_compress_ptr cinfo) | ||
445 | { | ||
446 | VncState *vs = cinfo->client_data; | ||
447 | - Buffer *buffer = &vs->tight.jpeg; | ||
448 | + Buffer *buffer = &vs->tight->jpeg; | ||
449 | |||
450 | buffer->offset = buffer->capacity - cinfo->dest->free_in_buffer; | ||
451 | } | ||
452 | @@ -1187,7 +1188,7 @@ static int send_jpeg_rect(VncState *vs, int x, int y, int w, int h, int quality) | ||
453 | return send_full_color_rect(vs, x, y, w, h); | ||
454 | } | ||
455 | |||
456 | - buffer_reserve(&vs->tight.jpeg, 2048); | ||
457 | + buffer_reserve(&vs->tight->jpeg, 2048); | ||
458 | |||
459 | cinfo.err = jpeg_std_error(&jerr); | ||
460 | jpeg_create_compress(&cinfo); | ||
461 | @@ -1222,9 +1223,9 @@ static int send_jpeg_rect(VncState *vs, int x, int y, int w, int h, int quality) | ||
462 | |||
463 | vnc_write_u8(vs, VNC_TIGHT_JPEG << 4); | ||
464 | |||
465 | - tight_send_compact_size(vs, vs->tight.jpeg.offset); | ||
466 | - vnc_write(vs, vs->tight.jpeg.buffer, vs->tight.jpeg.offset); | ||
467 | - buffer_reset(&vs->tight.jpeg); | ||
468 | + tight_send_compact_size(vs, vs->tight->jpeg.offset); | ||
469 | + vnc_write(vs, vs->tight->jpeg.buffer, vs->tight->jpeg.offset); | ||
470 | + buffer_reset(&vs->tight->jpeg); | ||
471 | |||
472 | return 1; | ||
473 | } | ||
474 | @@ -1240,7 +1241,7 @@ static void write_png_palette(int idx, uint32_t pix, void *opaque) | ||
475 | VncState *vs = priv->vs; | ||
476 | png_colorp color = &priv->png_palette[idx]; | ||
477 | |||
478 | - if (vs->tight.pixel24) | ||
479 | + if (vs->tight->pixel24) | ||
480 | { | ||
481 | color->red = (pix >> vs->client_pf.rshift) & vs->client_pf.rmax; | ||
482 | color->green = (pix >> vs->client_pf.gshift) & vs->client_pf.gmax; | ||
483 | @@ -1267,10 +1268,10 @@ static void png_write_data(png_structp png_ptr, png_bytep data, | ||
484 | { | ||
485 | VncState *vs = png_get_io_ptr(png_ptr); | ||
486 | |||
487 | - buffer_reserve(&vs->tight.png, vs->tight.png.offset + length); | ||
488 | - memcpy(vs->tight.png.buffer + vs->tight.png.offset, data, length); | ||
489 | + buffer_reserve(&vs->tight->png, vs->tight->png.offset + length); | ||
490 | + memcpy(vs->tight->png.buffer + vs->tight->png.offset, data, length); | ||
491 | |||
492 | - vs->tight.png.offset += length; | ||
493 | + vs->tight->png.offset += length; | ||
494 | } | ||
495 | |||
496 | static void png_flush_data(png_structp png_ptr) | ||
497 | @@ -1295,8 +1296,8 @@ static int send_png_rect(VncState *vs, int x, int y, int w, int h, | ||
498 | png_infop info_ptr; | ||
499 | png_colorp png_palette = NULL; | ||
500 | pixman_image_t *linebuf; | ||
501 | - int level = tight_png_conf[vs->tight.compression].png_zlib_level; | ||
502 | - int filters = tight_png_conf[vs->tight.compression].png_filters; | ||
503 | + int level = tight_png_conf[vs->tight->compression].png_zlib_level; | ||
504 | + int filters = tight_png_conf[vs->tight->compression].png_filters; | ||
505 | uint8_t *buf; | ||
506 | int dy; | ||
507 | |||
508 | @@ -1340,21 +1341,23 @@ static int send_png_rect(VncState *vs, int x, int y, int w, int h, | ||
509 | png_set_PLTE(png_ptr, info_ptr, png_palette, palette_size(palette)); | ||
510 | |||
511 | if (vs->client_pf.bytes_per_pixel == 4) { | ||
512 | - tight_encode_indexed_rect32(vs->tight.tight.buffer, w * h, palette); | ||
513 | + tight_encode_indexed_rect32(vs->tight->tight.buffer, w * h, | ||
514 | + palette); | ||
515 | } else { | ||
516 | - tight_encode_indexed_rect16(vs->tight.tight.buffer, w * h, palette); | ||
517 | + tight_encode_indexed_rect16(vs->tight->tight.buffer, w * h, | ||
518 | + palette); | ||
519 | } | ||
520 | } | ||
521 | |||
522 | png_write_info(png_ptr, info_ptr); | ||
523 | |||
524 | - buffer_reserve(&vs->tight.png, 2048); | ||
525 | + buffer_reserve(&vs->tight->png, 2048); | ||
526 | linebuf = qemu_pixman_linebuf_create(PIXMAN_BE_r8g8b8, w); | ||
527 | buf = (uint8_t *)pixman_image_get_data(linebuf); | ||
528 | for (dy = 0; dy < h; dy++) | ||
529 | { | ||
530 | if (color_type == PNG_COLOR_TYPE_PALETTE) { | ||
531 | - memcpy(buf, vs->tight.tight.buffer + (dy * w), w); | ||
532 | + memcpy(buf, vs->tight->tight.buffer + (dy * w), w); | ||
533 | } else { | ||
534 | qemu_pixman_linebuf_fill(linebuf, vs->vd->server, w, x, y + dy); | ||
535 | } | ||
536 | @@ -1372,27 +1375,27 @@ static int send_png_rect(VncState *vs, int x, int y, int w, int h, | ||
537 | |||
538 | vnc_write_u8(vs, VNC_TIGHT_PNG << 4); | ||
539 | |||
540 | - tight_send_compact_size(vs, vs->tight.png.offset); | ||
541 | - vnc_write(vs, vs->tight.png.buffer, vs->tight.png.offset); | ||
542 | - buffer_reset(&vs->tight.png); | ||
543 | + tight_send_compact_size(vs, vs->tight->png.offset); | ||
544 | + vnc_write(vs, vs->tight->png.buffer, vs->tight->png.offset); | ||
545 | + buffer_reset(&vs->tight->png); | ||
546 | return 1; | ||
547 | } | ||
548 | #endif /* CONFIG_VNC_PNG */ | ||
549 | |||
550 | static void vnc_tight_start(VncState *vs) | ||
551 | { | ||
552 | - buffer_reset(&vs->tight.tight); | ||
553 | + buffer_reset(&vs->tight->tight); | ||
554 | |||
555 | // make the output buffer be the zlib buffer, so we can compress it later | ||
556 | - vs->tight.tmp = vs->output; | ||
557 | - vs->output = vs->tight.tight; | ||
558 | + vs->tight->tmp = vs->output; | ||
559 | + vs->output = vs->tight->tight; | ||
560 | } | ||
561 | |||
562 | static void vnc_tight_stop(VncState *vs) | ||
563 | { | ||
564 | // switch back to normal output/zlib buffers | ||
565 | - vs->tight.tight = vs->output; | ||
566 | - vs->output = vs->tight.tmp; | ||
567 | + vs->tight->tight = vs->output; | ||
568 | + vs->output = vs->tight->tmp; | ||
569 | } | ||
570 | |||
571 | static int send_sub_rect_nojpeg(VncState *vs, int x, int y, int w, int h, | ||
572 | @@ -1426,9 +1429,9 @@ static int send_sub_rect_jpeg(VncState *vs, int x, int y, int w, int h, | ||
573 | int ret; | ||
574 | |||
575 | if (colors == 0) { | ||
576 | - if (force || (tight_jpeg_conf[vs->tight.quality].jpeg_full && | ||
577 | + if (force || (tight_jpeg_conf[vs->tight->quality].jpeg_full && | ||
578 | tight_detect_smooth_image(vs, w, h))) { | ||
579 | - int quality = tight_conf[vs->tight.quality].jpeg_quality; | ||
580 | + int quality = tight_conf[vs->tight->quality].jpeg_quality; | ||
581 | |||
582 | ret = send_jpeg_rect(vs, x, y, w, h, quality); | ||
583 | } else { | ||
584 | @@ -1440,9 +1443,9 @@ static int send_sub_rect_jpeg(VncState *vs, int x, int y, int w, int h, | ||
585 | ret = send_mono_rect(vs, x, y, w, h, bg, fg); | ||
586 | } else if (colors <= 256) { | ||
587 | if (force || (colors > 96 && | ||
588 | - tight_jpeg_conf[vs->tight.quality].jpeg_idx && | ||
589 | + tight_jpeg_conf[vs->tight->quality].jpeg_idx && | ||
590 | tight_detect_smooth_image(vs, w, h))) { | ||
591 | - int quality = tight_conf[vs->tight.quality].jpeg_quality; | ||
592 | + int quality = tight_conf[vs->tight->quality].jpeg_quality; | ||
593 | |||
594 | ret = send_jpeg_rect(vs, x, y, w, h, quality); | ||
595 | } else { | ||
596 | @@ -1480,20 +1483,20 @@ static int send_sub_rect(VncState *vs, int x, int y, int w, int h) | ||
597 | qemu_thread_atexit_add(&vnc_tight_cleanup_notifier); | ||
598 | } | ||
599 | |||
600 | - vnc_framebuffer_update(vs, x, y, w, h, vs->tight.type); | ||
601 | + vnc_framebuffer_update(vs, x, y, w, h, vs->tight->type); | ||
602 | |||
603 | vnc_tight_start(vs); | ||
604 | vnc_raw_send_framebuffer_update(vs, x, y, w, h); | ||
605 | vnc_tight_stop(vs); | ||
606 | |||
607 | #ifdef CONFIG_VNC_JPEG | ||
608 | - if (!vs->vd->non_adaptive && vs->tight.quality != (uint8_t)-1) { | ||
609 | + if (!vs->vd->non_adaptive && vs->tight->quality != (uint8_t)-1) { | ||
610 | double freq = vnc_update_freq(vs, x, y, w, h); | ||
611 | |||
612 | - if (freq < tight_jpeg_conf[vs->tight.quality].jpeg_freq_min) { | ||
613 | + if (freq < tight_jpeg_conf[vs->tight->quality].jpeg_freq_min) { | ||
614 | allow_jpeg = false; | ||
615 | } | ||
616 | - if (freq >= tight_jpeg_conf[vs->tight.quality].jpeg_freq_threshold) { | ||
617 | + if (freq >= tight_jpeg_conf[vs->tight->quality].jpeg_freq_threshold) { | ||
618 | force_jpeg = true; | ||
619 | vnc_sent_lossy_rect(vs, x, y, w, h); | ||
620 | } | ||
621 | @@ -1503,7 +1506,7 @@ static int send_sub_rect(VncState *vs, int x, int y, int w, int h) | ||
622 | colors = tight_fill_palette(vs, x, y, w * h, &bg, &fg, color_count_palette); | ||
623 | |||
624 | #ifdef CONFIG_VNC_JPEG | ||
625 | - if (allow_jpeg && vs->tight.quality != (uint8_t)-1) { | ||
626 | + if (allow_jpeg && vs->tight->quality != (uint8_t)-1) { | ||
627 | ret = send_sub_rect_jpeg(vs, x, y, w, h, bg, fg, colors, | ||
628 | color_count_palette, force_jpeg); | ||
629 | } else { | ||
630 | @@ -1520,7 +1523,7 @@ static int send_sub_rect(VncState *vs, int x, int y, int w, int h) | ||
631 | |||
632 | static int send_sub_rect_solid(VncState *vs, int x, int y, int w, int h) | ||
633 | { | ||
634 | - vnc_framebuffer_update(vs, x, y, w, h, vs->tight.type); | ||
635 | + vnc_framebuffer_update(vs, x, y, w, h, vs->tight->type); | ||
636 | |||
637 | vnc_tight_start(vs); | ||
638 | vnc_raw_send_framebuffer_update(vs, x, y, w, h); | ||
639 | @@ -1538,8 +1541,8 @@ static int send_rect_simple(VncState *vs, int x, int y, int w, int h, | ||
640 | int rw, rh; | ||
641 | int n = 0; | ||
642 | |||
643 | - max_size = tight_conf[vs->tight.compression].max_rect_size; | ||
644 | - max_width = tight_conf[vs->tight.compression].max_rect_width; | ||
645 | + max_size = tight_conf[vs->tight->compression].max_rect_size; | ||
646 | + max_width = tight_conf[vs->tight->compression].max_rect_width; | ||
647 | |||
648 | if (split && (w > max_width || w * h > max_size)) { | ||
649 | max_sub_width = (w > max_width) ? max_width : w; | ||
650 | @@ -1648,16 +1651,16 @@ static int tight_send_framebuffer_update(VncState *vs, int x, int y, | ||
651 | |||
652 | if (vs->client_pf.bytes_per_pixel == 4 && vs->client_pf.rmax == 0xFF && | ||
653 | vs->client_pf.bmax == 0xFF && vs->client_pf.gmax == 0xFF) { | ||
654 | - vs->tight.pixel24 = true; | ||
655 | + vs->tight->pixel24 = true; | ||
656 | } else { | ||
657 | - vs->tight.pixel24 = false; | ||
658 | + vs->tight->pixel24 = false; | ||
659 | } | ||
660 | |||
661 | #ifdef CONFIG_VNC_JPEG | ||
662 | - if (vs->tight.quality != (uint8_t)-1) { | ||
663 | + if (vs->tight->quality != (uint8_t)-1) { | ||
664 | double freq = vnc_update_freq(vs, x, y, w, h); | ||
665 | |||
666 | - if (freq > tight_jpeg_conf[vs->tight.quality].jpeg_freq_threshold) { | ||
667 | + if (freq > tight_jpeg_conf[vs->tight->quality].jpeg_freq_threshold) { | ||
668 | return send_rect_simple(vs, x, y, w, h, false); | ||
669 | } | ||
670 | } | ||
671 | @@ -1669,8 +1672,8 @@ static int tight_send_framebuffer_update(VncState *vs, int x, int y, | ||
672 | |||
673 | /* Calculate maximum number of rows in one non-solid rectangle. */ | ||
674 | |||
675 | - max_rows = tight_conf[vs->tight.compression].max_rect_size; | ||
676 | - max_rows /= MIN(tight_conf[vs->tight.compression].max_rect_width, w); | ||
677 | + max_rows = tight_conf[vs->tight->compression].max_rect_size; | ||
678 | + max_rows /= MIN(tight_conf[vs->tight->compression].max_rect_width, w); | ||
679 | |||
680 | return find_large_solid_color_rect(vs, x, y, w, h, max_rows); | ||
681 | } | ||
682 | @@ -1678,33 +1681,33 @@ static int tight_send_framebuffer_update(VncState *vs, int x, int y, | ||
683 | int vnc_tight_send_framebuffer_update(VncState *vs, int x, int y, | ||
684 | int w, int h) | ||
685 | { | ||
686 | - vs->tight.type = VNC_ENCODING_TIGHT; | ||
687 | + vs->tight->type = VNC_ENCODING_TIGHT; | ||
688 | return tight_send_framebuffer_update(vs, x, y, w, h); | ||
689 | } | ||
690 | |||
691 | int vnc_tight_png_send_framebuffer_update(VncState *vs, int x, int y, | ||
692 | int w, int h) | ||
693 | { | ||
694 | - vs->tight.type = VNC_ENCODING_TIGHT_PNG; | ||
695 | + vs->tight->type = VNC_ENCODING_TIGHT_PNG; | ||
696 | return tight_send_framebuffer_update(vs, x, y, w, h); | ||
697 | } | ||
698 | |||
699 | void vnc_tight_clear(VncState *vs) | ||
700 | { | ||
701 | int i; | ||
702 | - for (i=0; i<ARRAY_SIZE(vs->tight.stream); i++) { | ||
703 | - if (vs->tight.stream[i].opaque) { | ||
704 | - deflateEnd(&vs->tight.stream[i]); | ||
705 | + for (i = 0; i < ARRAY_SIZE(vs->tight->stream); i++) { | ||
706 | + if (vs->tight->stream[i].opaque) { | ||
707 | + deflateEnd(&vs->tight->stream[i]); | ||
708 | } | ||
709 | } | ||
710 | |||
711 | - buffer_free(&vs->tight.tight); | ||
712 | - buffer_free(&vs->tight.zlib); | ||
713 | - buffer_free(&vs->tight.gradient); | ||
714 | + buffer_free(&vs->tight->tight); | ||
715 | + buffer_free(&vs->tight->zlib); | ||
716 | + buffer_free(&vs->tight->gradient); | ||
717 | #ifdef CONFIG_VNC_JPEG | ||
718 | - buffer_free(&vs->tight.jpeg); | ||
719 | + buffer_free(&vs->tight->jpeg); | ||
720 | #endif | ||
721 | #ifdef CONFIG_VNC_PNG | ||
722 | - buffer_free(&vs->tight.png); | ||
723 | + buffer_free(&vs->tight->png); | ||
724 | #endif | ||
725 | } | ||
726 | diff --git a/ui/vnc-enc-zlib.c b/ui/vnc-enc-zlib.c | ||
727 | index 33e9df2..900ae5b 100644 | ||
728 | --- a/ui/vnc-enc-zlib.c | ||
729 | +++ b/ui/vnc-enc-zlib.c | ||
730 | @@ -76,7 +76,8 @@ static int vnc_zlib_stop(VncState *vs) | ||
731 | zstream->zalloc = vnc_zlib_zalloc; | ||
732 | zstream->zfree = vnc_zlib_zfree; | ||
733 | |||
734 | - err = deflateInit2(zstream, vs->tight.compression, Z_DEFLATED, MAX_WBITS, | ||
735 | + err = deflateInit2(zstream, vs->tight->compression, Z_DEFLATED, | ||
736 | + MAX_WBITS, | ||
737 | MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY); | ||
738 | |||
739 | if (err != Z_OK) { | ||
740 | @@ -84,16 +85,16 @@ static int vnc_zlib_stop(VncState *vs) | ||
741 | return -1; | ||
742 | } | ||
743 | |||
744 | - vs->zlib.level = vs->tight.compression; | ||
745 | + vs->zlib.level = vs->tight->compression; | ||
746 | zstream->opaque = vs; | ||
747 | } | ||
748 | |||
749 | - if (vs->tight.compression != vs->zlib.level) { | ||
750 | - if (deflateParams(zstream, vs->tight.compression, | ||
751 | + if (vs->tight->compression != vs->zlib.level) { | ||
752 | + if (deflateParams(zstream, vs->tight->compression, | ||
753 | Z_DEFAULT_STRATEGY) != Z_OK) { | ||
754 | return -1; | ||
755 | } | ||
756 | - vs->zlib.level = vs->tight.compression; | ||
757 | + vs->zlib.level = vs->tight->compression; | ||
758 | } | ||
759 | |||
760 | // reserve memory in output buffer | ||
761 | diff --git a/ui/vnc-enc-zrle.c b/ui/vnc-enc-zrle.c | ||
762 | index 7493a84..17fd28a 100644 | ||
763 | --- a/ui/vnc-enc-zrle.c | ||
764 | +++ b/ui/vnc-enc-zrle.c | ||
765 | @@ -37,18 +37,18 @@ static const int bits_per_packed_pixel[] = { | ||
766 | |||
767 | static void vnc_zrle_start(VncState *vs) | ||
768 | { | ||
769 | - buffer_reset(&vs->zrle.zrle); | ||
770 | + buffer_reset(&vs->zrle->zrle); | ||
771 | |||
772 | /* make the output buffer be the zlib buffer, so we can compress it later */ | ||
773 | - vs->zrle.tmp = vs->output; | ||
774 | - vs->output = vs->zrle.zrle; | ||
775 | + vs->zrle->tmp = vs->output; | ||
776 | + vs->output = vs->zrle->zrle; | ||
777 | } | ||
778 | |||
779 | static void vnc_zrle_stop(VncState *vs) | ||
780 | { | ||
781 | /* switch back to normal output/zlib buffers */ | ||
782 | - vs->zrle.zrle = vs->output; | ||
783 | - vs->output = vs->zrle.tmp; | ||
784 | + vs->zrle->zrle = vs->output; | ||
785 | + vs->output = vs->zrle->tmp; | ||
786 | } | ||
787 | |||
788 | static void *zrle_convert_fb(VncState *vs, int x, int y, int w, int h, | ||
789 | @@ -56,24 +56,24 @@ static void *zrle_convert_fb(VncState *vs, int x, int y, int w, int h, | ||
790 | { | ||
791 | Buffer tmp; | ||
792 | |||
793 | - buffer_reset(&vs->zrle.fb); | ||
794 | - buffer_reserve(&vs->zrle.fb, w * h * bpp + bpp); | ||
795 | + buffer_reset(&vs->zrle->fb); | ||
796 | + buffer_reserve(&vs->zrle->fb, w * h * bpp + bpp); | ||
797 | |||
798 | tmp = vs->output; | ||
799 | - vs->output = vs->zrle.fb; | ||
800 | + vs->output = vs->zrle->fb; | ||
801 | |||
802 | vnc_raw_send_framebuffer_update(vs, x, y, w, h); | ||
803 | |||
804 | - vs->zrle.fb = vs->output; | ||
805 | + vs->zrle->fb = vs->output; | ||
806 | vs->output = tmp; | ||
807 | - return vs->zrle.fb.buffer; | ||
808 | + return vs->zrle->fb.buffer; | ||
809 | } | ||
810 | |||
811 | static int zrle_compress_data(VncState *vs, int level) | ||
812 | { | ||
813 | - z_streamp zstream = &vs->zrle.stream; | ||
814 | + z_streamp zstream = &vs->zrle->stream; | ||
815 | |||
816 | - buffer_reset(&vs->zrle.zlib); | ||
817 | + buffer_reset(&vs->zrle->zlib); | ||
818 | |||
819 | if (zstream->opaque != vs) { | ||
820 | int err; | ||
821 | @@ -93,13 +93,13 @@ static int zrle_compress_data(VncState *vs, int level) | ||
822 | } | ||
823 | |||
824 | /* reserve memory in output buffer */ | ||
825 | - buffer_reserve(&vs->zrle.zlib, vs->zrle.zrle.offset + 64); | ||
826 | + buffer_reserve(&vs->zrle->zlib, vs->zrle->zrle.offset + 64); | ||
827 | |||
828 | /* set pointers */ | ||
829 | - zstream->next_in = vs->zrle.zrle.buffer; | ||
830 | - zstream->avail_in = vs->zrle.zrle.offset; | ||
831 | - zstream->next_out = vs->zrle.zlib.buffer + vs->zrle.zlib.offset; | ||
832 | - zstream->avail_out = vs->zrle.zlib.capacity - vs->zrle.zlib.offset; | ||
833 | + zstream->next_in = vs->zrle->zrle.buffer; | ||
834 | + zstream->avail_in = vs->zrle->zrle.offset; | ||
835 | + zstream->next_out = vs->zrle->zlib.buffer + vs->zrle->zlib.offset; | ||
836 | + zstream->avail_out = vs->zrle->zlib.capacity - vs->zrle->zlib.offset; | ||
837 | zstream->data_type = Z_BINARY; | ||
838 | |||
839 | /* start encoding */ | ||
840 | @@ -108,8 +108,8 @@ static int zrle_compress_data(VncState *vs, int level) | ||
841 | return -1; | ||
842 | } | ||
843 | |||
844 | - vs->zrle.zlib.offset = vs->zrle.zlib.capacity - zstream->avail_out; | ||
845 | - return vs->zrle.zlib.offset; | ||
846 | + vs->zrle->zlib.offset = vs->zrle->zlib.capacity - zstream->avail_out; | ||
847 | + return vs->zrle->zlib.offset; | ||
848 | } | ||
849 | |||
850 | /* Try to work out whether to use RLE and/or a palette. We do this by | ||
851 | @@ -259,14 +259,14 @@ static int zrle_send_framebuffer_update(VncState *vs, int x, int y, | ||
852 | size_t bytes; | ||
853 | int zywrle_level; | ||
854 | |||
855 | - if (vs->zrle.type == VNC_ENCODING_ZYWRLE) { | ||
856 | - if (!vs->vd->lossy || vs->tight.quality == (uint8_t)-1 | ||
857 | - || vs->tight.quality == 9) { | ||
858 | + if (vs->zrle->type == VNC_ENCODING_ZYWRLE) { | ||
859 | + if (!vs->vd->lossy || vs->tight->quality == (uint8_t)-1 | ||
860 | + || vs->tight->quality == 9) { | ||
861 | zywrle_level = 0; | ||
862 | - vs->zrle.type = VNC_ENCODING_ZRLE; | ||
863 | - } else if (vs->tight.quality < 3) { | ||
864 | + vs->zrle->type = VNC_ENCODING_ZRLE; | ||
865 | + } else if (vs->tight->quality < 3) { | ||
866 | zywrle_level = 3; | ||
867 | - } else if (vs->tight.quality < 6) { | ||
868 | + } else if (vs->tight->quality < 6) { | ||
869 | zywrle_level = 2; | ||
870 | } else { | ||
871 | zywrle_level = 1; | ||
872 | @@ -337,30 +337,30 @@ static int zrle_send_framebuffer_update(VncState *vs, int x, int y, | ||
873 | |||
874 | vnc_zrle_stop(vs); | ||
875 | bytes = zrle_compress_data(vs, Z_DEFAULT_COMPRESSION); | ||
876 | - vnc_framebuffer_update(vs, x, y, w, h, vs->zrle.type); | ||
877 | + vnc_framebuffer_update(vs, x, y, w, h, vs->zrle->type); | ||
878 | vnc_write_u32(vs, bytes); | ||
879 | - vnc_write(vs, vs->zrle.zlib.buffer, vs->zrle.zlib.offset); | ||
880 | + vnc_write(vs, vs->zrle->zlib.buffer, vs->zrle->zlib.offset); | ||
881 | return 1; | ||
882 | } | ||
883 | |||
884 | int vnc_zrle_send_framebuffer_update(VncState *vs, int x, int y, int w, int h) | ||
885 | { | ||
886 | - vs->zrle.type = VNC_ENCODING_ZRLE; | ||
887 | + vs->zrle->type = VNC_ENCODING_ZRLE; | ||
888 | return zrle_send_framebuffer_update(vs, x, y, w, h); | ||
889 | } | ||
890 | |||
891 | int vnc_zywrle_send_framebuffer_update(VncState *vs, int x, int y, int w, int h) | ||
892 | { | ||
893 | - vs->zrle.type = VNC_ENCODING_ZYWRLE; | ||
894 | + vs->zrle->type = VNC_ENCODING_ZYWRLE; | ||
895 | return zrle_send_framebuffer_update(vs, x, y, w, h); | ||
896 | } | ||
897 | |||
898 | void vnc_zrle_clear(VncState *vs) | ||
899 | { | ||
900 | - if (vs->zrle.stream.opaque) { | ||
901 | - deflateEnd(&vs->zrle.stream); | ||
902 | + if (vs->zrle->stream.opaque) { | ||
903 | + deflateEnd(&vs->zrle->stream); | ||
904 | } | ||
905 | - buffer_free(&vs->zrle.zrle); | ||
906 | - buffer_free(&vs->zrle.fb); | ||
907 | - buffer_free(&vs->zrle.zlib); | ||
908 | + buffer_free(&vs->zrle->zrle); | ||
909 | + buffer_free(&vs->zrle->fb); | ||
910 | + buffer_free(&vs->zrle->zlib); | ||
911 | } | ||
912 | diff --git a/ui/vnc-enc-zrle.inc.c b/ui/vnc-enc-zrle.inc.c | ||
913 | index abf6b86..c107d8a 100644 | ||
914 | --- a/ui/vnc-enc-zrle.inc.c | ||
915 | +++ b/ui/vnc-enc-zrle.inc.c | ||
916 | @@ -96,7 +96,7 @@ static void ZRLE_ENCODE(VncState *vs, int x, int y, int w, int h, | ||
917 | static void ZRLE_ENCODE_TILE(VncState *vs, ZRLE_PIXEL *data, int w, int h, | ||
918 | int zywrle_level) | ||
919 | { | ||
920 | - VncPalette *palette = &vs->zrle.palette; | ||
921 | + VncPalette *palette = &vs->zrle->palette; | ||
922 | |||
923 | int runs = 0; | ||
924 | int single_pixels = 0; | ||
925 | diff --git a/ui/vnc.c b/ui/vnc.c | ||
926 | index bc43c4c..87b8045 100644 | ||
927 | --- a/ui/vnc.c | ||
928 | +++ b/ui/vnc.c | ||
929 | @@ -1307,6 +1307,8 @@ void vnc_disconnect_finish(VncState *vs) | ||
930 | object_unref(OBJECT(vs->sioc)); | ||
931 | vs->sioc = NULL; | ||
932 | vs->magic = 0; | ||
933 | + g_free(vs->zrle); | ||
934 | + g_free(vs->tight); | ||
935 | g_free(vs); | ||
936 | } | ||
937 | |||
938 | @@ -2058,8 +2060,8 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings) | ||
939 | |||
940 | vs->features = 0; | ||
941 | vs->vnc_encoding = 0; | ||
942 | - vs->tight.compression = 9; | ||
943 | - vs->tight.quality = -1; /* Lossless by default */ | ||
944 | + vs->tight->compression = 9; | ||
945 | + vs->tight->quality = -1; /* Lossless by default */ | ||
946 | vs->absolute = -1; | ||
947 | |||
948 | /* | ||
949 | @@ -2127,11 +2129,11 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings) | ||
950 | vs->features |= VNC_FEATURE_LED_STATE_MASK; | ||
951 | break; | ||
952 | case VNC_ENCODING_COMPRESSLEVEL0 ... VNC_ENCODING_COMPRESSLEVEL0 + 9: | ||
953 | - vs->tight.compression = (enc & 0x0F); | ||
954 | + vs->tight->compression = (enc & 0x0F); | ||
955 | break; | ||
956 | case VNC_ENCODING_QUALITYLEVEL0 ... VNC_ENCODING_QUALITYLEVEL0 + 9: | ||
957 | if (vs->vd->lossy) { | ||
958 | - vs->tight.quality = (enc & 0x0F); | ||
959 | + vs->tight->quality = (enc & 0x0F); | ||
960 | } | ||
961 | break; | ||
962 | default: | ||
963 | @@ -3034,6 +3036,8 @@ static void vnc_connect(VncDisplay *vd, QIOChannelSocket *sioc, | ||
964 | int i; | ||
965 | |||
966 | trace_vnc_client_connect(vs, sioc); | ||
967 | + vs->zrle = g_new0(VncZrle, 1); | ||
968 | + vs->tight = g_new0(VncTight, 1); | ||
969 | vs->magic = VNC_MAGIC; | ||
970 | vs->sioc = sioc; | ||
971 | object_ref(OBJECT(vs->sioc)); | ||
972 | @@ -3045,19 +3049,19 @@ static void vnc_connect(VncDisplay *vd, QIOChannelSocket *sioc, | ||
973 | buffer_init(&vs->output, "vnc-output/%p", sioc); | ||
974 | buffer_init(&vs->jobs_buffer, "vnc-jobs_buffer/%p", sioc); | ||
975 | |||
976 | - buffer_init(&vs->tight.tight, "vnc-tight/%p", sioc); | ||
977 | - buffer_init(&vs->tight.zlib, "vnc-tight-zlib/%p", sioc); | ||
978 | - buffer_init(&vs->tight.gradient, "vnc-tight-gradient/%p", sioc); | ||
979 | + buffer_init(&vs->tight->tight, "vnc-tight/%p", sioc); | ||
980 | + buffer_init(&vs->tight->zlib, "vnc-tight-zlib/%p", sioc); | ||
981 | + buffer_init(&vs->tight->gradient, "vnc-tight-gradient/%p", sioc); | ||
982 | #ifdef CONFIG_VNC_JPEG | ||
983 | - buffer_init(&vs->tight.jpeg, "vnc-tight-jpeg/%p", sioc); | ||
984 | + buffer_init(&vs->tight->jpeg, "vnc-tight-jpeg/%p", sioc); | ||
985 | #endif | ||
986 | #ifdef CONFIG_VNC_PNG | ||
987 | - buffer_init(&vs->tight.png, "vnc-tight-png/%p", sioc); | ||
988 | + buffer_init(&vs->tight->png, "vnc-tight-png/%p", sioc); | ||
989 | #endif | ||
990 | buffer_init(&vs->zlib.zlib, "vnc-zlib/%p", sioc); | ||
991 | - buffer_init(&vs->zrle.zrle, "vnc-zrle/%p", sioc); | ||
992 | - buffer_init(&vs->zrle.fb, "vnc-zrle-fb/%p", sioc); | ||
993 | - buffer_init(&vs->zrle.zlib, "vnc-zrle-zlib/%p", sioc); | ||
994 | + buffer_init(&vs->zrle->zrle, "vnc-zrle/%p", sioc); | ||
995 | + buffer_init(&vs->zrle->fb, "vnc-zrle-fb/%p", sioc); | ||
996 | + buffer_init(&vs->zrle->zlib, "vnc-zrle-zlib/%p", sioc); | ||
997 | |||
998 | if (skipauth) { | ||
999 | vs->auth = VNC_AUTH_NONE; | ||
1000 | diff --git a/ui/vnc.h b/ui/vnc.h | ||
1001 | index 8643860..fea79c2 100644 | ||
1002 | --- a/ui/vnc.h | ||
1003 | +++ b/ui/vnc.h | ||
1004 | @@ -338,10 +338,10 @@ struct VncState | ||
1005 | /* Encoding specific, if you add something here, don't forget to | ||
1006 | * update vnc_async_encoding_start() | ||
1007 | */ | ||
1008 | - VncTight tight; | ||
1009 | + VncTight *tight; | ||
1010 | VncZlib zlib; | ||
1011 | VncHextile hextile; | ||
1012 | - VncZrle zrle; | ||
1013 | + VncZrle *zrle; | ||
1014 | VncZywrle zywrle; | ||
1015 | |||
1016 | Notifier mouse_mode_notifier; | ||
1017 | -- | ||
1018 | 1.8.3.1 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-10702.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-10702.patch new file mode 100644 index 0000000000..21a3ceb30d --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-10702.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From de0b1bae6461f67243282555475f88b2384a1eb9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Vincent Dehors <vincent.dehors@smile.fr> | ||
3 | Date: Thu, 23 Jan 2020 15:22:38 +0000 | ||
4 | Subject: [PATCH] target/arm: Fix PAuth sbox functions | ||
5 | |||
6 | In the PAC computation, sbox was applied over wrong bits. | ||
7 | As this is a 4-bit sbox, bit index should be incremented by 4 instead of 16. | ||
8 | |||
9 | Test vector from QARMA paper (https://eprint.iacr.org/2016/444.pdf) was | ||
10 | used to verify one computation of the pauth_computepac() function which | ||
11 | uses sbox2. | ||
12 | |||
13 | Launchpad: https://bugs.launchpad.net/bugs/1859713 | ||
14 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
15 | Signed-off-by: Vincent DEHORS <vincent.dehors@smile.fr> | ||
16 | Signed-off-by: Adrien GRASSEIN <adrien.grassein@smile.fr> | ||
17 | Message-id: 20200116230809.19078-2-richard.henderson@linaro.org | ||
18 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
19 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
20 | |||
21 | Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=patch;h=de0b1bae6461f67243282555475f88b2384a1eb9] | ||
22 | CVE: CVE-2020-10702 | ||
23 | Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> | ||
24 | --- | ||
25 | target/arm/pauth_helper.c | 4 ++-- | ||
26 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
27 | |||
28 | diff --git a/target/arm/pauth_helper.c b/target/arm/pauth_helper.c | ||
29 | index d3194f2..0a5f41e 100644 | ||
30 | --- a/target/arm/pauth_helper.c | ||
31 | +++ b/target/arm/pauth_helper.c | ||
32 | @@ -89,7 +89,7 @@ static uint64_t pac_sub(uint64_t i) | ||
33 | uint64_t o = 0; | ||
34 | int b; | ||
35 | |||
36 | - for (b = 0; b < 64; b += 16) { | ||
37 | + for (b = 0; b < 64; b += 4) { | ||
38 | o |= (uint64_t)sub[(i >> b) & 0xf] << b; | ||
39 | } | ||
40 | return o; | ||
41 | @@ -104,7 +104,7 @@ static uint64_t pac_inv_sub(uint64_t i) | ||
42 | uint64_t o = 0; | ||
43 | int b; | ||
44 | |||
45 | - for (b = 0; b < 64; b += 16) { | ||
46 | + for (b = 0; b < 64; b += 4) { | ||
47 | o |= (uint64_t)inv_sub[(i >> b) & 0xf] << b; | ||
48 | } | ||
49 | return o; | ||
50 | -- | ||
51 | 1.8.3.1 | ||
52 | |||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-10756.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-10756.patch new file mode 100644 index 0000000000..306aef061b --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-10756.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From c7ede54cbd2e2b25385325600958ba0124e31cc0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ralf Haferkamp <rhafer@suse.com> | ||
3 | Date: Fri, 3 Jul 2020 14:51:16 +0200 | ||
4 | Subject: [PATCH] Drop bogus IPv6 messages | ||
5 | |||
6 | Drop IPv6 message shorter than what's mentioned in the payload | ||
7 | length header (+ the size of the IPv6 header). They're invalid an could | ||
8 | lead to data leakage in icmp6_send_echoreply(). | ||
9 | |||
10 | CVE: CVE-2020-10756 | ||
11 | Upstream-Status: Backport | ||
12 | https://gitlab.freedesktop.org/slirp/libslirp/-/commit/c7ede54cbd2e2b25385325600958ba0124e31cc0 | ||
13 | |||
14 | [SG: Based on libslirp commit c7ede54cbd2e2b25385325600958ba0124e31cc0 and adjusted context] | ||
15 | Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com> | ||
16 | --- | ||
17 | slirp/src/ip6_input.c | 7 +++++++ | ||
18 | 1 file changed, 7 insertions(+) | ||
19 | |||
20 | diff --git a/slirp/src/ip6_input.c b/slirp/src/ip6_input.c | ||
21 | index d9d2b7e9..0f2b1785 100644 | ||
22 | --- a/slirp/src/ip6_input.c | ||
23 | +++ b/slirp/src/ip6_input.c | ||
24 | @@ -49,6 +49,13 @@ void ip6_input(struct mbuf *m) | ||
25 | goto bad; | ||
26 | } | ||
27 | |||
28 | + // Check if the message size is big enough to hold what's | ||
29 | + // set in the payload length header. If not this is an invalid | ||
30 | + // packet | ||
31 | + if (m->m_len < ntohs(ip6->ip_pl) + sizeof(struct ip6)) { | ||
32 | + goto bad; | ||
33 | + } | ||
34 | + | ||
35 | /* check ip_ttl for a correct ICMP reply */ | ||
36 | if (ip6->ip_hl == 0) { | ||
37 | icmp6_send_error(m, ICMP6_TIMXCEED, ICMP6_TIMXCEED_INTRANS); | ||
38 | -- | ||
39 | 2.17.1 | ||
40 | |||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-11869.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-11869.patch new file mode 100644 index 0000000000..ca7ffed934 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-11869.patch | |||
@@ -0,0 +1,97 @@ | |||
1 | From ac2071c3791b67fc7af78b8ceb320c01ca1b5df7 Mon Sep 17 00:00:00 2001 | ||
2 | From: BALATON Zoltan <balaton@eik.bme.hu> | ||
3 | Date: Mon, 6 Apr 2020 22:34:26 +0200 | ||
4 | Subject: [PATCH] ati-vga: Fix checks in ati_2d_blt() to avoid crash | ||
5 | |||
6 | In some corner cases (that never happen during normal operation but a | ||
7 | malicious guest could program wrong values) pixman functions were | ||
8 | called with parameters that result in a crash. Fix this and add more | ||
9 | checks to disallow such cases. | ||
10 | |||
11 | Reported-by: Ziming Zhang <ezrakiez@gmail.com> | ||
12 | Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> | ||
13 | Message-id: 20200406204029.19559747D5D@zero.eik.bme.hu | ||
14 | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> | ||
15 | |||
16 | Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commit;h=ac2071c3791b67fc7af78b8ceb320c01ca1b5df7] | ||
17 | CVE: CVE-2020-11869 | ||
18 | Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> | ||
19 | --- | ||
20 | hw/display/ati_2d.c | 37 ++++++++++++++++++++++++++----------- | ||
21 | 1 file changed, 26 insertions(+), 11 deletions(-) | ||
22 | |||
23 | diff --git a/hw/display/ati_2d.c b/hw/display/ati_2d.c | ||
24 | index 42e8231..23a8ae0 100644 | ||
25 | --- a/hw/display/ati_2d.c | ||
26 | +++ b/hw/display/ati_2d.c | ||
27 | @@ -53,12 +53,20 @@ void ati_2d_blt(ATIVGAState *s) | ||
28 | s->vga.vbe_start_addr, surface_data(ds), surface_stride(ds), | ||
29 | surface_bits_per_pixel(ds), | ||
30 | (s->regs.dp_mix & GMC_ROP3_MASK) >> 16); | ||
31 | - int dst_x = (s->regs.dp_cntl & DST_X_LEFT_TO_RIGHT ? | ||
32 | - s->regs.dst_x : s->regs.dst_x + 1 - s->regs.dst_width); | ||
33 | - int dst_y = (s->regs.dp_cntl & DST_Y_TOP_TO_BOTTOM ? | ||
34 | - s->regs.dst_y : s->regs.dst_y + 1 - s->regs.dst_height); | ||
35 | + unsigned dst_x = (s->regs.dp_cntl & DST_X_LEFT_TO_RIGHT ? | ||
36 | + s->regs.dst_x : s->regs.dst_x + 1 - s->regs.dst_width); | ||
37 | + unsigned dst_y = (s->regs.dp_cntl & DST_Y_TOP_TO_BOTTOM ? | ||
38 | + s->regs.dst_y : s->regs.dst_y + 1 - s->regs.dst_height); | ||
39 | int bpp = ati_bpp_from_datatype(s); | ||
40 | + if (!bpp) { | ||
41 | + qemu_log_mask(LOG_GUEST_ERROR, "Invalid bpp\n"); | ||
42 | + return; | ||
43 | + } | ||
44 | int dst_stride = DEFAULT_CNTL ? s->regs.dst_pitch : s->regs.default_pitch; | ||
45 | + if (!dst_stride) { | ||
46 | + qemu_log_mask(LOG_GUEST_ERROR, "Zero dest pitch\n"); | ||
47 | + return; | ||
48 | + } | ||
49 | uint8_t *dst_bits = s->vga.vram_ptr + (DEFAULT_CNTL ? | ||
50 | s->regs.dst_offset : s->regs.default_offset); | ||
51 | |||
52 | @@ -82,12 +90,16 @@ void ati_2d_blt(ATIVGAState *s) | ||
53 | switch (s->regs.dp_mix & GMC_ROP3_MASK) { | ||
54 | case ROP3_SRCCOPY: | ||
55 | { | ||
56 | - int src_x = (s->regs.dp_cntl & DST_X_LEFT_TO_RIGHT ? | ||
57 | - s->regs.src_x : s->regs.src_x + 1 - s->regs.dst_width); | ||
58 | - int src_y = (s->regs.dp_cntl & DST_Y_TOP_TO_BOTTOM ? | ||
59 | - s->regs.src_y : s->regs.src_y + 1 - s->regs.dst_height); | ||
60 | + unsigned src_x = (s->regs.dp_cntl & DST_X_LEFT_TO_RIGHT ? | ||
61 | + s->regs.src_x : s->regs.src_x + 1 - s->regs.dst_width); | ||
62 | + unsigned src_y = (s->regs.dp_cntl & DST_Y_TOP_TO_BOTTOM ? | ||
63 | + s->regs.src_y : s->regs.src_y + 1 - s->regs.dst_height); | ||
64 | int src_stride = DEFAULT_CNTL ? | ||
65 | s->regs.src_pitch : s->regs.default_pitch; | ||
66 | + if (!src_stride) { | ||
67 | + qemu_log_mask(LOG_GUEST_ERROR, "Zero source pitch\n"); | ||
68 | + return; | ||
69 | + } | ||
70 | uint8_t *src_bits = s->vga.vram_ptr + (DEFAULT_CNTL ? | ||
71 | s->regs.src_offset : s->regs.default_offset); | ||
72 | |||
73 | @@ -137,8 +149,10 @@ void ati_2d_blt(ATIVGAState *s) | ||
74 | dst_y * surface_stride(ds), | ||
75 | s->regs.dst_height * surface_stride(ds)); | ||
76 | } | ||
77 | - s->regs.dst_x += s->regs.dst_width; | ||
78 | - s->regs.dst_y += s->regs.dst_height; | ||
79 | + s->regs.dst_x = (s->regs.dp_cntl & DST_X_LEFT_TO_RIGHT ? | ||
80 | + dst_x + s->regs.dst_width : dst_x); | ||
81 | + s->regs.dst_y = (s->regs.dp_cntl & DST_Y_TOP_TO_BOTTOM ? | ||
82 | + dst_y + s->regs.dst_height : dst_y); | ||
83 | break; | ||
84 | } | ||
85 | case ROP3_PATCOPY: | ||
86 | @@ -179,7 +193,8 @@ void ati_2d_blt(ATIVGAState *s) | ||
87 | dst_y * surface_stride(ds), | ||
88 | s->regs.dst_height * surface_stride(ds)); | ||
89 | } | ||
90 | - s->regs.dst_y += s->regs.dst_height; | ||
91 | + s->regs.dst_y = (s->regs.dp_cntl & DST_Y_TOP_TO_BOTTOM ? | ||
92 | + dst_y + s->regs.dst_height : dst_y); | ||
93 | break; | ||
94 | } | ||
95 | default: | ||
96 | -- | ||
97 | 1.8.3.1 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-13765.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-13765.patch new file mode 100644 index 0000000000..9014ba0f13 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-13765.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From e423455c4f23a1a828901c78fe6d03b7dde79319 Mon Sep 17 00:00:00 2001 | ||
2 | From: Thomas Huth <thuth@redhat.com> | ||
3 | Date: Wed, 25 Sep 2019 14:16:43 +0200 | ||
4 | Subject: [PATCH] hw/core/loader: Fix possible crash in rom_copy() | ||
5 | |||
6 | Both, "rom->addr" and "addr" are derived from the binary image | ||
7 | that can be loaded with the "-kernel" paramer. The code in | ||
8 | rom_copy() then calculates: | ||
9 | |||
10 | d = dest + (rom->addr - addr); | ||
11 | |||
12 | and uses "d" as destination in a memcpy() some lines later. Now with | ||
13 | bad kernel images, it is possible that rom->addr is smaller than addr, | ||
14 | thus "rom->addr - addr" gets negative and the memcpy() then tries to | ||
15 | copy contents from the image to a bad memory location. This could | ||
16 | maybe be used to inject code from a kernel image into the QEMU binary, | ||
17 | so we better fix it with an additional sanity check here. | ||
18 | |||
19 | Cc: qemu-stable@nongnu.org | ||
20 | Reported-by: Guangming Liu | ||
21 | Buglink: https://bugs.launchpad.net/qemu/+bug/1844635 | ||
22 | Message-Id: <20190925130331.27825-1-thuth@redhat.com> | ||
23 | Reviewed-by: Michael S. Tsirkin <mst@redhat.com> | ||
24 | Signed-off-by: Thomas Huth <thuth@redhat.com> | ||
25 | |||
26 | Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=patch;h=e423455c4f23a1a828901c78fe6d03b7dde79319] | ||
27 | CVE: CVE-2020-13765 | ||
28 | Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> | ||
29 | --- | ||
30 | hw/core/loader.c | 2 +- | ||
31 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
32 | |||
33 | diff --git a/hw/core/loader.c b/hw/core/loader.c | ||
34 | index 0d60219..5099f27 100644 | ||
35 | --- a/hw/core/loader.c | ||
36 | +++ b/hw/core/loader.c | ||
37 | @@ -1281,7 +1281,7 @@ int rom_copy(uint8_t *dest, hwaddr addr, size_t size) | ||
38 | if (rom->addr + rom->romsize < addr) { | ||
39 | continue; | ||
40 | } | ||
41 | - if (rom->addr > end) { | ||
42 | + if (rom->addr > end || rom->addr < addr) { | ||
43 | break; | ||
44 | } | ||
45 | |||
46 | -- | ||
47 | 1.8.3.1 | ||
48 | |||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-14364.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-14364.patch new file mode 100644 index 0000000000..a109ac08d6 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-14364.patch | |||
@@ -0,0 +1,93 @@ | |||
1 | From b946434f2659a182afc17e155be6791ebfb302eb Mon Sep 17 00:00:00 2001 | ||
2 | From: Gerd Hoffmann <kraxel@redhat.com> | ||
3 | Date: Tue, 25 Aug 2020 07:36:36 +0200 | ||
4 | Subject: [PATCH] usb: fix setup_len init (CVE-2020-14364) | ||
5 | |||
6 | Store calculated setup_len in a local variable, verify it, and only | ||
7 | write it to the struct (USBDevice->setup_len) in case it passed the | ||
8 | sanity checks. | ||
9 | |||
10 | This prevents other code (do_token_{in,out} functions specifically) | ||
11 | from working with invalid USBDevice->setup_len values and overrunning | ||
12 | the USBDevice->setup_buf[] buffer. | ||
13 | |||
14 | Fixes: CVE-2020-14364 | ||
15 | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> | ||
16 | Tested-by: Gonglei <arei.gonglei@huawei.com> | ||
17 | Reviewed-by: Li Qiang <liq3ea@gmail.com> | ||
18 | Message-id: 20200825053636.29648-1-kraxel@redhat.com | ||
19 | |||
20 | Upstream-Status: Backport | ||
21 | CVE: CVE-2020-14364 | ||
22 | [https://git.qemu.org/?p=qemu.git;a=patch;h=b946434f2659a182afc17e155be6791ebfb302eb] | ||
23 | Signed-off-by: Li Wang <li.wang@windriver.com> | ||
24 | --- | ||
25 | hw/usb/core.c | 16 ++++++++++------ | ||
26 | 1 file changed, 10 insertions(+), 6 deletions(-) | ||
27 | |||
28 | diff --git a/hw/usb/core.c b/hw/usb/core.c | ||
29 | index 5abd128..5234dcc 100644 | ||
30 | --- a/hw/usb/core.c | ||
31 | +++ b/hw/usb/core.c | ||
32 | @@ -129,6 +129,7 @@ void usb_wakeup(USBEndpoint *ep, unsigned int stream) | ||
33 | static void do_token_setup(USBDevice *s, USBPacket *p) | ||
34 | { | ||
35 | int request, value, index; | ||
36 | + unsigned int setup_len; | ||
37 | |||
38 | if (p->iov.size != 8) { | ||
39 | p->status = USB_RET_STALL; | ||
40 | @@ -138,14 +139,15 @@ static void do_token_setup(USBDevice *s, USBPacket *p) | ||
41 | usb_packet_copy(p, s->setup_buf, p->iov.size); | ||
42 | s->setup_index = 0; | ||
43 | p->actual_length = 0; | ||
44 | - s->setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6]; | ||
45 | - if (s->setup_len > sizeof(s->data_buf)) { | ||
46 | + setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6]; | ||
47 | + if (setup_len > sizeof(s->data_buf)) { | ||
48 | fprintf(stderr, | ||
49 | "usb_generic_handle_packet: ctrl buffer too small (%d > %zu)\n", | ||
50 | - s->setup_len, sizeof(s->data_buf)); | ||
51 | + setup_len, sizeof(s->data_buf)); | ||
52 | p->status = USB_RET_STALL; | ||
53 | return; | ||
54 | } | ||
55 | + s->setup_len = setup_len; | ||
56 | |||
57 | request = (s->setup_buf[0] << 8) | s->setup_buf[1]; | ||
58 | value = (s->setup_buf[3] << 8) | s->setup_buf[2]; | ||
59 | @@ -259,26 +261,28 @@ static void do_token_out(USBDevice *s, USBPacket *p) | ||
60 | static void do_parameter(USBDevice *s, USBPacket *p) | ||
61 | { | ||
62 | int i, request, value, index; | ||
63 | + unsigned int setup_len; | ||
64 | |||
65 | for (i = 0; i < 8; i++) { | ||
66 | s->setup_buf[i] = p->parameter >> (i*8); | ||
67 | } | ||
68 | |||
69 | s->setup_state = SETUP_STATE_PARAM; | ||
70 | - s->setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6]; | ||
71 | s->setup_index = 0; | ||
72 | |||
73 | request = (s->setup_buf[0] << 8) | s->setup_buf[1]; | ||
74 | value = (s->setup_buf[3] << 8) | s->setup_buf[2]; | ||
75 | index = (s->setup_buf[5] << 8) | s->setup_buf[4]; | ||
76 | |||
77 | - if (s->setup_len > sizeof(s->data_buf)) { | ||
78 | + setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6]; | ||
79 | + if (setup_len > sizeof(s->data_buf)) { | ||
80 | fprintf(stderr, | ||
81 | "usb_generic_handle_packet: ctrl buffer too small (%d > %zu)\n", | ||
82 | - s->setup_len, sizeof(s->data_buf)); | ||
83 | + setup_len, sizeof(s->data_buf)); | ||
84 | p->status = USB_RET_STALL; | ||
85 | return; | ||
86 | } | ||
87 | + s->setup_len = setup_len; | ||
88 | |||
89 | if (p->pid == USB_TOKEN_OUT) { | ||
90 | usb_packet_copy(p, s->data_buf, s->setup_len); | ||
91 | -- | ||
92 | 2.17.1 | ||
93 | |||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-15863.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-15863.patch new file mode 100644 index 0000000000..9927584d11 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-15863.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | From 5519724a13664b43e225ca05351c60b4468e4555 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mauro Matteo Cascella <mcascell@redhat.com> | ||
3 | Date: Fri, 10 Jul 2020 11:19:41 +0200 | ||
4 | Subject: [PATCH] hw/net/xgmac: Fix buffer overflow in xgmac_enet_send() | ||
5 | |||
6 | A buffer overflow issue was reported by Mr. Ziming Zhang, CC'd here. It | ||
7 | occurs while sending an Ethernet frame due to missing break statements | ||
8 | and improper checking of the buffer size. | ||
9 | |||
10 | Reported-by: Ziming Zhang <ezrakiez@gmail.com> | ||
11 | Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com> | ||
12 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | Signed-off-by: Jason Wang <jasowang@redhat.com> | ||
14 | |||
15 | CVE: CVE-2020-15863 | ||
16 | Upstream-Status: Backport | ||
17 | [https://git.qemu.org/?p=qemu.git;a=commit;h=5519724a13664b43e225ca05351c60b4468e4555] | ||
18 | Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> | ||
19 | Signed-off-by: Li Wang <li.wang@windriver.com> | ||
20 | --- | ||
21 | hw/net/xgmac.c | 14 ++++++++++++-- | ||
22 | 1 file changed, 12 insertions(+), 2 deletions(-) | ||
23 | |||
24 | diff --git a/hw/net/xgmac.c b/hw/net/xgmac.c | ||
25 | index f49df95..f496f7e 100644 | ||
26 | --- a/hw/net/xgmac.c | ||
27 | +++ b/hw/net/xgmac.c | ||
28 | @@ -217,21 +217,31 @@ static void xgmac_enet_send(XgmacState *s) | ||
29 | } | ||
30 | len = (bd.buffer1_size & 0xfff) + (bd.buffer2_size & 0xfff); | ||
31 | |||
32 | + /* | ||
33 | + * FIXME: these cases of malformed tx descriptors (bad sizes) | ||
34 | + * should probably be reported back to the guest somehow | ||
35 | + * rather than simply silently stopping processing, but we | ||
36 | + * don't know what the hardware does in this situation. | ||
37 | + * This will only happen for buggy guests anyway. | ||
38 | + */ | ||
39 | if ((bd.buffer1_size & 0xfff) > 2048) { | ||
40 | DEBUGF_BRK("qemu:%s:ERROR...ERROR...ERROR... -- " | ||
41 | "xgmac buffer 1 len on send > 2048 (0x%x)\n", | ||
42 | __func__, bd.buffer1_size & 0xfff); | ||
43 | + break; | ||
44 | } | ||
45 | if ((bd.buffer2_size & 0xfff) != 0) { | ||
46 | DEBUGF_BRK("qemu:%s:ERROR...ERROR...ERROR... -- " | ||
47 | "xgmac buffer 2 len on send != 0 (0x%x)\n", | ||
48 | __func__, bd.buffer2_size & 0xfff); | ||
49 | + break; | ||
50 | } | ||
51 | - if (len >= sizeof(frame)) { | ||
52 | + if (frame_size + len >= sizeof(frame)) { | ||
53 | DEBUGF_BRK("qemu:%s: buffer overflow %d read into %zu " | ||
54 | - "buffer\n" , __func__, len, sizeof(frame)); | ||
55 | + "buffer\n" , __func__, frame_size + len, sizeof(frame)); | ||
56 | DEBUGF_BRK("qemu:%s: buffer1.size=%d; buffer2.size=%d\n", | ||
57 | __func__, bd.buffer1_size, bd.buffer2_size); | ||
58 | + break; | ||
59 | } | ||
60 | |||
61 | cpu_physical_memory_read(bd.buffer1_addr, ptr, len); | ||
62 | -- | ||
63 | 1.9.1 | ||
64 | |||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-16092.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-16092.patch new file mode 100644 index 0000000000..8ce01e26ad --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-16092.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From 035e69b063835a5fd23cacabd63690a3d84532a8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mauro Matteo Cascella <mcascell@redhat.com> | ||
3 | Date: Sat, 1 Aug 2020 18:42:38 +0200 | ||
4 | Subject: [PATCH] hw/net/net_tx_pkt: fix assertion failure in | ||
5 | net_tx_pkt_add_raw_fragment() | ||
6 | |||
7 | An assertion failure issue was found in the code that processes network | ||
8 | packets | ||
9 | while adding data fragments into the packet context. It could be abused | ||
10 | by a | ||
11 | malicious guest to abort the QEMU process on the host. This patch | ||
12 | replaces the | ||
13 | affected assert() with a conditional statement, returning false if the | ||
14 | current | ||
15 | data fragment exceeds max_raw_frags. | ||
16 | |||
17 | Reported-by: Alexander Bulekov <alxndr@bu.edu> | ||
18 | Reported-by: Ziming Zhang <ezrakiez@gmail.com> | ||
19 | Reviewed-by: Dmitry Fleytman <dmitry.fleytman@gmail.com> | ||
20 | Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com> | ||
21 | Signed-off-by: Jason Wang <jasowang@redhat.com> | ||
22 | |||
23 | Upstream-Status: Backport | ||
24 | CVE: CVE-2020-16092 | ||
25 | [https://git.qemu.org/?p=qemu.git;a=commit;h=035e69b063835a5fd23cacabd63690a3d84532a8] | ||
26 | Signed-off-by: Li Wang <li.wang@windriver.com> | ||
27 | --- | ||
28 | hw/net/net_tx_pkt.c | 5 ++++- | ||
29 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
30 | |||
31 | diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c | ||
32 | index 162f802..54d4c3b 100644 | ||
33 | --- a/hw/net/net_tx_pkt.c | ||
34 | +++ b/hw/net/net_tx_pkt.c | ||
35 | @@ -379,7 +379,10 @@ bool net_tx_pkt_add_raw_fragment(struct NetTxPkt *pkt, hwaddr pa, | ||
36 | hwaddr mapped_len = 0; | ||
37 | struct iovec *ventry; | ||
38 | assert(pkt); | ||
39 | - assert(pkt->max_raw_frags > pkt->raw_frags); | ||
40 | + | ||
41 | + if (pkt->raw_frags >= pkt->max_raw_frags) { | ||
42 | + return false; | ||
43 | + } | ||
44 | |||
45 | if (!len) { | ||
46 | return true; | ||
47 | -- | ||
48 | 2.17.1 | ||
49 | |||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-1711.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-1711.patch new file mode 100644 index 0000000000..aa7bc82329 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-1711.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | From 693fd2acdf14dd86c0bf852610f1c2cca80a74dc Mon Sep 17 00:00:00 2001 | ||
2 | From: Felipe Franciosi <felipe@nutanix.com> | ||
3 | Date: Thu, 23 Jan 2020 12:44:59 +0000 | ||
4 | Subject: [PATCH] iscsi: Cap block count from GET LBA STATUS (CVE-2020-1711) | ||
5 | |||
6 | When querying an iSCSI server for the provisioning status of blocks (via | ||
7 | GET LBA STATUS), Qemu only validates that the response descriptor zero's | ||
8 | LBA matches the one requested. Given the SCSI spec allows servers to | ||
9 | respond with the status of blocks beyond the end of the LUN, Qemu may | ||
10 | have its heap corrupted by clearing/setting too many bits at the end of | ||
11 | its allocmap for the LUN. | ||
12 | |||
13 | A malicious guest in control of the iSCSI server could carefully program | ||
14 | Qemu's heap (by selectively setting the bitmap) and then smash it. | ||
15 | |||
16 | This limits the number of bits that iscsi_co_block_status() will try to | ||
17 | update in the allocmap so it can't overflow the bitmap. | ||
18 | |||
19 | Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=patch;h=693fd2acdf14dd86c0bf852610f1c2cca80a74dc] | ||
20 | CVE: CVE-2020-1711 | ||
21 | |||
22 | Fixes: CVE-2020-1711 | ||
23 | Cc: qemu-stable@nongnu.org | ||
24 | Signed-off-by: Felipe Franciosi <felipe@nutanix.com> | ||
25 | Signed-off-by: Peter Turschmid <peter.turschm@nutanix.com> | ||
26 | Signed-off-by: Raphael Norwitz <raphael.norwitz@nutanix.com> | ||
27 | Signed-off-by: Kevin Wolf <kwolf@redhat.com> | ||
28 | Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> | ||
29 | --- | ||
30 | block/iscsi.c | 5 +++-- | ||
31 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
32 | |||
33 | diff --git a/block/iscsi.c b/block/iscsi.c | ||
34 | index 2aea7e3..cbd5729 100644 | ||
35 | --- a/block/iscsi.c | ||
36 | +++ b/block/iscsi.c | ||
37 | @@ -701,7 +701,7 @@ static int coroutine_fn iscsi_co_block_status(BlockDriverState *bs, | ||
38 | struct scsi_get_lba_status *lbas = NULL; | ||
39 | struct scsi_lba_status_descriptor *lbasd = NULL; | ||
40 | struct IscsiTask iTask; | ||
41 | - uint64_t lba; | ||
42 | + uint64_t lba, max_bytes; | ||
43 | int ret; | ||
44 | |||
45 | iscsi_co_init_iscsitask(iscsilun, &iTask); | ||
46 | @@ -721,6 +721,7 @@ static int coroutine_fn iscsi_co_block_status(BlockDriverState *bs, | ||
47 | } | ||
48 | |||
49 | lba = offset / iscsilun->block_size; | ||
50 | + max_bytes = (iscsilun->num_blocks - lba) * iscsilun->block_size; | ||
51 | |||
52 | qemu_mutex_lock(&iscsilun->mutex); | ||
53 | retry: | ||
54 | @@ -764,7 +765,7 @@ retry: | ||
55 | goto out_unlock; | ||
56 | } | ||
57 | |||
58 | - *pnum = (int64_t) lbasd->num_blocks * iscsilun->block_size; | ||
59 | + *pnum = MIN((int64_t) lbasd->num_blocks * iscsilun->block_size, max_bytes); | ||
60 | |||
61 | if (lbasd->provisioning == SCSI_PROVISIONING_TYPE_DEALLOCATED || | ||
62 | lbasd->provisioning == SCSI_PROVISIONING_TYPE_ANCHORED) { | ||
63 | -- | ||
64 | 1.8.3.1 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-7039-1.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-7039-1.patch new file mode 100644 index 0000000000..df6bca6db6 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-7039-1.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From b2663d527a1992ba98c0266458b21ada3b9d0d2e Mon Sep 17 00:00:00 2001 | ||
2 | From: Changqing Li <changqing.li@windriver.com> | ||
3 | Date: Thu, 27 Feb 2020 12:07:35 +0800 | ||
4 | Subject: [PATCH] tcp_emu: Fix oob access | ||
5 | |||
6 | The main loop only checks for one available byte, while we sometimes | ||
7 | need two bytes. | ||
8 | |||
9 | CVE: CVE-2020-7039 | ||
10 | Upstream-Status: Backport | ||
11 | [https://gitlab.freedesktop.org/slirp/libslirp/commit/2655fffed7a9e765bcb4701dd876e9dab975f289] | ||
12 | |||
13 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
14 | --- | ||
15 | slirp/src/tcp_subr.c | 6 ++++++ | ||
16 | 1 file changed, 6 insertions(+) | ||
17 | |||
18 | diff --git a/slirp/src/tcp_subr.c b/slirp/src/tcp_subr.c | ||
19 | index d6dd133..4bea2d4 100644 | ||
20 | --- a/slirp/src/tcp_subr.c | ||
21 | +++ b/slirp/src/tcp_subr.c | ||
22 | @@ -886,6 +886,8 @@ int tcp_emu(struct socket *so, struct mbuf *m) | ||
23 | break; | ||
24 | |||
25 | case 5: | ||
26 | + if (bptr == m->m_data + m->m_len - 1) | ||
27 | + return 1; /* We need two bytes */ | ||
28 | /* | ||
29 | * The difference between versions 1.0 and | ||
30 | * 2.0 is here. For future versions of | ||
31 | @@ -901,6 +903,10 @@ int tcp_emu(struct socket *so, struct mbuf *m) | ||
32 | /* This is the field containing the port | ||
33 | * number that RA-player is listening to. | ||
34 | */ | ||
35 | + | ||
36 | + if (bptr == m->m_data + m->m_len - 1) | ||
37 | + return 1; /* We need two bytes */ | ||
38 | + | ||
39 | lport = (((uint8_t *)bptr)[0] << 8) + ((uint8_t *)bptr)[1]; | ||
40 | if (lport < 6970) | ||
41 | lport += 256; /* don't know why */ | ||
42 | -- | ||
43 | 2.7.4 | ||
44 | |||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-7039-2.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-7039-2.patch new file mode 100644 index 0000000000..4a00fa2afd --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-7039-2.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | From 8f67e76e4148e37f3d8d2bcbdee7417fdedb7669 Mon Sep 17 00:00:00 2001 | ||
2 | From: Changqing Li <changqing.li@windriver.com> | ||
3 | Date: Thu, 27 Feb 2020 12:10:34 +0800 | ||
4 | Subject: [PATCH] slirp: use correct size while emulating commands | ||
5 | |||
6 | While emulating services in tcp_emu(), it uses 'mbuf' size | ||
7 | 'm->m_size' to write commands via snprintf(3). Use M_FREEROOM(m) | ||
8 | size to avoid possible OOB access. | ||
9 | Signed-off-by: default avatarPrasad J Pandit <pjp@fedoraproject.org> | ||
10 | Signed-off-by: Samuel Thibault's avatarSamuel Thibault | ||
11 | <samuel.thibault@ens-lyon.org> | ||
12 | Message-Id: <20200109094228.79764-3-ppandit@redhat.com> | ||
13 | |||
14 | CVE: CVE-2020-7039 | ||
15 | Upstream-Status: Backport | ||
16 | [https://gitlab.freedesktop.org/slirp/libslirp/commit/82ebe9c370a0e2970fb5695aa19aa5214a6a1c80] | ||
17 | |||
18 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
19 | --- | ||
20 | slirp/src/tcp_subr.c | 9 ++++----- | ||
21 | 1 file changed, 4 insertions(+), 5 deletions(-) | ||
22 | |||
23 | diff --git a/slirp/src/tcp_subr.c b/slirp/src/tcp_subr.c | ||
24 | index 4bea2d4..e8ed4ef 100644 | ||
25 | --- a/slirp/src/tcp_subr.c | ||
26 | +++ b/slirp/src/tcp_subr.c | ||
27 | @@ -696,7 +696,7 @@ int tcp_emu(struct socket *so, struct mbuf *m) | ||
28 | n4 = (laddr & 0xff); | ||
29 | |||
30 | m->m_len = bptr - m->m_data; /* Adjust length */ | ||
31 | - m->m_len += snprintf(bptr, m->m_size - m->m_len, | ||
32 | + m->m_len += snprintf(bptr, M_FREEROOM(m), | ||
33 | "ORT %d,%d,%d,%d,%d,%d\r\n%s", n1, n2, n3, n4, | ||
34 | n5, n6, x == 7 ? buff : ""); | ||
35 | return 1; | ||
36 | @@ -731,8 +731,7 @@ int tcp_emu(struct socket *so, struct mbuf *m) | ||
37 | n4 = (laddr & 0xff); | ||
38 | |||
39 | m->m_len = bptr - m->m_data; /* Adjust length */ | ||
40 | - m->m_len += | ||
41 | - snprintf(bptr, m->m_size - m->m_len, | ||
42 | + m->m_len += snprintf(bptr, M_FREEROOM(m), | ||
43 | "27 Entering Passive Mode (%d,%d,%d,%d,%d,%d)\r\n%s", | ||
44 | n1, n2, n3, n4, n5, n6, x == 7 ? buff : ""); | ||
45 | |||
46 | @@ -758,8 +757,8 @@ int tcp_emu(struct socket *so, struct mbuf *m) | ||
47 | if (m->m_data[m->m_len - 1] == '\0' && lport != 0 && | ||
48 | (so = tcp_listen(slirp, INADDR_ANY, 0, so->so_laddr.s_addr, | ||
49 | htons(lport), SS_FACCEPTONCE)) != NULL) | ||
50 | - m->m_len = | ||
51 | - snprintf(m->m_data, m->m_size, "%d", ntohs(so->so_fport)) + 1; | ||
52 | + m->m_len = snprintf(m->m_data, M_ROOM(m), | ||
53 | + "%d", ntohs(so->so_fport)) + 1; | ||
54 | return 1; | ||
55 | |||
56 | case EMU_IRC: | ||
57 | -- | ||
58 | 2.7.4 | ||
59 | |||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-7039-3.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-7039-3.patch new file mode 100644 index 0000000000..70ce480d80 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-7039-3.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | From 0b03959b72036afce151783720d9e54988cf76ef Mon Sep 17 00:00:00 2001 | ||
2 | From: Changqing Li <changqing.li@windriver.com> | ||
3 | Date: Thu, 27 Feb 2020 12:15:04 +0800 | ||
4 | Subject: [PATCH] slirp: use correct size while emulating IRC commands | ||
5 | |||
6 | While emulating IRC DCC commands, tcp_emu() uses 'mbuf' size | ||
7 | 'm->m_size' to write DCC commands via snprintf(3). This may | ||
8 | lead to OOB write access, because 'bptr' points somewhere in | ||
9 | the middle of 'mbuf' buffer, not at the start. Use M_FREEROOM(m) | ||
10 | size to avoid OOB access. | ||
11 | Reported-by: default avatarVishnu Dev TJ <vishnudevtj@gmail.com> | ||
12 | Signed-off-by: default avatarPrasad J Pandit <pjp@fedoraproject.org> | ||
13 | Reviewed-by: Samuel Thibault's avatarSamuel Thibault | ||
14 | <samuel.thibault@ens-lyon.org> | ||
15 | Message-Id: <20200109094228.79764-2-ppandit@redhat.com> | ||
16 | |||
17 | CVE: CVE-2020-7039 | ||
18 | Upstream-Status: Backport | ||
19 | [https://gitlab.freedesktop.org/slirp/libslirp/commit/ce131029d6d4a405cb7d3ac6716d03e58fb4a5d9] | ||
20 | |||
21 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
22 | --- | ||
23 | slirp/src/tcp_subr.c | 11 ++++++----- | ||
24 | 1 file changed, 6 insertions(+), 5 deletions(-) | ||
25 | |||
26 | diff --git a/slirp/src/tcp_subr.c b/slirp/src/tcp_subr.c | ||
27 | index e8ed4ef..3a4a8ee 100644 | ||
28 | --- a/slirp/src/tcp_subr.c | ||
29 | +++ b/slirp/src/tcp_subr.c | ||
30 | @@ -777,7 +777,8 @@ int tcp_emu(struct socket *so, struct mbuf *m) | ||
31 | return 1; | ||
32 | } | ||
33 | m->m_len = bptr - m->m_data; /* Adjust length */ | ||
34 | - m->m_len += snprintf(bptr, m->m_size, "DCC CHAT chat %lu %u%c\n", | ||
35 | + m->m_len += snprintf(bptr, M_FREEROOM(m), | ||
36 | + "DCC CHAT chat %lu %u%c\n", | ||
37 | (unsigned long)ntohl(so->so_faddr.s_addr), | ||
38 | ntohs(so->so_fport), 1); | ||
39 | } else if (sscanf(bptr, "DCC SEND %256s %u %u %u", buff, &laddr, &lport, | ||
40 | @@ -787,8 +788,8 @@ int tcp_emu(struct socket *so, struct mbuf *m) | ||
41 | return 1; | ||
42 | } | ||
43 | m->m_len = bptr - m->m_data; /* Adjust length */ | ||
44 | - m->m_len += | ||
45 | - snprintf(bptr, m->m_size, "DCC SEND %s %lu %u %u%c\n", buff, | ||
46 | + m->m_len += snprintf(bptr, M_FREEROOM(m), | ||
47 | + "DCC SEND %s %lu %u %u%c\n", buff, | ||
48 | (unsigned long)ntohl(so->so_faddr.s_addr), | ||
49 | ntohs(so->so_fport), n1, 1); | ||
50 | } else if (sscanf(bptr, "DCC MOVE %256s %u %u %u", buff, &laddr, &lport, | ||
51 | @@ -798,8 +799,8 @@ int tcp_emu(struct socket *so, struct mbuf *m) | ||
52 | return 1; | ||
53 | } | ||
54 | m->m_len = bptr - m->m_data; /* Adjust length */ | ||
55 | - m->m_len += | ||
56 | - snprintf(bptr, m->m_size, "DCC MOVE %s %lu %u %u%c\n", buff, | ||
57 | + m->m_len += snprintf(bptr, M_FREEROOM(m), | ||
58 | + "DCC MOVE %s %lu %u %u%c\n", buff, | ||
59 | (unsigned long)ntohl(so->so_faddr.s_addr), | ||
60 | ntohs(so->so_fport), n1, 1); | ||
61 | } | ||
62 | -- | ||
63 | 2.7.4 | ||
64 | |||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-7211.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-7211.patch new file mode 100644 index 0000000000..11be4c92e7 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-7211.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From 14ec36e107a8c9af7d0a80c3571fe39b291ff1d4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Prasad J Pandit <pjp@fedoraproject.org> | ||
3 | Date: Mon, 13 Jan 2020 17:44:31 +0530 | ||
4 | Subject: [PATCH] slirp: tftp: restrict relative path access | ||
5 | |||
6 | tftp restricts relative or directory path access on Linux systems. | ||
7 | Apply same restrictions on Windows systems too. It helps to avoid | ||
8 | directory traversal issue. | ||
9 | |||
10 | Fixes: https://bugs.launchpad.net/qemu/+bug/1812451 | ||
11 | Reported-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> | ||
13 | Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> | ||
14 | Message-Id: <20200113121431.156708-1-ppandit@redhat.com> | ||
15 | |||
16 | Upstream-Status: Backport [https://gitlab.freedesktop.org/slirp/libslirp/-/commit/14ec36e107a8c9af7d0a80c3571fe39b291ff1d4.patch] | ||
17 | CVE: CVE-2020-7211 | ||
18 | Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> | ||
19 | |||
20 | --- | ||
21 | slirp/src/tftp.c | 9 +++++++-- | ||
22 | 1 file changed, 7 insertions(+), 2 deletions(-) | ||
23 | |||
24 | diff --git a/slirp/src/tftp.c b/slirp/src/tftp.c | ||
25 | index 093c2e0..e52e71b 100644 | ||
26 | --- a/slirp/src/tftp.c | ||
27 | +++ b/slirp/src/tftp.c | ||
28 | @@ -344,8 +344,13 @@ static void tftp_handle_rrq(Slirp *slirp, struct sockaddr_storage *srcsas, | ||
29 | k += 6; /* skipping octet */ | ||
30 | |||
31 | /* do sanity checks on the filename */ | ||
32 | - if (!strncmp(req_fname, "../", 3) || | ||
33 | - req_fname[strlen(req_fname) - 1] == '/' || strstr(req_fname, "/../")) { | ||
34 | + if ( | ||
35 | +#ifdef G_OS_WIN32 | ||
36 | + strstr(req_fname, "..\\") || | ||
37 | + req_fname[strlen(req_fname) - 1] == '\\' || | ||
38 | +#endif | ||
39 | + strstr(req_fname, "../") || | ||
40 | + req_fname[strlen(req_fname) - 1] == '/') { | ||
41 | tftp_send_error(spt, 2, "Access violation", tp); | ||
42 | return; | ||
43 | } | ||
44 | -- | ||
45 | 2.24.1 | ||
46 | |||
diff --git a/meta/recipes-devtools/ruby/ruby/fix-CVE-2019-16254.patch b/meta/recipes-devtools/ruby/ruby/fix-CVE-2019-16254.patch new file mode 100644 index 0000000000..704c850c50 --- /dev/null +++ b/meta/recipes-devtools/ruby/ruby/fix-CVE-2019-16254.patch | |||
@@ -0,0 +1,106 @@ | |||
1 | From 18d5289b4579822e391b3f5c16541e6552e9f06c Mon Sep 17 00:00:00 2001 | ||
2 | From: Yusuke Endoh <mame@ruby-lang.org> | ||
3 | Date: Tue, 1 Oct 2019 12:29:18 +0900 | ||
4 | Subject: [PATCH] WEBrick: prevent response splitting and header injection | ||
5 | |||
6 | This is a follow up to d9d4a28f1cdd05a0e8dabb36d747d40bbcc30f16. | ||
7 | The commit prevented CRLR, but did not address an isolated CR or an | ||
8 | isolated LF. | ||
9 | |||
10 | Upstream-Status: Backport https://github.com/ruby/ruby/commit/3ce238b5f9795581eb84114dcfbdf4aa086bfecc | ||
11 | CVE: CVE-2019-16254 | ||
12 | |||
13 | Co-Authored-By: NARUSE, Yui <naruse@airemix.jp> | ||
14 | Signed-off-by: Rahul Chauhan <rahulchauhankitps@gmail.com> | ||
15 | --- | ||
16 | lib/webrick/httpresponse.rb | 3 ++- | ||
17 | test/webrick/test_httpresponse.rb | 46 +++++++++++++++++++++++++++++++++++++-- | ||
18 | 2 files changed, 46 insertions(+), 3 deletions(-) | ||
19 | |||
20 | diff --git a/lib/webrick/httpresponse.rb b/lib/webrick/httpresponse.rb | ||
21 | index 6d77692..d26324c 100644 | ||
22 | --- a/lib/webrick/httpresponse.rb | ||
23 | +++ b/lib/webrick/httpresponse.rb | ||
24 | @@ -367,7 +367,8 @@ def set_error(ex, backtrace=false) | ||
25 | private | ||
26 | |||
27 | def check_header(header_value) | ||
28 | - if header_value =~ /\r\n/ | ||
29 | + header_value = header_value.to_s | ||
30 | + if /[\r\n]/ =~ header_value | ||
31 | raise InvalidHeader | ||
32 | else | ||
33 | header_value | ||
34 | diff --git a/test/webrick/test_httpresponse.rb b/test/webrick/test_httpresponse.rb | ||
35 | index 6263e0a..24a6968 100644 | ||
36 | --- a/test/webrick/test_httpresponse.rb | ||
37 | +++ b/test/webrick/test_httpresponse.rb | ||
38 | @@ -29,7 +29,7 @@ def setup | ||
39 | @res.keep_alive = true | ||
40 | end | ||
41 | |||
42 | - def test_prevent_response_splitting_headers | ||
43 | + def test_prevent_response_splitting_headers_crlf | ||
44 | res['X-header'] = "malicious\r\nCookie: hack" | ||
45 | io = StringIO.new | ||
46 | res.send_response io | ||
47 | @@ -39,7 +39,7 @@ def test_prevent_response_splitting_headers | ||
48 | refute_match 'hack', io.string | ||
49 | end | ||
50 | |||
51 | - def test_prevent_response_splitting_cookie_headers | ||
52 | + def test_prevent_response_splitting_cookie_headers_crlf | ||
53 | user_input = "malicious\r\nCookie: hack" | ||
54 | res.cookies << WEBrick::Cookie.new('author', user_input) | ||
55 | io = StringIO.new | ||
56 | @@ -50,6 +50,48 @@ def test_prevent_response_splitting_cookie_headers | ||
57 | refute_match 'hack', io.string | ||
58 | end | ||
59 | |||
60 | + def test_prevent_response_splitting_headers_cr | ||
61 | + res['X-header'] = "malicious\rCookie: hack" | ||
62 | + io = StringIO.new | ||
63 | + res.send_response io | ||
64 | + io.rewind | ||
65 | + res = Net::HTTPResponse.read_new(Net::BufferedIO.new(io)) | ||
66 | + assert_equal '500', res.code | ||
67 | + refute_match 'hack', io.string | ||
68 | + end | ||
69 | + | ||
70 | + def test_prevent_response_splitting_cookie_headers_cr | ||
71 | + user_input = "malicious\rCookie: hack" | ||
72 | + res.cookies << WEBrick::Cookie.new('author', user_input) | ||
73 | + io = StringIO.new | ||
74 | + res.send_response io | ||
75 | + io.rewind | ||
76 | + res = Net::HTTPResponse.read_new(Net::BufferedIO.new(io)) | ||
77 | + assert_equal '500', res.code | ||
78 | + refute_match 'hack', io.string | ||
79 | + end | ||
80 | + | ||
81 | + def test_prevent_response_splitting_headers_lf | ||
82 | + res['X-header'] = "malicious\nCookie: hack" | ||
83 | + io = StringIO.new | ||
84 | + res.send_response io | ||
85 | + io.rewind | ||
86 | + res = Net::HTTPResponse.read_new(Net::BufferedIO.new(io)) | ||
87 | + assert_equal '500', res.code | ||
88 | + refute_match 'hack', io.string | ||
89 | + end | ||
90 | + | ||
91 | + def test_prevent_response_splitting_cookie_headers_lf | ||
92 | + user_input = "malicious\nCookie: hack" | ||
93 | + res.cookies << WEBrick::Cookie.new('author', user_input) | ||
94 | + io = StringIO.new | ||
95 | + res.send_response io | ||
96 | + io.rewind | ||
97 | + res = Net::HTTPResponse.read_new(Net::BufferedIO.new(io)) | ||
98 | + assert_equal '500', res.code | ||
99 | + refute_match 'hack', io.string | ||
100 | + end | ||
101 | + | ||
102 | def test_304_does_not_log_warning | ||
103 | res.status = 304 | ||
104 | res.setup_header | ||
105 | -- | ||
106 | 2.7.4 | ||
diff --git a/meta/recipes-devtools/ruby/ruby_2.5.5.bb b/meta/recipes-devtools/ruby/ruby_2.5.5.bb index 223b0371eb..58bb97f4bd 100644 --- a/meta/recipes-devtools/ruby/ruby_2.5.5.bb +++ b/meta/recipes-devtools/ruby/ruby_2.5.5.bb | |||
@@ -3,6 +3,7 @@ require ruby.inc | |||
3 | SRC_URI += " \ | 3 | SRC_URI += " \ |
4 | file://0001-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch \ | 4 | file://0001-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch \ |
5 | file://run-ptest \ | 5 | file://run-ptest \ |
6 | file://fix-CVE-2019-16254.patch \ | ||
6 | " | 7 | " |
7 | 8 | ||
8 | SRC_URI[md5sum] = "7e156fb526b8f4bb1b30a3dd8a7ce400" | 9 | SRC_URI[md5sum] = "7e156fb526b8f4bb1b30a3dd8a7ce400" |
diff --git a/meta/recipes-devtools/strace/strace/Makefile-ptest.patch b/meta/recipes-devtools/strace/strace/Makefile-ptest.patch index 08fa5c53b8..36e93a2dcf 100644 --- a/meta/recipes-devtools/strace/strace/Makefile-ptest.patch +++ b/meta/recipes-devtools/strace/strace/Makefile-ptest.patch | |||
@@ -44,6 +44,6 @@ index 825c989..4623c48 100644 | |||
44 | + done | 44 | + done |
45 | + for file in $(EXTRA_DIST); do \ | 45 | + for file in $(EXTRA_DIST); do \ |
46 | + install $(srcdir)/$$file $(DESTDIR)/$(TESTDIR); \ | 46 | + install $(srcdir)/$$file $(DESTDIR)/$(TESTDIR); \ |
47 | + sed -i -e 's/$${srcdir=.}/./g' $(DESTDIR)/$(TESTDIR)/$$file; \ | 47 | + #sed -i -e 's/$${srcdir=.}/./g' $(DESTDIR)/$(TESTDIR)/$$file; \ |
48 | + done | 48 | + done |
49 | + for i in net scm_rights-fd rt_sigaction; do sed -i -e 's/$$srcdir/./g' $(DESTDIR)/$(TESTDIR)/$$i.test; done | 49 | + for i in net scm_rights-fd rt_sigaction; do sed -i -e 's/$$srcdir/./g' $(DESTDIR)/$(TESTDIR)/$$i.test; done |
diff --git a/meta/recipes-devtools/strace/strace/run-ptest b/meta/recipes-devtools/strace/strace/run-ptest index 2fed984e90..4660207220 100755 --- a/meta/recipes-devtools/strace/strace/run-ptest +++ b/meta/recipes-devtools/strace/strace/run-ptest | |||
@@ -1,3 +1,6 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | export TIMEOUT_DURATION=30 | 2 | export TIMEOUT_DURATION=120 |
3 | make -B -C tests -k test-suite.log | 3 | chown nobody tests |
4 | chown nobody tests/* | ||
5 | chown nobody ../ptest | ||
6 | su nobody -c "make -B -C tests -k test-suite.log" | ||