Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/xen/
Date: Mon, 01 Feb 2021 19:24:07
Message-Id: 1612207440.6c702504991cc4983082e78b83d6ec3eff1c9c1a.whissi@gentoo
1 commit: 6c702504991cc4983082e78b83d6ec3eff1c9c1a
2 Author: Tomáš Mózes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Wed Jan 27 11:10:57 2021 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 1 19:24:00 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c702504
7
8 app-emulation/xen: add security patches
9
10 Fixes XSA-360
11
12 Signed-off-by: Tomáš Mózes <hydrapolic <AT> gmail.com>
13 Closes: https://github.com/gentoo/gentoo/pull/19128
14 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
15
16 app-emulation/xen/Manifest | 1 +
17 app-emulation/xen/xen-4.13.2-r4.ebuild | 165 +++++++++++++++++++++++++++++++++
18 2 files changed, 166 insertions(+)
19
20 diff --git a/app-emulation/xen/Manifest b/app-emulation/xen/Manifest
21 index 0706230d176..12ad42c89e0 100644
22 --- a/app-emulation/xen/Manifest
23 +++ b/app-emulation/xen/Manifest
24 @@ -1,5 +1,6 @@
25 DIST xen-4.13.2-upstream-patches-1.tar.xz 15832 BLAKE2B 4e20a1e2d575ed7e1d21f3b34ed0d8bf6e1405cb39cc5c6ffc099614ea833ac9794bfcfcdea0893fdf81b318f536017ac3a023ad096bc8a8c7390c01f1d513ed SHA512 48dda9dadec1e87fb7b6952636e73057f6e0a5501f9727d05ac636fd47747194501db709c8ffa7154e79b6b612a98b658a03bc083c5065ff851ac57f454b599e
26 DIST xen-4.13.2-upstream-patches-2.tar.xz 58992 BLAKE2B 535d67ae6a30e23feb975172a9e4abd6d7feb6c8c969aa243fdf672ed6580fe46bf57ea5530eab70457e22af9163f95061fdf97d10faa3be9f4c92033187c950 SHA512 6b6cdf72d13c0e595be65e3107c0f68299e932b74d4a1c4d59bfe3be8b76840c47f6adeaddd0efac71d5158cee8d778a0be863eea8f032cb9acf4191f629d8ae
27 +DIST xen-4.13.2-upstream-patches-3.tar.xz 63660 BLAKE2B 80abc9529ff49e782b64d4b5032f724e7d95fd255c2a06b7065c693d5765e1db1df44ebd5ce00c5a1e1ff24e1e5d344b0c2e459c68282e58fa20963e208272d2 SHA512 35288a1feac1316c33586dad55685e2c6a30100795e31852f78455003ce3dd6906074bea023655ee545a97fe4a0a8ad9a05ab91fd83186e61e5b57d10aa6b155
28 DIST xen-4.13.2.tar.gz 39037826 BLAKE2B ad2b7c3003ca29e5e60a85c581f706ef87d99eadf939ed36ebe8f6698582f7a29dbdaf502039b60a0afe7ad4ae6ce89713e69dc8b8a7d5abe65063da7f1baa5b SHA512 cd3092281c97e9421e303aa288aac04dcccd5536ba7c0ff4d51fbf3d07b5ffacfe3456ba06f5cf63577dafbf8cf3a5d9825ceb5e9ef8ca1427900cc3e57b50a3
29 DIST xen-4.14.0-upstream-patches-6.tar.xz 119116 BLAKE2B e3a0f807182d32754c6ae2000324237117cfa66c4a43c27b583b6aef69a3889949779751b71a87b2538f679fb481e8a723433950c689f28a8c2e96278c1b0ddb SHA512 03b1fdc08e74756001fbb0de4e21297456f63615e6f63b8f360f8270ef85b0d50c3872be41cc26529ed0d91d82ffda2af53882b7c5233113f223a4ec813a0d5b
30 DIST xen-4.14.0.tar.gz 39950576 BLAKE2B db4c3e79cfdfb10260d0d14d9d28e8c8bd9bf23f42aee743acf8f560bf4cdb96a425c0df887c70f9755f62680be24bfbe0149e52a4cb843ae83090cd9d6afc71 SHA512 ebce47a2f754955d8517123d69f62006634d97620fbbe3784869a0667466e586a249f57ffaf7846d5bcb45d69377cde43354c82c233fbb5407e55653b9a33ac0
31
32 diff --git a/app-emulation/xen/xen-4.13.2-r4.ebuild b/app-emulation/xen/xen-4.13.2-r4.ebuild
33 new file mode 100644
34 index 00000000000..448b93a8ce2
35 --- /dev/null
36 +++ b/app-emulation/xen/xen-4.13.2-r4.ebuild
37 @@ -0,0 +1,165 @@
38 +# Copyright 1999-2020 Gentoo Authors
39 +# Distributed under the terms of the GNU General Public License v2
40 +
41 +EAPI=7
42 +
43 +PYTHON_COMPAT=( python3_{6..9} )
44 +
45 +inherit flag-o-matic mount-boot multilib python-any-r1 toolchain-funcs
46 +
47 +MY_PV=${PV/_/-}
48 +MY_P=${PN}-${MY_PV}
49 +
50 +if [[ $PV == *9999 ]]; then
51 + inherit git-r3
52 + EGIT_REPO_URI="git://xenbits.xen.org/xen.git"
53 + SRC_URI=""
54 +else
55 + KEYWORDS="~amd64 ~arm -x86"
56 + UPSTREAM_VER=3
57 + SECURITY_VER=
58 + GENTOO_VER=
59 +
60 + [[ -n ${UPSTREAM_VER} ]] && \
61 + UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz
62 + https://github.com/hydrapolic/gentoo-dist/raw/master/xen/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
63 + [[ -n ${SECURITY_VER} ]] && \
64 + SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-security-patches-${SECURITY_VER}.tar.xz"
65 + [[ -n ${GENTOO_VER} ]] && \
66 + GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-gentoo-patches-${GENTOO_VER}.tar.xz"
67 + SRC_URI="https://downloads.xenproject.org/release/xen/${MY_PV}/${MY_P}.tar.gz
68 + ${UPSTREAM_PATCHSET_URI}
69 + ${SECURITY_PATCHSET_URI}
70 + ${GENTOO_PATCHSET_URI}"
71 +fi
72 +
73 +DESCRIPTION="The Xen virtual machine monitor"
74 +HOMEPAGE="https://www.xenproject.org"
75 +LICENSE="GPL-2"
76 +SLOT="0"
77 +IUSE="debug efi flask"
78 +
79 +DEPEND="${PYTHON_DEPS}
80 + efi? ( >=sys-devel/binutils-2.22[multitarget] )
81 + !efi? ( >=sys-devel/binutils-2.22 )"
82 +RDEPEND=""
83 +PDEPEND="~app-emulation/xen-tools-${PV}"
84 +
85 +# no tests are available for the hypervisor
86 +# prevent the silliness of /usr/lib/debug/usr/lib/debug files
87 +# prevent stripping of the debug info from the /usr/lib/debug/xen-syms
88 +RESTRICT="test splitdebug strip"
89 +
90 +# Approved by QA team in bug #144032
91 +QA_WX_LOAD="boot/xen-syms-${PV}"
92 +
93 +REQUIRED_USE="arm? ( debug )"
94 +
95 +S="${WORKDIR}/${MY_P}"
96 +
97 +pkg_setup() {
98 + python-any-r1_pkg_setup
99 + if [[ -z ${XEN_TARGET_ARCH} ]]; then
100 + if use amd64; then
101 + export XEN_TARGET_ARCH="x86_64"
102 + elif use arm; then
103 + export XEN_TARGET_ARCH="arm32"
104 + elif use arm64; then
105 + export XEN_TARGET_ARCH="arm64"
106 + else
107 + die "Unsupported architecture!"
108 + fi
109 + fi
110 +
111 + if use flask ; then
112 + export "XSM_ENABLE=y"
113 + export "FLASK_ENABLE=y"
114 + fi
115 +}
116 +
117 +src_prepare() {
118 + # Upstream's patchset
119 + [[ -n ${UPSTREAM_VER} ]] && eapply "${WORKDIR}"/patches-upstream
120 +
121 + # Security patchset
122 + if [[ -n ${SECURITY_VER} ]]; then
123 + einfo "Try to apply Xen Security patch set"
124 + # apply main xen patches
125 + # Two parallel systems, both work side by side
126 + # Over time they may concdense into one. This will suffice for now
127 + source "${WORKDIR}"/patches-security/${PV}.conf
128 +
129 + local i
130 + for i in ${XEN_SECURITY_MAIN}; do
131 + eapply "${WORKDIR}"/patches-security/xen/$i
132 + done
133 + fi
134 +
135 + # Gentoo's patchset
136 + [[ -n ${GENTOO_VER} ]] && eapply "${WORKDIR}"/patches-gentoo
137 +
138 + eapply "${FILESDIR}"/${PN}-4.11-efi.patch
139 +
140 + # Drop .config
141 + sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
142 +
143 + if use efi; then
144 + export EFI_VENDOR="gentoo"
145 + export EFI_MOUNTPOINT="/boot"
146 + fi
147 +
148 + default
149 +}
150 +
151 +src_configure() {
152 + use arm && myopt="${myopt} CONFIG_EARLY_PRINTK=sun7i"
153 +
154 + use debug && myopt="${myopt} debug=y"
155 +
156 + # remove flags
157 + unset CFLAGS
158 + unset LDFLAGS
159 + unset ASFLAGS
160 +
161 + tc-ld-disable-gold # Bug 700374
162 +}
163 +
164 +src_compile() {
165 + # Send raw LDFLAGS so that --as-needed works
166 + emake V=1 CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
167 +}
168 +
169 +src_install() {
170 + local myopt
171 + use debug && myopt="${myopt} debug=y"
172 +
173 + # The 'make install' doesn't 'mkdir -p' the subdirs
174 + if use efi; then
175 + mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
176 + fi
177 +
178 + emake LDFLAGS="$(raw-ldflags)" DESTDIR="${D}" -C xen ${myopt} install
179 +
180 + # make install likes to throw in some extra EFI bits if it built
181 + use efi || rm -rf "${D}/usr/$(get_libdir)/efi"
182 +}
183 +
184 +pkg_postinst() {
185 + elog "Official Xen Guide:"
186 + elog " https://wiki.gentoo.org/wiki/Xen"
187 +
188 + use efi && einfo "The efi executable is installed in /boot/efi/gentoo"
189 +
190 + elog "You can optionally block the installation of /boot/xen-syms by an entry"
191 + elog "in folder /etc/portage/env using the portage's feature INSTALL_MASK"
192 + elog "e.g. echo ${msg} > /etc/portage/env/xen.conf"
193 +
194 + ewarn
195 + ewarn "Xen 4.12+ changed the default scheduler to credit2 which can cause"
196 + ewarn "domU lockups on multi-cpu systems. The legacy credit scheduler seems"
197 + ewarn "to work fine."
198 + ewarn
199 + ewarn "Add sched=credit to xen command line options to use the legacy scheduler."
200 + ewarn
201 + ewarn "https://wiki.gentoo.org/wiki/Xen#Xen_domU_hanging_with_Xen_4.12.2B"
202 +}