[gnome-continuous] Try patching Mutter to use getrandom()'s syscall
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous] Try patching Mutter to use getrandom()'s syscall
- Date: Mon, 24 Jun 2019 23:37:00 +0000 (UTC)
commit 48c92d47bbe84cc53746f7dc5827256d3c929cce
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Jun 25 00:36:17 2019 +0100
Try patching Mutter to use getrandom()'s syscall
manifest.json | 1 +
patches/mutter-getrandom.patch | 60 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+)
---
diff --git a/manifest.json b/manifest.json
index 05954e2..8f52f4b 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1144,6 +1144,7 @@
{"src": "gnome:mutter.git",
"name": "mutter",
+ "patches": ["mutter-getrandom.patch"],
"config-opts": [
"-Dremote_desktop=false",
"-Degl_device=false",
diff --git a/patches/mutter-getrandom.patch b/patches/mutter-getrandom.patch
new file mode 100644
index 0000000..f14fc9d
--- /dev/null
+++ b/patches/mutter-getrandom.patch
@@ -0,0 +1,60 @@
+From 72231d65c1a7552e1e9b8529fa956dc6282eb9d6 Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi <ebassi gnome org>
+Date: Tue, 25 Jun 2019 00:29:51 +0100
+Subject: [PATCH] Add syscall fallback for getrandom()
+
+When using linux/random.h, we need to use the syscall() interface.
+---
+ meson.build | 4 ++--
+ src/wayland/meta-xwayland.c | 12 +++++++++++-
+ 2 files changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index d01b42c19..46231f03d 100644
+--- a/meson.build
++++ b/meson.build
+@@ -368,8 +368,8 @@ if have_wayland
+ # For Xwayland authority file generation.
+ if cc.has_header_symbol('sys/random.h', 'getrandom')
+ cdata.set('HAVE_SYS_RANDOM', 1)
+- elif cc.has_header_symbol('linux/random.h', 'getrandom')
+- cdata.set('HAVE_LINUX_RANDOM', 1)
++ elif cc.has_header_symbol('sys/syscall.h', 'SYS_getrandom')
++ cdata.set('HAVE_GETRANDOM_SYSCALL', 1)
+ else
+ error('Required function getrandom not found')
+ endif
+diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
+index 88a4b4c11..68c2fbef6 100644
+--- a/src/wayland/meta-xwayland.c
++++ b/src/wayland/meta-xwayland.c
+@@ -33,8 +33,10 @@
+ #include <sys/un.h>
+ #if defined(HAVE_SYS_RANDOM)
+ #include <sys/random.h>
+-#elif defined(HAVE_LINUX_RANDOM)
++#elif defined(HAVE_GETRANDOM_SYSCALL)
+ #include <linux/random.h>
++#include <sys/syscall.h>
++#include <errno.h>
+ #endif
+ #include <unistd.h>
+ #include <X11/Xauth.h>
+@@ -445,6 +447,14 @@ choose_xdisplay (MetaXWaylandManager *manager)
+ return TRUE;
+ }
+
++#ifdef HAVE_GETRANDOM_SYSCALL
++static ssize_t
++getrandom (void *buf, size_t buflen, unsigned int flags)
++{
++ return syscall (SYS_getrandom, buf, buflen, 0);
++}
++#endif
++
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC (FILE, fclose)
+
+ static gboolean
+--
+2.21.0
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]