qemu/meson-enforce-a-minimum-Linux-kernel-hea.patch
Dario Faggioli d4b795b3fc Accepting request 1007904 from home:dfaggioli:devel:Virtualization
- Fix bsc#1204001. Patches are not upstream, and have been picked up
  and backported from the ML. This is something we usually prefer to
  avoid, but this is urgent, and the patches looks fine, with high
  chances for them to be included as they are (and if they're not, we
  will revisit this, i.e., drop them and re-include the ones that are
  actually committed)
* Patches added:
  linux-user-add-more-compat-ioctl-definit.patch
  linux-user-drop-conditionals-for-obsolet.patch
  linux-user-remove-conditionals-for-many-.patch
  meson-enforce-a-minimum-Linux-kernel-hea.patch
- Improve the output of update_git.sh, by including the list of
  repos to which we have downstream patches.
- Fix: bsc#1202665, CVE-2022-2962
* Patches added:
  net-tulip-Restrict-DMA-engine-to-memorie.patch

OBS-URL: https://build.opensuse.org/request/show/1007904
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=735
2022-10-04 12:37:05 +00:00

63 lines
2.0 KiB
Diff

From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Tue, 4 Oct 2022 10:32:05 +0100
Subject: meson: enforce a minimum Linux kernel headers version >= 4.18
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: 0000000000000000000000000000000000000000
Refereces: bsc#1204001
Various areas of QEMU have a dependency on Linux kernel header
definitions. This falls under the scope of our supported platforms
matrix, but historically we've not checked for a minimum kernel
headers version. This has made it unclear when we can drop support
for older kernel headers.
* Alpine 3.14: 5.10
* CentOS 8: 4.18
* CentOS 9: 5.14
* Debian 10: 4.19
* Debian 11: 5.10
* Fedora 35: 5.19
* Fedora 36: 5.19
* OpenSUSE 15.3: 5.3.0
* Ubuntu 20.04: 5.4
* Ubuntu 22.04: 5.15
The above ignores the 3rd version digit since distros update their
packages periodically and such updates don't generally affect public
APIs to the extent that it matters for our build time check.
Overall, we can set the baseline to 4.18 currently.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
meson.build | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/meson.build b/meson.build
index 09145d35aa3e684e92da7895ac67..a923eedefd56bc1401a111d6d8f7 100644
--- a/meson.build
+++ b/meson.build
@@ -248,6 +248,18 @@ if targetos == 'linux'
add_project_arguments('-isystem', meson.current_source_dir() / 'linux-headers',
'-isystem', 'linux-headers',
language: ['c', 'cpp'])
+
+ if not cc.compiles('''
+ #include <linux/version.h>
+ int main(void) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
+#error "QEMU requires Linux kernel headers version >= 4.18.0"
+#endif
+ return 0;
+ }''')
+ error('QEMU requires Linux kernel headers version >= 4.18.0')
+endif
+
endif
add_project_arguments('-iquote', '.',