diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-11-04 00:19:32 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-11-04 00:19:32 +0300 |
commit | 901ced0812b458fdc599fe40b0a4233d422d6df9 (patch) | |
tree | b0918e0606da0b1925b5fc9aba5e065e0a5a2f0e /meta-phosphor/recipes-core | |
parent | ffe6d597d9e3d4407cf8062b5d6505a80ce08f41 (diff) | |
parent | 459d47e59bfb3f80542f17c7eb54ba1f6c1a44f3 (diff) | |
download | openbmc-901ced0812b458fdc599fe40b0a4233d422d6df9.tar.xz |
Merge tag '0.77' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into update
Diffstat (limited to 'meta-phosphor/recipes-core')
6 files changed, 180 insertions, 6 deletions
diff --git a/meta-phosphor/recipes-core/busybox/busybox_%.bbappend b/meta-phosphor/recipes-core/busybox/busybox_%.bbappend index a64c1443a..f8800b45a 100644 --- a/meta-phosphor/recipes-core/busybox/busybox_%.bbappend +++ b/meta-phosphor/recipes-core/busybox/busybox_%.bbappend @@ -1,6 +1,9 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -SRC_URI += "file://busybox.cfg" -SRC_URI += "file://flash.cfg" -SRC_URI += "file://less.cfg" -SRC_URI += "file://mountpoint.cfg" -SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'obmc-ubi-fs', '', 'file://reboot.cfg', d)}" +SRC_URI += " \ + file://busybox.cfg \ + file://flash.cfg \ + file://less.cfg \ + file://mountpoint.cfg \ + ${@bb.utils.contains('DISTRO_FEATURES', 'obmc-ubi-fs', \ + '', 'file://reboot.cfg', d)} \ +" diff --git a/meta-phosphor/recipes-core/dropbear/dropbear_%.bbappend b/meta-phosphor/recipes-core/dropbear/dropbear_%.bbappend index 731f2013d..5113c66bb 100644 --- a/meta-phosphor/recipes-core/dropbear/dropbear_%.bbappend +++ b/meta-phosphor/recipes-core/dropbear/dropbear_%.bbappend @@ -6,3 +6,7 @@ SRC_URI += "file://dropbearkey.service \ file://localoptions.h \ file://dropbear.default \ " + +# pull in OpenSSH's /usr/libexec/sftp-server so we don't have to rely +# on the crufty old scp protocol for file transfer +RDEPENDS:${PN} += "openssh-sftp-server" diff --git a/meta-phosphor/recipes-core/os-release/os-release.bbappend b/meta-phosphor/recipes-core/os-release/os-release.bbappend index de9a02f27..7e90ab3fb 100644 --- a/meta-phosphor/recipes-core/os-release/os-release.bbappend +++ b/meta-phosphor/recipes-core/os-release/os-release.bbappend @@ -5,9 +5,11 @@ # and pasting into another recipe ensure it is understood # what that means! +OS_RELEASE_ROOTPATH ?= "${COREBASE}" + def run_git(d, cmd): try: - oeroot = d.getVar('COREBASE', True) + oeroot = d.getVar('OS_RELEASE_ROOTPATH', True) return bb.process.run(("export PSEUDO_DISABLED=1; " + "git --work-tree %s --git-dir %s/.git %s") % (oeroot, oeroot, cmd))[0].strip('\n') diff --git a/meta-phosphor/recipes-core/systemd/systemd/0001-journal-network-timesync-fix-segfault-on-32bit-timev.patch b/meta-phosphor/recipes-core/systemd/systemd/0001-journal-network-timesync-fix-segfault-on-32bit-timev.patch new file mode 100644 index 000000000..c3af62e15 --- /dev/null +++ b/meta-phosphor/recipes-core/systemd/systemd/0001-journal-network-timesync-fix-segfault-on-32bit-timev.patch @@ -0,0 +1,66 @@ +From 83676e4278cecb44316e6ae88e1365e6fcfdd4ff Mon Sep 17 00:00:00 2001 +From: Yu Watanabe <watanabe.yu+github@gmail.com> +Date: Wed, 15 Sep 2021 23:29:11 +0900 +Subject: [PATCH] journal,network,timesync: fix segfault on 32bit + timeval/timespec systems + +Fixes #20741. +--- + src/journal/journald-server.c | 7 +++++-- + src/libsystemd-network/icmp6-util.c | 3 ++- + src/timesync/timesyncd-manager.c | 3 ++- + 3 files changed, 9 insertions(+), 4 deletions(-) + +diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c +index abd52f7c14..2d1d9e66d7 100644 +--- a/src/journal/journald-server.c ++++ b/src/journal/journald-server.c +@@ -1275,11 +1275,14 @@ int server_process_datagram( + /* We use NAME_MAX space for the SELinux label here. The kernel currently enforces no limit, but + * according to suggestions from the SELinux people this will change and it will probably be + * identical to NAME_MAX. For now we use that, but this should be updated one day when the final +- * limit is known. */ ++ * limit is known. ++ * ++ * Here, we need to explicitly initialize the buffer with zero, as glibc has a bug in ++ * __convert_scm_timestamps(), which assumes the buffer is initialized. See #20741. */ + CMSG_BUFFER_TYPE(CMSG_SPACE(sizeof(struct ucred)) + + CMSG_SPACE_TIMEVAL + + CMSG_SPACE(sizeof(int)) + /* fd */ +- CMSG_SPACE(NAME_MAX) /* selinux label */) control; ++ CMSG_SPACE(NAME_MAX) /* selinux label */) control = {}; + + union sockaddr_union sa = {}; + +diff --git a/src/libsystemd-network/icmp6-util.c b/src/libsystemd-network/icmp6-util.c +index 823be0f275..3832bbd920 100644 +--- a/src/libsystemd-network/icmp6-util.c ++++ b/src/libsystemd-network/icmp6-util.c +@@ -148,8 +148,9 @@ int icmp6_send_router_solicitation(int s, const struct ether_addr *ether_addr) { + int icmp6_receive(int fd, void *buffer, size_t size, struct in6_addr *ret_dst, + triple_timestamp *ret_timestamp) { + ++ /* This needs to be initialized with zero. See #20741. */ + CMSG_BUFFER_TYPE(CMSG_SPACE(sizeof(int)) + /* ttl */ +- CMSG_SPACE_TIMEVAL) control; ++ CMSG_SPACE_TIMEVAL) control = {}; + struct iovec iov = {}; + union sockaddr_union sa = {}; + struct msghdr msg = { +diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c +index 648e804105..e37db1c570 100644 +--- a/src/timesync/timesyncd-manager.c ++++ b/src/timesync/timesyncd-manager.c +@@ -412,7 +412,8 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re + .iov_base = &ntpmsg, + .iov_len = sizeof(ntpmsg), + }; +- CMSG_BUFFER_TYPE(CMSG_SPACE_TIMESPEC) control; ++ /* This needs to be initialized with zero. See #20741. */ ++ CMSG_BUFFER_TYPE(CMSG_SPACE_TIMESPEC) control = {}; + union sockaddr_union server_addr; + struct msghdr msghdr = { + .msg_iov = &iov, +-- +2.33.0.309.g3052b89438-goog + diff --git a/meta-phosphor/recipes-core/systemd/systemd/0001-socket-util-introduce-CMSG_SPACE_TIMEVAL-TIMESPEC-ma.patch b/meta-phosphor/recipes-core/systemd/systemd/0001-socket-util-introduce-CMSG_SPACE_TIMEVAL-TIMESPEC-ma.patch new file mode 100644 index 000000000..3e376ed3a --- /dev/null +++ b/meta-phosphor/recipes-core/systemd/systemd/0001-socket-util-introduce-CMSG_SPACE_TIMEVAL-TIMESPEC-ma.patch @@ -0,0 +1,89 @@ +diff --git a/src/basic/socket-util.h b/src/basic/socket-util.h +index f92e425fd6..09e606614c 100644 +--- a/src/basic/socket-util.h ++++ b/src/basic/socket-util.h +@@ -277,6 +277,28 @@ static inline int getsockopt_int(int fd, int level, int optname, int *ret) { + int socket_bind_to_ifname(int fd, const char *ifname); + int socket_bind_to_ifindex(int fd, int ifindex); + ++/* Define a 64bit version of timeval/timespec in any case, even on 32bit userspace. */ ++struct timeval_large { ++ uint64_t tvl_sec, tvl_usec; ++}; ++struct timespec_large { ++ uint64_t tvl_sec, tvl_nsec; ++}; ++ ++/* glibc duplicates timespec/timeval on certain 32bit archs, once in 32bit and once in 64bit. ++ * See __convert_scm_timestamps() in glibc source code. Hence, we need additional buffer space for them ++ * to prevent from recvmsg_safe() returning -EXFULL. */ ++#define CMSG_SPACE_TIMEVAL \ ++ ((sizeof(struct timeval) == sizeof(struct timeval_large)) ? \ ++ CMSG_SPACE(sizeof(struct timeval)) : \ ++ CMSG_SPACE(sizeof(struct timeval)) + \ ++ CMSG_SPACE(sizeof(struct timeval_large))) ++#define CMSG_SPACE_TIMESPEC \ ++ ((sizeof(struct timespec) == sizeof(struct timespec_large)) ? \ ++ CMSG_SPACE(sizeof(struct timespec)) : \ ++ CMSG_SPACE(sizeof(struct timespec)) + \ ++ CMSG_SPACE(sizeof(struct timespec_large))) ++ + ssize_t recvmsg_safe(int sockfd, struct msghdr *msg, int flags); + + int socket_get_family(int fd, int *ret); +diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c +index a0695ec519..abd52f7c14 100644 +--- a/src/journal/journald-server.c ++++ b/src/journal/journald-server.c +@@ -1277,7 +1277,7 @@ int server_process_datagram( + * identical to NAME_MAX. For now we use that, but this should be updated one day when the final + * limit is known. */ + CMSG_BUFFER_TYPE(CMSG_SPACE(sizeof(struct ucred)) + +- CMSG_SPACE(sizeof(struct timeval)) + ++ CMSG_SPACE_TIMEVAL + + CMSG_SPACE(sizeof(int)) + /* fd */ + CMSG_SPACE(NAME_MAX) /* selinux label */) control; + +diff --git a/src/libsystemd-network/icmp6-util.c b/src/libsystemd-network/icmp6-util.c +index 67c6b55d84..823be0f275 100644 +--- a/src/libsystemd-network/icmp6-util.c ++++ b/src/libsystemd-network/icmp6-util.c +@@ -149,7 +149,7 @@ int icmp6_receive(int fd, void *buffer, size_t size, struct in6_addr *ret_dst, + triple_timestamp *ret_timestamp) { + + CMSG_BUFFER_TYPE(CMSG_SPACE(sizeof(int)) + /* ttl */ +- CMSG_SPACE(sizeof(struct timeval))) control; ++ CMSG_SPACE_TIMEVAL) control; + struct iovec iov = {}; + union sockaddr_union sa = {}; + struct msghdr msg = { +@@ -186,7 +186,6 @@ int icmp6_receive(int fd, void *buffer, size_t size, struct in6_addr *ret_dst, + + /* namelen == 0 only happens when running the test-suite over a socketpair */ + +- assert(!(msg.msg_flags & MSG_CTRUNC)); + assert(!(msg.msg_flags & MSG_TRUNC)); + + CMSG_FOREACH(cmsg, &msg) { +diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c +index 9d874cfc8a..648e804105 100644 +--- a/src/timesync/timesyncd-manager.c ++++ b/src/timesync/timesyncd-manager.c +@@ -412,7 +412,7 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re + .iov_base = &ntpmsg, + .iov_len = sizeof(ntpmsg), + }; +- CMSG_BUFFER_TYPE(CMSG_SPACE(sizeof(struct timespec))) control; ++ CMSG_BUFFER_TYPE(CMSG_SPACE_TIMESPEC) control; + union sockaddr_union server_addr; + struct msghdr msghdr = { + .msg_iov = &iov, +@@ -467,6 +467,8 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re + + switch (cmsg->cmsg_type) { + case SCM_TIMESTAMPNS: ++ assert(cmsg->cmsg_len == CMSG_LEN(sizeof(struct timespec))); ++ + recv_time = (struct timespec *) CMSG_DATA(cmsg); + break; + } diff --git a/meta-phosphor/recipes-core/systemd/systemd_249.3.bbappend b/meta-phosphor/recipes-core/systemd/systemd_249.3.bbappend new file mode 100644 index 000000000..1a58ca139 --- /dev/null +++ b/meta-phosphor/recipes-core/systemd/systemd_249.3.bbappend @@ -0,0 +1,10 @@ +# Backport a fix that is only in main, otherwise all received RAs will fail +# to be parsed. +SRC_URI += "file://0001-socket-util-introduce-CMSG_SPACE_TIMEVAL-TIMESPEC-ma.patch" + +# Pin to v249.4 to fix systemd-networkd segfaults. +SRCREV = "4d8fd88b9641fce81272f60f556543f713175403" + +# Additional unsubmitted PR #20752 required to fix additional systemd-networkd +# segfaults. +SRC_URI += "file://0001-journal-network-timesync-fix-segfault-on-32bit-timev.patch" |