Merge ~paelzer/ubuntu/+source/qemu:lp-1921468-1887535-1921665-GROOVY into ubuntu/+source/qemu:ubuntu/groovy-devel
- Git
- lp:~paelzer/ubuntu/+source/qemu
- lp-1921468-1887535-1921665-GROOVY
- Merge into ubuntu/groovy-devel
Status: | Merged | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Christian Ehrhardt | ||||||||||||
Approved revision: | 9d1e5c0035e2636a6056d0af886be6272e732b0f | ||||||||||||
Merge reported by: | Christian Ehrhardt | ||||||||||||
Merged at revision: | 9d1e5c0035e2636a6056d0af886be6272e732b0f | ||||||||||||
Proposed branch: | ~paelzer/ubuntu/+source/qemu:lp-1921468-1887535-1921665-GROOVY | ||||||||||||
Merge into: | ubuntu/+source/qemu:ubuntu/groovy-devel | ||||||||||||
Diff against target: |
586 lines (+529/-0) 8 files modified
debian/changelog (+14/-0) debian/patches/series (+5/-0) debian/patches/ubuntu/lp-1887535-configure-replace-enable-disable-git-update-with-wit.patch (+276/-0) debian/patches/ubuntu/lp-1921468-pc-bios-s390-ccw-break-loop-if-a-null-block-number-i.patch (+40/-0) debian/patches/ubuntu/lp-1921468-pc-bios-s390-ccw-fix-off-by-one-error.patch (+41/-0) debian/patches/ubuntu/lp-1921665-1-block-Require-aligned-image-size-to-avoid-assert.patch (+66/-0) debian/patches/ubuntu/lp-1921665-2-file-posix-Allow-byte-aligned-O_DIRECT-with-NFS.patch (+86/-0) debian/rules (+1/-0) |
||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Utkarsh Gupta (community) | Approve | ||
Canonical Server | Pending | ||
Canonical Server packageset reviewers | Pending | ||
git-ubuntu developers | Pending | ||
Review via email: mp+400326@code.launchpad.net |
Commit message
Description of the change
Christian Ehrhardt (paelzer) wrote : | # |
Utkarsh Gupta (utkarsh) wrote : | # |
* Changelog:
- [✔] changelog entry correct version and targeted codename
- [✔] changelog entries correct
- [✔] update-maintainer has been run
* New Delta:
- [✔] patches match what was proposed upstream
- [✔] patches correctly included in debian/
- [✔] patches have correct DEP3 metadata
- [?] patches are all correct
A quick note here: I prefer to run `quilt refresh` after a patch is applied to refresh a patch, this removes the unnecessary noise from all the patches.
The first 3 patches seems to be partially refreshed (which is good!), but the last two (namely, lp-1921665-
* Build/Test:
- [✔] build is ok
- [✔] verified PPA package installs/uninstalls
- [✔] autopkgtest against the PPA package passes
* Extra:
- [?] lintian warnings
I get a bunch of lintian warning for spelling errors; cf: https:/
Another very, very trivial lintian comment is about trailing whitespaces in debian/changelog. You could run:
sed -i -e 's@[[:space:
to get rid of them but I guess worth sending this pointer to mjt maybe?
That said, this MP looks good and you can upload as-is but maybe worth considering my points above?
Christian Ehrhardt (paelzer) wrote : | # |
Thanks for having a look.
The whitespace noise mostly is that way in Salsa, and that isn't a Delta I want to reapply every time. The warning is very low prio so I'll ignore that.
Similar for spelling errors, those mostly mark a package I work on and are intentional :-P
For the patch refreshes I agree, that is functional and is due to me picking up patches as suggested by others. But when I had a look at least focal was fine.
To ssh://git.
* [new tag] upload/
Uploading to ubuntu (via ftp to upload.ubuntu.com):
Uploading qemu_5.
Uploading qemu_5.
Uploading qemu_5.
Uploading qemu_5.
Successfully uploaded packages.
Christian Ehrhardt (paelzer) wrote : | # |
merged - closing MP
Preview Diff
1 | diff --git a/debian/changelog b/debian/changelog | |||
2 | index 996d8d8..6463c36 100644 | |||
3 | --- a/debian/changelog | |||
4 | +++ b/debian/changelog | |||
5 | @@ -1,3 +1,17 @@ | |||
6 | 1 | qemu (1:5.0-5ubuntu9.7) groovy; urgency=medium | ||
7 | 2 | |||
8 | 3 | * d/p/u/lp-1921468-*: fix issues handling boot menu index on s390x | ||
9 | 4 | (LP: #1921468) | ||
10 | 5 | * d/p/u/lp-1887535-configure-replace-enable-disable-git-update-with-wit.patch, | ||
11 | 6 | d/rules: Backport --with-git-submodules param so building from git repo | ||
12 | 7 | doesn't fail (LP: #1887535) | ||
13 | 8 | * Fix byte aligned writes when writing to image stored on NFS | ||
14 | 9 | server, as they aren't required to be 4kib aligned. (LP: #1921665) | ||
15 | 10 | - d/p/u/lp-1921665-1-block-Require-aligned-image-size-to-avoid-assert.patch | ||
16 | 11 | - d/p/u/lp-1921665-2-file-posix-Allow-byte-aligned-O_DIRECT-with-NFS.patch | ||
17 | 12 | |||
18 | 13 | -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Fri, 26 Mar 2021 10:36:31 +0100 | ||
19 | 14 | |||
20 | 1 | qemu (1:5.0-5ubuntu9.6) groovy-security; urgency=medium | 15 | qemu (1:5.0-5ubuntu9.6) groovy-security; urgency=medium |
21 | 2 | 16 | ||
22 | 3 | * SECURITY REGRESSION: fix multiple regressions caused by CVE-2020-13754 | 17 | * SECURITY REGRESSION: fix multiple regressions caused by CVE-2020-13754 |
23 | diff --git a/debian/patches/series b/debian/patches/series | |||
24 | index 905d272..e0e42b7 100644 | |||
25 | --- a/debian/patches/series | |||
26 | +++ b/debian/patches/series | |||
27 | @@ -117,3 +117,8 @@ ubuntu/CVE-2020-13754-4.patch | |||
28 | 117 | ubuntu/CVE-2020-13754-5.patch | 117 | ubuntu/CVE-2020-13754-5.patch |
29 | 118 | ubuntu/CVE-2020-13754-6.patch | 118 | ubuntu/CVE-2020-13754-6.patch |
30 | 119 | ubuntu/CVE-2020-13754-7.patch | 119 | ubuntu/CVE-2020-13754-7.patch |
31 | 120 | ubuntu/lp-1921468-pc-bios-s390-ccw-fix-off-by-one-error.patch | ||
32 | 121 | ubuntu/lp-1921468-pc-bios-s390-ccw-break-loop-if-a-null-block-number-i.patch | ||
33 | 122 | ubuntu/lp-1887535-configure-replace-enable-disable-git-update-with-wit.patch | ||
34 | 123 | ubuntu/lp-1921665-1-block-Require-aligned-image-size-to-avoid-assert.patch | ||
35 | 124 | ubuntu/lp-1921665-2-file-posix-Allow-byte-aligned-O_DIRECT-with-NFS.patch | ||
36 | diff --git a/debian/patches/ubuntu/lp-1887535-configure-replace-enable-disable-git-update-with-wit.patch b/debian/patches/ubuntu/lp-1887535-configure-replace-enable-disable-git-update-with-wit.patch | |||
37 | 120 | new file mode 100644 | 125 | new file mode 100644 |
38 | index 0000000..f9fd317 | |||
39 | --- /dev/null | |||
40 | +++ b/debian/patches/ubuntu/lp-1887535-configure-replace-enable-disable-git-update-with-wit.patch | |||
41 | @@ -0,0 +1,276 @@ | |||
42 | 1 | From 7d7dbf9dc15be6e1465c756c2c5ae7f1ab104fc8 Mon Sep 17 00:00:00 2001 | ||
43 | 2 | From: Dan Streetman <ddstreet@canonical.com> | ||
44 | 3 | Date: Tue, 19 Jan 2021 12:20:46 -0500 | ||
45 | 4 | Subject: [PATCH] configure: replace --enable/disable-git-update with | ||
46 | 5 | --with-git-submodules | ||
47 | 6 | MIME-Version: 1.0 | ||
48 | 7 | Content-Type: text/plain; charset=UTF-8 | ||
49 | 8 | Content-Transfer-Encoding: 8bit | ||
50 | 9 | Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1887535 | ||
51 | 10 | Origin: upstream, https://git.qemu.org/?p=qemu.git;a=commit;h=7d7dbf9dc15be6e1465c756c2c5ae7f1ab104fc8 | ||
52 | 11 | |||
53 | 12 | Replace the --enable-git-update and --disable-git-update configure params | ||
54 | 13 | with the param --with-git-submodules=(update|validate|ignore) to | ||
55 | 14 | allow 3 options for building from a git repo. | ||
56 | 15 | |||
57 | 16 | This is needed because downstream packagers, e.g. Debian, Ubuntu, etc, | ||
58 | 17 | also keep the source code in git, but do not want to enable the | ||
59 | 18 | 'git_update' mode; with the current code, that's not possible even | ||
60 | 19 | if the downstream package specifies --disable-git-update. | ||
61 | 20 | |||
62 | 21 | The previous parameters are deprecated but still available; the | ||
63 | 22 | --enable-git-update parameter maps to --with-git-submodules=update and | ||
64 | 23 | --disable-git-update parameter maps to --with-git-submodules=validate. | ||
65 | 24 | |||
66 | 25 | The configure script behavior is slightly modified, where previously | ||
67 | 26 | the dtc, capstone, and slirp submodules were not validated when | ||
68 | 27 | --disable-git-update was specified (but were updated with git-update | ||
69 | 28 | enabled), now they are validated when using --with-git-submodules=validate | ||
70 | 29 | and are only ignored when using --with-git-submodules=ignore. | ||
71 | 30 | |||
72 | 31 | Signed-off-by: Dan Streetman <ddstreet@canonical.com> | ||
73 | 32 | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> | ||
74 | 33 | --- | ||
75 | 34 | Makefile | 24 ++----------------- | ||
76 | 35 | configure | 51 ++++++++++++++++++++++++++++++---------- | ||
77 | 36 | scripts/git-submodule.sh | 34 ++++++++++++++++++++------- | ||
78 | 37 | 3 files changed, 66 insertions(+), 43 deletions(-) | ||
79 | 38 | |||
80 | 39 | --- a/Makefile | ||
81 | 40 | +++ b/Makefile | ||
82 | 41 | @@ -21,33 +21,11 @@ ifneq ($(wildcard config-host.mak),) | ||
83 | 42 | all: | ||
84 | 43 | include config-host.mak | ||
85 | 44 | |||
86 | 45 | -git-submodule-update: | ||
87 | 46 | - | ||
88 | 47 | .PHONY: git-submodule-update | ||
89 | 48 | - | ||
90 | 49 | -git_module_status := $(shell \ | ||
91 | 50 | - cd '$(SRC_PATH)' && \ | ||
92 | 51 | - GIT="$(GIT)" ./scripts/git-submodule.sh status $(GIT_SUBMODULES); \ | ||
93 | 52 | - echo $$?; \ | ||
94 | 53 | -) | ||
95 | 54 | - | ||
96 | 55 | -ifeq (1,$(git_module_status)) | ||
97 | 56 | -ifeq (no,$(GIT_UPDATE)) | ||
98 | 57 | -git-submodule-update: | ||
99 | 58 | - $(call quiet-command, \ | ||
100 | 59 | - echo && \ | ||
101 | 60 | - echo "GIT submodule checkout is out of date. Please run" && \ | ||
102 | 61 | - echo " scripts/git-submodule.sh update $(GIT_SUBMODULES)" && \ | ||
103 | 62 | - echo "from the source directory checkout $(SRC_PATH)" && \ | ||
104 | 63 | - echo && \ | ||
105 | 64 | - exit 1) | ||
106 | 65 | -else | ||
107 | 66 | git-submodule-update: | ||
108 | 67 | $(call quiet-command, \ | ||
109 | 68 | - (cd $(SRC_PATH) && GIT="$(GIT)" ./scripts/git-submodule.sh update $(GIT_SUBMODULES)), \ | ||
110 | 69 | - "GIT","$(GIT_SUBMODULES)") | ||
111 | 70 | -endif | ||
112 | 71 | -endif | ||
113 | 72 | + (GIT="$(GIT)" "$(SRC_PATH)/scripts/git-submodule.sh" $(GIT_SUBMODULES_ACTION) $(GIT_SUBMODULES)), \ | ||
114 | 73 | + "GIT","$(GIT_SUBMODULES)") | ||
115 | 74 | |||
116 | 75 | .git-submodule-status: git-submodule-update config-host.mak | ||
117 | 76 | |||
118 | 77 | --- a/configure | ||
119 | 78 | +++ b/configure | ||
120 | 79 | @@ -307,12 +307,12 @@ gdb_bin=$(command -v "gdb") | ||
121 | 80 | |||
122 | 81 | if test -e "$source_path/.git" | ||
123 | 82 | then | ||
124 | 83 | - git_update=yes | ||
125 | 84 | + git_submodules_action="update" | ||
126 | 85 | git_submodules="ui/keycodemapdb" | ||
127 | 86 | git_submodules="$git_submodules tests/fp/berkeley-testfloat-3" | ||
128 | 87 | git_submodules="$git_submodules tests/fp/berkeley-softfloat-3" | ||
129 | 88 | else | ||
130 | 89 | - git_update=no | ||
131 | 90 | + git_submodules_action="ignore" | ||
132 | 91 | git_submodules="" | ||
133 | 92 | |||
134 | 93 | if ! test -f "$source_path/ui/keycodemapdb/README" | ||
135 | 94 | @@ -1571,9 +1571,16 @@ for opt do | ||
136 | 95 | ;; | ||
137 | 96 | --with-git=*) git="$optarg" | ||
138 | 97 | ;; | ||
139 | 98 | - --enable-git-update) git_update=yes | ||
140 | 99 | + --enable-git-update) | ||
141 | 100 | + git_submodules_action="update" | ||
142 | 101 | + echo "--enable-git-update deprecated, use --with-git-submodules=update" | ||
143 | 102 | + ;; | ||
144 | 103 | + --disable-git-update) | ||
145 | 104 | + git_submodules_action="validate" | ||
146 | 105 | + echo "--disable-git-update deprecated, use --with-git-submodules=validate" | ||
147 | 106 | ;; | ||
148 | 107 | - --disable-git-update) git_update=no | ||
149 | 108 | + --with-git-submodules=*) | ||
150 | 109 | + git_submodules_action="$optarg" | ||
151 | 110 | ;; | ||
152 | 111 | --enable-debug-mutex) debug_mutex=yes | ||
153 | 112 | ;; | ||
154 | 113 | @@ -1609,6 +1616,21 @@ for opt do | ||
155 | 114 | esac | ||
156 | 115 | done | ||
157 | 116 | |||
158 | 117 | +case $git_submodules_action in | ||
159 | 118 | + update|validate) | ||
160 | 119 | + if test ! -e "$source_path/.git"; then | ||
161 | 120 | + echo "ERROR: cannot $git_submodules_action git submodules without .git" | ||
162 | 121 | + exit 1 | ||
163 | 122 | + fi | ||
164 | 123 | + ;; | ||
165 | 124 | + ignore) | ||
166 | 125 | + ;; | ||
167 | 126 | + *) | ||
168 | 127 | + echo "ERROR: invalid --with-git-submodules= value '$git_submodules_action'" | ||
169 | 128 | + exit 1 | ||
170 | 129 | + ;; | ||
171 | 130 | +esac | ||
172 | 131 | + | ||
173 | 132 | case "$cpu" in | ||
174 | 133 | ppc) | ||
175 | 134 | CPU_CFLAGS="-m32" | ||
176 | 135 | @@ -1736,6 +1758,9 @@ Advanced options (experts only): | ||
177 | 136 | --sphinx-build=SPHINX use specified sphinx-build [$sphinx_build] | ||
178 | 137 | --smbd=SMBD use specified smbd [$smbd] | ||
179 | 138 | --with-git=GIT use specified git [$git] | ||
180 | 139 | + --with-git-submodules=update update git submodules (default if .git dir exists) | ||
181 | 140 | + --with-git-submodules=validate fail if git submodules are not up to date | ||
182 | 141 | + --with-git-submodules=ignore do not update or check git submodules (default if no .git dir) | ||
183 | 142 | --static enable static build [$static] | ||
184 | 143 | --mandir=PATH install man pages in PATH | ||
185 | 144 | --datadir=PATH install firmware in PATH$confsuffix | ||
186 | 145 | @@ -1962,7 +1987,7 @@ fi | ||
187 | 146 | # Consult white-list to determine whether to enable werror | ||
188 | 147 | # by default. Only enable by default for git builds | ||
189 | 148 | if test -z "$werror" ; then | ||
190 | 149 | - if test -e "$source_path/.git" && \ | ||
191 | 150 | + if test $git_submodules_action != 'ignore' && \ | ||
192 | 151 | { test "$linux" = "yes" || test "$mingw32" = "yes"; }; then | ||
193 | 152 | werror="yes" | ||
194 | 153 | else | ||
195 | 154 | @@ -4273,10 +4298,10 @@ EOF | ||
196 | 155 | fdt=system | ||
197 | 156 | else | ||
198 | 157 | # have GIT checkout, so activate dtc submodule | ||
199 | 158 | - if test -e "${source_path}/.git" ; then | ||
200 | 159 | + if test $git_submodules_action != 'ignore' ; then | ||
201 | 160 | git_submodules="${git_submodules} dtc" | ||
202 | 161 | fi | ||
203 | 162 | - if test -d "${source_path}/dtc/libfdt" || test -e "${source_path}/.git" ; then | ||
204 | 163 | + if test -d "${source_path}/dtc/libfdt" || test $git_submodules_action != 'ignore' ; then | ||
205 | 164 | fdt=git | ||
206 | 165 | mkdir -p dtc | ||
207 | 166 | if [ "$pwd_is_source_path" != "y" ] ; then | ||
208 | 167 | @@ -5231,7 +5256,7 @@ case "$capstone" in | ||
209 | 168 | "" | yes) | ||
210 | 169 | if $pkg_config capstone; then | ||
211 | 170 | capstone=system | ||
212 | 171 | - elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then | ||
213 | 172 | + elif test $git_submodules_action != 'ignore' ; then | ||
214 | 173 | capstone=git | ||
215 | 174 | elif test -e "${source_path}/capstone/Makefile" ; then | ||
216 | 175 | capstone=internal | ||
217 | 176 | @@ -6206,7 +6231,7 @@ case "$slirp" in | ||
218 | 177 | "" | yes) | ||
219 | 178 | if $pkg_config slirp; then | ||
220 | 179 | slirp=system | ||
221 | 180 | - elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then | ||
222 | 181 | + elif test $git_submodules_action != 'ignore' ; then | ||
223 | 182 | slirp=git | ||
224 | 183 | elif test -e "${source_path}/slirp/Makefile" ; then | ||
225 | 184 | slirp=internal | ||
226 | 185 | @@ -6791,7 +6816,7 @@ echo "libs_cpu=$libs_cpu" >> $config_hos | ||
227 | 186 | echo "libs_softmmu=$libs_softmmu" >> $config_host_mak | ||
228 | 187 | echo "GIT=$git" >> $config_host_mak | ||
229 | 188 | echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak | ||
230 | 189 | -echo "GIT_UPDATE=$git_update" >> $config_host_mak | ||
231 | 190 | +echo "GIT_SUBMODULES_ACTION=$git_submodules_action" >> $config_host_mak | ||
232 | 191 | |||
233 | 192 | echo "ARCH=$ARCH" >> $config_host_mak | ||
234 | 193 | |||
235 | 194 | --- a/scripts/git-submodule.sh | ||
236 | 195 | +++ b/scripts/git-submodule.sh | ||
237 | 196 | @@ -9,9 +9,14 @@ command=$1 | ||
238 | 197 | shift | ||
239 | 198 | maybe_modules="$@" | ||
240 | 199 | |||
241 | 200 | +# if --with-git-submodules=ignore, do nothing | ||
242 | 201 | +test "$command" = "ignore" && exit 0 | ||
243 | 202 | + | ||
244 | 203 | test -z "$GIT" && GIT=git | ||
245 | 204 | |||
246 | 205 | -error() { | ||
247 | 206 | +cd "$(dirname "$0")/.." | ||
248 | 207 | + | ||
249 | 208 | +update_error() { | ||
250 | 209 | echo "$0: $*" | ||
251 | 210 | echo | ||
252 | 211 | echo "Unable to automatically checkout GIT submodules '$modules'." | ||
253 | 212 | @@ -24,7 +29,7 @@ error() { | ||
254 | 213 | echo "Alternatively you may disable automatic GIT submodule checkout" | ||
255 | 214 | echo "with:" | ||
256 | 215 | echo | ||
257 | 216 | - echo " $ ./configure --disable-git-update" | ||
258 | 217 | + echo " $ ./configure --with-git-submodules=validate" | ||
259 | 218 | echo | ||
260 | 219 | echo "and then manually update submodules prior to running make, with:" | ||
261 | 220 | echo | ||
262 | 221 | @@ -33,6 +38,19 @@ error() { | ||
263 | 222 | exit 1 | ||
264 | 223 | } | ||
265 | 224 | |||
266 | 225 | +validate_error() { | ||
267 | 226 | + if test "$1" = "validate"; then | ||
268 | 227 | + echo "GIT submodules checkout is out of date, and submodules" | ||
269 | 228 | + echo "configured for validate only. Please run" | ||
270 | 229 | + echo " scripts/git-submodule.sh update $maybe_modules" | ||
271 | 230 | + echo "from the source directory or call configure with" | ||
272 | 231 | + echo " --with-git-submodules=update" | ||
273 | 232 | + echo "To disable GIT submodules validation, use" | ||
274 | 233 | + echo " --with-git-submodules=ignore" | ||
275 | 234 | + fi | ||
276 | 235 | + exit 1 | ||
277 | 236 | +} | ||
278 | 237 | + | ||
279 | 238 | modules="" | ||
280 | 239 | for m in $maybe_modules | ||
281 | 240 | do | ||
282 | 241 | @@ -52,18 +70,18 @@ then | ||
283 | 242 | fi | ||
284 | 243 | |||
285 | 244 | case "$command" in | ||
286 | 245 | -status) | ||
287 | 246 | +status|validate) | ||
288 | 247 | if test -z "$maybe_modules" | ||
289 | 248 | then | ||
290 | 249 | - test -s ${substat} && exit 1 || exit 0 | ||
291 | 250 | + test -s ${substat} && validate_error "$command" || exit 0 | ||
292 | 251 | fi | ||
293 | 252 | |||
294 | 253 | - test -f "$substat" || exit 1 | ||
295 | 254 | + test -f "$substat" || validate_error "$command" | ||
296 | 255 | for module in $modules; do | ||
297 | 256 | CURSTATUS=$($GIT submodule status $module) | ||
298 | 257 | OLDSTATUS=$(cat $substat | grep $module) | ||
299 | 258 | if test "$CURSTATUS" != "$OLDSTATUS"; then | ||
300 | 259 | - exit 1 | ||
301 | 260 | + validate_error "$command" | ||
302 | 261 | fi | ||
303 | 262 | done | ||
304 | 263 | exit 0 | ||
305 | 264 | @@ -76,10 +94,10 @@ update) | ||
306 | 265 | fi | ||
307 | 266 | |||
308 | 267 | $GIT submodule update --init $modules 1>/dev/null | ||
309 | 268 | - test $? -ne 0 && error "failed to update modules" | ||
310 | 269 | + test $? -ne 0 && update_error "failed to update modules" | ||
311 | 270 | |||
312 | 271 | $GIT submodule status $modules > "${substat}" | ||
313 | 272 | - test $? -ne 0 && error "failed to save git submodule status" >&2 | ||
314 | 273 | + test $? -ne 0 && update_error "failed to save git submodule status" >&2 | ||
315 | 274 | ;; | ||
316 | 275 | esac | ||
317 | 276 | |||
318 | diff --git a/debian/patches/ubuntu/lp-1921468-pc-bios-s390-ccw-break-loop-if-a-null-block-number-i.patch b/debian/patches/ubuntu/lp-1921468-pc-bios-s390-ccw-break-loop-if-a-null-block-number-i.patch | |||
319 | 0 | new file mode 100644 | 277 | new file mode 100644 |
320 | index 0000000..1df9421 | |||
321 | --- /dev/null | |||
322 | +++ b/debian/patches/ubuntu/lp-1921468-pc-bios-s390-ccw-break-loop-if-a-null-block-number-i.patch | |||
323 | @@ -0,0 +1,40 @@ | |||
324 | 1 | From 468184ec9024f4f7b55247f70ec57554e8a500d7 Mon Sep 17 00:00:00 2001 | ||
325 | 2 | From: Marc Hartmayer <mhartmay@linux.ibm.com> | ||
326 | 3 | Date: Thu, 24 Sep 2020 10:59:25 +0200 | ||
327 | 4 | Subject: [PATCH] pc-bios/s390-ccw: break loop if a null block number is | ||
328 | 5 | reached | ||
329 | 6 | |||
330 | 7 | Break the loop if `cur_block_nr` is a null block number because this | ||
331 | 8 | means that the end of chunk is reached. In this case we will try to | ||
332 | 9 | boot the default entry. | ||
333 | 10 | |||
334 | 11 | Fixes: ba831b25262a ("s390-ccw: read stage2 boot loader data to find menu") | ||
335 | 12 | Reviewed-by: Collin Walling <walling@linux.ibm.com> | ||
336 | 13 | Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> | ||
337 | 14 | Message-Id: <20200924085926.21709-3-mhartmay@linux.ibm.com> | ||
338 | 15 | Signed-off-by: Thomas Huth <thuth@redhat.com> | ||
339 | 16 | |||
340 | 17 | Origin: upstream, https://git.qemu.org/?p=qemu.git;a=commit;h=468184ec9024 | ||
341 | 18 | Bug-Ubuntu: https://bugs.launchpad.net/bugs/1921468 | ||
342 | 19 | Last-Update: 2021-03-26 | ||
343 | 20 | |||
344 | 21 | --- | ||
345 | 22 | pc-bios/s390-ccw/bootmap.c | 2 +- | ||
346 | 23 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
347 | 24 | |||
348 | 25 | diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c | ||
349 | 26 | index 767bb612db..942fba3fa7 100644 | ||
350 | 27 | --- a/pc-bios/s390-ccw/bootmap.c | ||
351 | 28 | +++ b/pc-bios/s390-ccw/bootmap.c | ||
352 | 29 | @@ -192,7 +192,7 @@ static int eckd_get_boot_menu_index(block_number_t s1b_block_nr) | ||
353 | 30 | for (i = 0; i < STAGE2_BLK_CNT_MAX; i++) { | ||
354 | 31 | cur_block_nr = eckd_block_num(&s1b->seek[i].chs); | ||
355 | 32 | |||
356 | 33 | - if (!cur_block_nr) { | ||
357 | 34 | + if (!cur_block_nr || is_null_block_number(cur_block_nr)) { | ||
358 | 35 | break; | ||
359 | 36 | } | ||
360 | 37 | |||
361 | 38 | -- | ||
362 | 39 | 2.30.0 | ||
363 | 40 | |||
364 | diff --git a/debian/patches/ubuntu/lp-1921468-pc-bios-s390-ccw-fix-off-by-one-error.patch b/debian/patches/ubuntu/lp-1921468-pc-bios-s390-ccw-fix-off-by-one-error.patch | |||
365 | 0 | new file mode 100644 | 41 | new file mode 100644 |
366 | index 0000000..b59bdad | |||
367 | --- /dev/null | |||
368 | +++ b/debian/patches/ubuntu/lp-1921468-pc-bios-s390-ccw-fix-off-by-one-error.patch | |||
369 | @@ -0,0 +1,41 @@ | |||
370 | 1 | From 5f97ba0c74ccace0a4014460de9751ff3c6f454a Mon Sep 17 00:00:00 2001 | ||
371 | 2 | From: Marc Hartmayer <mhartmay@linux.ibm.com> | ||
372 | 3 | Date: Thu, 24 Sep 2020 10:59:24 +0200 | ||
373 | 4 | Subject: [PATCH] pc-bios/s390-ccw: fix off-by-one error | ||
374 | 5 | |||
375 | 6 | This error takes effect when the magic value "zIPL" is located at the | ||
376 | 7 | end of a block. For example if s2_cur_blk = 0x7fe18000 and the magic | ||
377 | 8 | value "zIPL" is located at 0x7fe18ffc - 0x7fe18fff. | ||
378 | 9 | |||
379 | 10 | Fixes: ba831b25262a ("s390-ccw: read stage2 boot loader data to find menu") | ||
380 | 11 | Reviewed-by: Collin Walling <walling@linux.ibm.com> | ||
381 | 12 | Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> | ||
382 | 13 | Message-Id: <20200924085926.21709-2-mhartmay@linux.ibm.com> | ||
383 | 14 | Reviewed-by: Thomas Huth <thuth@redhat.com> | ||
384 | 15 | [thuth: Use "<= ... - 4" instead of "< ... - 3"] | ||
385 | 16 | Signed-off-by: Thomas Huth <thuth@redhat.com> | ||
386 | 17 | |||
387 | 18 | Origin: upstream, https://git.qemu.org/?p=qemu.git;a=commit;h=5f97ba0c74cc | ||
388 | 19 | Bug-Ubuntu: https://bugs.launchpad.net/bugs/1921468 | ||
389 | 20 | Last-Update: 2021-03-26 | ||
390 | 21 | |||
391 | 22 | --- | ||
392 | 23 | pc-bios/s390-ccw/bootmap.c | 2 +- | ||
393 | 24 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
394 | 25 | |||
395 | 26 | diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c | ||
396 | 27 | index 0ef6b851f3..767bb612db 100644 | ||
397 | 28 | --- a/pc-bios/s390-ccw/bootmap.c | ||
398 | 29 | +++ b/pc-bios/s390-ccw/bootmap.c | ||
399 | 30 | @@ -163,7 +163,7 @@ static bool find_zipl_boot_menu_banner(int *offset) | ||
400 | 31 | int i; | ||
401 | 32 | |||
402 | 33 | /* Menu banner starts with "zIPL" */ | ||
403 | 34 | - for (i = 0; i < virtio_get_block_size() - 4; i++) { | ||
404 | 35 | + for (i = 0; i <= virtio_get_block_size() - 4; i++) { | ||
405 | 36 | if (magic_match(s2_cur_blk + i, ZIPL_MAGIC_EBCDIC)) { | ||
406 | 37 | *offset = i; | ||
407 | 38 | return true; | ||
408 | 39 | -- | ||
409 | 40 | 2.30.0 | ||
410 | 41 | |||
411 | diff --git a/debian/patches/ubuntu/lp-1921665-1-block-Require-aligned-image-size-to-avoid-assert.patch b/debian/patches/ubuntu/lp-1921665-1-block-Require-aligned-image-size-to-avoid-assert.patch | |||
412 | 0 | new file mode 100644 | 42 | new file mode 100644 |
413 | index 0000000..a4bdd17 | |||
414 | --- /dev/null | |||
415 | +++ b/debian/patches/ubuntu/lp-1921665-1-block-Require-aligned-image-size-to-avoid-assert.patch | |||
416 | @@ -0,0 +1,66 @@ | |||
417 | 1 | From 9c60a5d1978e6dcf85c0e01b50e6f7f54ca09104 Mon Sep 17 00:00:00 2001 | ||
418 | 2 | From: Kevin Wolf <kwolf@redhat.com> | ||
419 | 3 | Date: Thu, 16 Jul 2020 16:26:00 +0200 | ||
420 | 4 | Subject: [PATCH] block: Require aligned image size to avoid assertion failure | ||
421 | 5 | |||
422 | 6 | Unaligned requests will automatically be aligned to bl.request_alignment | ||
423 | 7 | and we can't extend write requests to access space beyond the end of the | ||
424 | 8 | image without resizing the image, so if we have the WRITE permission, | ||
425 | 9 | but not the RESIZE one, it's required that the image size is aligned. | ||
426 | 10 | |||
427 | 11 | Failing to meet this requirement could cause assertion failures like | ||
428 | 12 | this if RESIZE permissions weren't requested: | ||
429 | 13 | |||
430 | 14 | qemu-img: block/io.c:1910: bdrv_co_write_req_prepare: Assertion `end_sector <= bs->total_sectors || child->perm & BLK_PERM_RESIZE' failed. | ||
431 | 15 | |||
432 | 16 | This was e.g. triggered by qemu-img converting to a target image with 4k | ||
433 | 17 | request alignment when the image was only aligned to 512 bytes, but not | ||
434 | 18 | to 4k. | ||
435 | 19 | |||
436 | 20 | Turn this into a graceful error in bdrv_check_perm() so that WRITE | ||
437 | 21 | without RESIZE can only be taken if the image size is aligned. If a user | ||
438 | 22 | holds both permissions and drops only RESIZE, the function will return | ||
439 | 23 | an error, but bdrv_child_try_set_perm() will ignore the failure silently | ||
440 | 24 | if permissions are only requested to be relaxed and just keep both | ||
441 | 25 | permissions while returning success. | ||
442 | 26 | |||
443 | 27 | Signed-off-by: Kevin Wolf <kwolf@redhat.com> | ||
444 | 28 | Message-Id: <20200716142601.111237-2-kwolf@redhat.com> | ||
445 | 29 | Reviewed-by: Max Reitz <mreitz@redhat.com> | ||
446 | 30 | Signed-off-by: Kevin Wolf <kwolf@redhat.com> | ||
447 | 31 | |||
448 | 32 | Origin: backport, https://git.qemu.org/?p=qemu.git;a=commit;h=9c60a5d1978e6dcf85c0e01b50e6f7f54ca09104 | ||
449 | 33 | Bug-Ubuntu: https://bugs.launchpad.net/bugs/1921665 | ||
450 | 34 | Last-Update: 2021-03-29 | ||
451 | 35 | |||
452 | 36 | --- | ||
453 | 37 | block.c | 16 ++++++++++++++++ | ||
454 | 38 | 1 file changed, 16 insertions(+) | ||
455 | 39 | |||
456 | 40 | Index: qemu-5.0/block.c | ||
457 | 41 | =================================================================== | ||
458 | 42 | --- qemu-5.0.orig/block.c 2021-03-29 16:46:50.775130508 +1300 | ||
459 | 43 | +++ qemu-5.0/block.c 2021-03-29 16:46:50.771130437 +1300 | ||
460 | 44 | @@ -2031,6 +2031,22 @@ | ||
461 | 45 | return -EPERM; | ||
462 | 46 | } | ||
463 | 47 | |||
464 | 48 | + /* | ||
465 | 49 | + * Unaligned requests will automatically be aligned to bl.request_alignment | ||
466 | 50 | + * and without RESIZE we can't extend requests to write to space beyond the | ||
467 | 51 | + * end of the image, so it's required that the image size is aligned. | ||
468 | 52 | + */ | ||
469 | 53 | + if ((cumulative_perms & (BLK_PERM_WRITE | BLK_PERM_WRITE_UNCHANGED)) && | ||
470 | 54 | + !(cumulative_perms & BLK_PERM_RESIZE)) | ||
471 | 55 | + { | ||
472 | 56 | + if ((bs->total_sectors * BDRV_SECTOR_SIZE) % bs->bl.request_alignment) { | ||
473 | 57 | + error_setg(errp, "Cannot get 'write' permission without 'resize': " | ||
474 | 58 | + "Image size is not a multiple of request " | ||
475 | 59 | + "alignment"); | ||
476 | 60 | + return -EPERM; | ||
477 | 61 | + } | ||
478 | 62 | + } | ||
479 | 63 | + | ||
480 | 64 | /* Check this node */ | ||
481 | 65 | if (!drv) { | ||
482 | 66 | return 0; | ||
483 | diff --git a/debian/patches/ubuntu/lp-1921665-2-file-posix-Allow-byte-aligned-O_DIRECT-with-NFS.patch b/debian/patches/ubuntu/lp-1921665-2-file-posix-Allow-byte-aligned-O_DIRECT-with-NFS.patch | |||
484 | 0 | new file mode 100644 | 67 | new file mode 100644 |
485 | index 0000000..069a1bb | |||
486 | --- /dev/null | |||
487 | +++ b/debian/patches/ubuntu/lp-1921665-2-file-posix-Allow-byte-aligned-O_DIRECT-with-NFS.patch | |||
488 | @@ -0,0 +1,86 @@ | |||
489 | 1 | From 5edc85571e7b7269dce408735eba7507f18ac666 Mon Sep 17 00:00:00 2001 | ||
490 | 2 | From: Kevin Wolf <kwolf@redhat.com> | ||
491 | 3 | Date: Thu, 16 Jul 2020 16:26:01 +0200 | ||
492 | 4 | Subject: [PATCH] file-posix: Allow byte-aligned O_DIRECT with NFS | ||
493 | 5 | |||
494 | 6 | Since commit a6b257a08e3 ('file-posix: Handle undetectable alignment'), | ||
495 | 7 | we assume that if we open a file with O_DIRECT and alignment probing | ||
496 | 8 | returns 1, we just couldn't find out the real alignment requirement | ||
497 | 9 | because some filesystems make the requirement only for allocated blocks. | ||
498 | 10 | In this case, a safe default of 4k is used. | ||
499 | 11 | |||
500 | 12 | This is too strict for NFS, which does actually allow byte-aligned | ||
501 | 13 | requests even with O_DIRECT. Because we can't distinguish both cases | ||
502 | 14 | with generic code, let's just look at the file system magic and disable | ||
503 | 15 | s->needs_alignment for NFS. This way, O_DIRECT can still be used on NFS | ||
504 | 16 | for images that are not aligned to 4k. | ||
505 | 17 | |||
506 | 18 | Signed-off-by: Kevin Wolf <kwolf@redhat.com> | ||
507 | 19 | Reviewed-by: Eric Blake <eblake@redhat.com> | ||
508 | 20 | Message-Id: <20200716142601.111237-3-kwolf@redhat.com> | ||
509 | 21 | Reviewed-by: Max Reitz <mreitz@redhat.com> | ||
510 | 22 | Signed-off-by: Kevin Wolf <kwolf@redhat.com> | ||
511 | 23 | |||
512 | 24 | Origin: backport, https://git.qemu.org/?p=qemu.git;a=commit;h=5edc85571e7b7269dce408735eba7507f18ac666 | ||
513 | 25 | Bug-Ubuntu: https://bugs.launchpad.net/bugs/1921665 | ||
514 | 26 | Last-Update: 2021-03-29 | ||
515 | 27 | |||
516 | 28 | --- | ||
517 | 29 | block/file-posix.c | 26 +++++++++++++++++++++++++- | ||
518 | 30 | 1 file changed, 25 insertions(+), 1 deletion(-) | ||
519 | 31 | |||
520 | 32 | Index: qemu-5.0/block/file-posix.c | ||
521 | 33 | =================================================================== | ||
522 | 34 | --- qemu-5.0.orig/block/file-posix.c 2021-03-29 16:47:07.303430132 +1300 | ||
523 | 35 | +++ qemu-5.0/block/file-posix.c 2021-03-29 16:47:07.303430132 +1300 | ||
524 | 36 | @@ -61,10 +61,12 @@ | ||
525 | 37 | #include <sys/ioctl.h> | ||
526 | 38 | #include <sys/param.h> | ||
527 | 39 | #include <sys/syscall.h> | ||
528 | 40 | +#include <sys/vfs.h> | ||
529 | 41 | #include <linux/cdrom.h> | ||
530 | 42 | #include <linux/fd.h> | ||
531 | 43 | #include <linux/fs.h> | ||
532 | 44 | #include <linux/hdreg.h> | ||
533 | 45 | +#include <linux/magic.h> | ||
534 | 46 | #include <scsi/sg.h> | ||
535 | 47 | #ifdef __s390__ | ||
536 | 48 | #include <asm/dasd.h> | ||
537 | 49 | @@ -299,6 +301,28 @@ | ||
538 | 50 | #endif | ||
539 | 51 | } | ||
540 | 52 | |||
541 | 53 | +/* | ||
542 | 54 | + * Returns true if no alignment restrictions are necessary even for files | ||
543 | 55 | + * opened with O_DIRECT. | ||
544 | 56 | + * | ||
545 | 57 | + * raw_probe_alignment() probes the required alignment and assume that 1 means | ||
546 | 58 | + * the probing failed, so it falls back to a safe default of 4k. This can be | ||
547 | 59 | + * avoided if we know that byte alignment is okay for the file. | ||
548 | 60 | + */ | ||
549 | 61 | +static bool dio_byte_aligned(int fd) | ||
550 | 62 | +{ | ||
551 | 63 | +#ifdef __linux__ | ||
552 | 64 | + struct statfs buf; | ||
553 | 65 | + int ret; | ||
554 | 66 | + | ||
555 | 67 | + ret = fstatfs(fd, &buf); | ||
556 | 68 | + if (ret == 0 && buf.f_type == NFS_SUPER_MAGIC) { | ||
557 | 69 | + return true; | ||
558 | 70 | + } | ||
559 | 71 | +#endif | ||
560 | 72 | + return false; | ||
561 | 73 | +} | ||
562 | 74 | + | ||
563 | 75 | /* Check if read is allowed with given memory buffer and length. | ||
564 | 76 | * | ||
565 | 77 | * This function is used to check O_DIRECT memory buffer and request alignment. | ||
566 | 78 | @@ -630,7 +654,7 @@ | ||
567 | 79 | |||
568 | 80 | s->has_discard = true; | ||
569 | 81 | s->has_write_zeroes = true; | ||
570 | 82 | - if ((bs->open_flags & BDRV_O_NOCACHE) != 0) { | ||
571 | 83 | + if ((bs->open_flags & BDRV_O_NOCACHE) != 0 && !dio_byte_aligned(s->fd)) { | ||
572 | 84 | s->needs_alignment = true; | ||
573 | 85 | } | ||
574 | 86 | |||
575 | diff --git a/debian/rules b/debian/rules | |||
576 | index 2d1fa4e..c794d8f 100755 | |||
577 | --- a/debian/rules | |||
578 | +++ b/debian/rules | |||
579 | @@ -59,6 +59,7 @@ common_configure_opts = \ | |||
580 | 59 | --disable-strip \ | 59 | --disable-strip \ |
581 | 60 | --interp-prefix=/etc/qemu-binfmt/%M \ | 60 | --interp-prefix=/etc/qemu-binfmt/%M \ |
582 | 61 | --localstatedir=/var \ | 61 | --localstatedir=/var \ |
583 | 62 | --with-git-submodules=ignore \ | ||
584 | 62 | 63 | ||
585 | 63 | # Cross compiling support | 64 | # Cross compiling support |
586 | 64 | ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) | 65 | ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) |
PPA: https:/ /launchpad. net/~ci- train-ppa- service/ +archive/ ubuntu/ 4504/+packages