diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2019-12-13 09:51:16 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-12-13 09:51:16 +0000 |
commit | 5d6567e1da25bec0b85d3de14893618c885d9889 (patch) | |
tree | a6fd2b01b5650119b9d01b49de03b1bc98c2300a /community/ceph/musl-fixes.patch | |
parent | 8da2624dad504d761040aee449a97941b1c4930c (diff) | |
download | aports-5d6567e1da25bec0b85d3de14893618c885d9889.tar.bz2 aports-5d6567e1da25bec0b85d3de14893618c885d9889.tar.xz |
community/{qemu*,ceph}: move to community
move qemu and ceph to community. Thi sis to reduce maintenenance
workload for security fixes. Upstream qemu appears to have less support
time than 2 years.
Diffstat (limited to 'community/ceph/musl-fixes.patch')
-rw-r--r-- | community/ceph/musl-fixes.patch | 229 |
1 files changed, 229 insertions, 0 deletions
diff --git a/community/ceph/musl-fixes.patch b/community/ceph/musl-fixes.patch new file mode 100644 index 0000000000..6e50e6ba5b --- /dev/null +++ b/community/ceph/musl-fixes.patch @@ -0,0 +1,229 @@ +diff --git a/src/common/secret.c b/src/common/secret.c +index b6f26ec3..1b4531f8 100644 +--- a/src/common/secret.c ++++ b/src/common/secret.c +@@ -63,9 +63,18 @@ int set_kernel_secret(const char *secret, const char *key_name) + + ret = ceph_unarmor(payload, payload+sizeof(payload), secret, secret+secret_len); + if (ret < 0) { +- char error_buf[80]; +- fprintf(stderr, "secret is not valid base64: %s.\n", +- strerror_r(-ret, error_buf, sizeof(error_buf))); ++ char error_buf[80] = "unkown error"; ++ char *p; ++#if defined(__GLIBC__) ++ p = strerror_r(-ret, error_buf, sizeof(error_buf)); ++#else ++ if (strerror_r(-ret, error_buf, sizeof(error_buf)) < 0) { ++ p = "unkown error"; ++ } else { ++ p = error_buf; ++ } ++#endif ++ fprintf(stderr, "secret is not valid base64: %s.\n", p); + return ret; + } + +diff --git a/src/dmclock/src/dmclock_util.cc b/src/dmclock/src/dmclock_util.cc +index e8046cdc..aa9000bc 100644 +--- a/src/dmclock/src/dmclock_util.cc ++++ b/src/dmclock/src/dmclock_util.cc +@@ -21,7 +21,7 @@ + #include "dmclock_util.h" + + +-std::string crimson::dmclock::format_time(const Time& time, uint modulo) { ++std::string crimson::dmclock::format_time(const Time& time, unsigned int modulo) { + long subtract = long(time / modulo) * modulo; + std::stringstream ss; + ss << std::fixed << std::setprecision(4) << (time - subtract); +diff --git a/src/dmclock/src/dmclock_util.h b/src/dmclock/src/dmclock_util.h +index d3fd3f19..ee8b6c3a 100644 +--- a/src/dmclock/src/dmclock_util.h ++++ b/src/dmclock/src/dmclock_util.h +@@ -52,7 +52,7 @@ namespace crimson { + #endif + } + +- std::string format_time(const Time& time, uint modulo = 1000); ++ std::string format_time(const Time& time, unsigned int modulo = 1000); + + void debugger(); + +diff --git a/src/seastar/dpdk/config/common_base b/src/seastar/dpdk/config/common_base +index 8907bea3..6d3f7577 100644 +--- a/src/seastar/dpdk/config/common_base ++++ b/src/seastar/dpdk/config/common_base +@@ -96,7 +96,7 @@ CONFIG_RTE_MAX_TAILQ=32 + CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO + CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_INFO + CONFIG_RTE_LOG_HISTORY=256 +-CONFIG_RTE_BACKTRACE=y ++CONFIG_RTE_BACKTRACE=n + CONFIG_RTE_LIBEAL_USE_HPET=n + CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n + CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n +diff --git a/src/spdk/dpdk/config/common_base b/src/spdk/dpdk/config/common_base +index d5fbb3a4..d9561545 100644 +--- a/src/spdk/dpdk/config/common_base ++++ b/src/spdk/dpdk/config/common_base +@@ -80,7 +80,7 @@ CONFIG_RTE_MAX_TAILQ=32 + CONFIG_RTE_ENABLE_ASSERT=n + CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_INFO + CONFIG_RTE_LOG_HISTORY=256 +-CONFIG_RTE_BACKTRACE=y ++CONFIG_RTE_BACKTRACE=n + CONFIG_RTE_LIBEAL_USE_HPET=n + CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n + CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n +diff --git a/src/spdk/dpdk/config/rte_config.h b/src/spdk/dpdk/config/rte_config.h +index a8e47977..7599bd39 100644 +--- a/src/spdk/dpdk/config/rte_config.h ++++ b/src/spdk/dpdk/config/rte_config.h +@@ -30,7 +30,7 @@ + #define RTE_MAX_MEMZONE 2560 + #define RTE_MAX_TAILQ 32 + #define RTE_LOG_DP_LEVEL RTE_LOG_INFO +-#define RTE_BACKTRACE 1 ++//#define RTE_BACKTRACE 1 + #define RTE_EAL_VFIO 1 + #define RTE_MAX_VFIO_CONTAINERS 64 + +diff --git a/src/spdk/dpdk/drivers/bus/pci/linux/pci_uio.c b/src/spdk/dpdk/drivers/bus/pci/linux/pci_uio.c +index a7c14421..aff241e8 100644 +--- a/src/spdk/dpdk/drivers/bus/pci/linux/pci_uio.c ++++ b/src/spdk/dpdk/drivers/bus/pci/linux/pci_uio.c +@@ -14,6 +14,32 @@ + + #if defined(RTE_ARCH_X86) + #include <sys/io.h> ++#if defined(__GLIBC__) ++#define pci_uio_outl_p outl_p ++#define pci_uio_outw_p outw_p ++#define pci_uio_outb_p outb_p ++#else ++static inline void ++pci_uio_outl_p(unsigned int value, unsigned short int port) ++{ ++ __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80" : : "a" (value), ++ "Nd" (port)); ++} ++ ++static inline void ++pci_uio_outw_p(unsigned short int value, unsigned short int port) ++{ ++ __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80" : : "a" (value), ++ "Nd" (port)); ++} ++ ++static inline void ++pci_uio_outb_p(unsigned char value, unsigned short int port) ++{ ++ __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80" : : "a" (value), ++ "Nd" (port)); ++} ++#endif + #endif + + #include <rte_log.h> +@@ -527,21 +553,21 @@ pci_uio_ioport_write(struct rte_pci_ioport *p, + if (len >= 4) { + size = 4; + #if defined(RTE_ARCH_X86) +- outl_p(*(const uint32_t *)s, reg); ++ pci_uio_outl_p(*(const uint32_t *)s, reg); + #else + *(volatile uint32_t *)reg = *(const uint32_t *)s; + #endif + } else if (len >= 2) { + size = 2; + #if defined(RTE_ARCH_X86) +- outw_p(*(const uint16_t *)s, reg); ++ pci_uio_outw_p(*(const uint16_t *)s, reg); + #else + *(volatile uint16_t *)reg = *(const uint16_t *)s; + #endif + } else { + size = 1; + #if defined(RTE_ARCH_X86) +- outb_p(*s, reg); ++ pci_uio_outb_p(*s, reg); + #else + *(volatile uint8_t *)reg = *s; + #endif +diff --git a/src/spdk/dpdk/lib/librte_eal/common/eal_common_fbarray.c b/src/spdk/dpdk/lib/librte_eal/common/eal_common_fbarray.c +index ba6c4ae3..b9b7d70d 100644 +--- a/src/spdk/dpdk/lib/librte_eal/common/eal_common_fbarray.c ++++ b/src/spdk/dpdk/lib/librte_eal/common/eal_common_fbarray.c +@@ -9,6 +9,7 @@ + #include <errno.h> + #include <sys/file.h> + #include <string.h> ++#include <fcntl.h> + + #include <rte_common.h> + #include <rte_log.h> +diff --git a/src/spdk/dpdk/lib/librte_eal/common/malloc_heap.c b/src/spdk/dpdk/lib/librte_eal/common/malloc_heap.c +index 02a5385d..cf063d5f 100644 +--- a/src/spdk/dpdk/lib/librte_eal/common/malloc_heap.c ++++ b/src/spdk/dpdk/lib/librte_eal/common/malloc_heap.c +@@ -1,6 +1,7 @@ + /* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2010-2014 Intel Corporation + */ ++ #include<string.h> + #include <stdint.h> + #include <stddef.h> + #include <stdlib.h> +diff --git a/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c b/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c +index 3a7d4b22..99b25d3c 100644 +--- a/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c ++++ b/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c +@@ -17,6 +17,7 @@ + #include <sys/mman.h> + #include <sys/queue.h> + #include <sys/stat.h> ++#include <fcntl.h> + + #include <linux/mman.h> /* for hugetlb-related flags */ + +diff --git a/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_memory.c b/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_memory.c +index 0bf2aef3..0c98c74c 100644 +--- a/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_memory.c ++++ b/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_memory.c +@@ -15,6 +15,7 @@ + #include <sys/mman.h> + #include <sys/types.h> + #include <sys/stat.h> ++#include <fcntl.h> + #include <sys/queue.h> + #include <sys/file.h> + #include <unistd.h> +diff --git a/src/spdk/dpdk/mk/target/generic/rte.vars.mk b/src/spdk/dpdk/mk/target/generic/rte.vars.mk +index 98085cd3..dd149acc 100644 +--- a/src/spdk/dpdk/mk/target/generic/rte.vars.mk ++++ b/src/spdk/dpdk/mk/target/generic/rte.vars.mk +@@ -108,6 +108,9 @@ CFLAGS += -include $(RTE_SDK_BIN)/include/rte_config.h + LDFLAGS += -L$(RTE_SDK_BIN)/lib + endif + ++# always define _GNU_SOURCE ++CFLAGS += -D_GNU_SOURCE ++ + export CFLAGS + export LDFLAGS + +diff --git a/src/tools/rbd_nbd/rbd-nbd.cc b/src/tools/rbd_nbd/rbd-nbd.cc +index cce44e4f..b0988e64 100644 +--- a/src/tools/rbd_nbd/rbd-nbd.cc ++++ b/src/tools/rbd_nbd/rbd-nbd.cc +@@ -552,7 +552,8 @@ private: + for (unsigned i = 0; i < cmdline.size(); i++) { + const char *arg = &cmdline[i]; + if (i == 0) { +- if (strcmp(basename(arg) , "rbd-nbd") != 0) { ++ const char *fname = strrchr(arg, '/'); ++ if (strcmp(fname ? fname+1 : arg, "rbd-nbd") != 0) { + return -EINVAL; + } + } else { |