diff --git a/.gitignore b/.gitignore index 2b3fd13..9add9e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/xf86-input-wacom-0.36.1.tar.bz2 +SOURCES/xf86-input-wacom-0.38.0.tar.bz2 diff --git a/.xorg-x11-drv-wacom.metadata b/.xorg-x11-drv-wacom.metadata index 694a116..8c8747c 100644 --- a/.xorg-x11-drv-wacom.metadata +++ b/.xorg-x11-drv-wacom.metadata @@ -1 +1 @@ -51d1b198f86bf7609b0464ce34a93c90f1ef557c SOURCES/xf86-input-wacom-0.36.1.tar.bz2 +b153c976365a54af3d5265e50e7a1e6eb415851d SOURCES/xf86-input-wacom-0.38.0.tar.bz2 diff --git a/SOURCES/0001-tools-Fix-potential-buffer-overflow-when-reading-fro.patch b/SOURCES/0001-tools-Fix-potential-buffer-overflow-when-reading-fro.patch new file mode 100644 index 0000000..1190d09 --- /dev/null +++ b/SOURCES/0001-tools-Fix-potential-buffer-overflow-when-reading-fro.patch @@ -0,0 +1,40 @@ +From 2a7af30793f9aa6e36acdc7c8b908d0965585437 Mon Sep 17 00:00:00 2001 +From: Jason Gerecke +Date: Thu, 10 Oct 2019 12:13:39 -0700 +Subject: [PATCH] tools: Fix potential buffer overflow when reading from serial + tablet + +The read_data() function has a "min_len" number of bytes to read +to ensure that a complete data structure is read, regardless of garbage +that may be on the line. When garbage is present, however, it can +potentially overflow the buffer. + +The function already has code to memmove the good data over garbage and +perform re-reads until "min_len" bytes of good data are available. All +we need to do to avoid the buffer overflow is ensure that the maximum +number of bytes we read() in one call is no more than the number of +bytes free at the end of the buffer. + +Ref: https://github.com/linuxwacom/xf86-input-wacom/issues/86 +Fixes: 3546d8ab1b ("tools: add isdv4-serial-debugger test program") +Signed-off-by: Jason Gerecke +--- + tools/tools-shared.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/tools-shared.c b/tools/tools-shared.c +index c55e8ca1..c10d8e86 100644 +--- a/tools/tools-shared.c ++++ b/tools/tools-shared.c +@@ -219,7 +219,7 @@ int read_data(int fd, unsigned char* buffer, int min_len) + TRACE("Reading %d bytes from device.\n", min_len); + redo: + do { +- int l = read(fd, &buffer[len], min_len); ++ int l = read(fd, &buffer[len], min_len - len); + + if (l == -1) { + if (errno != EAGAIN) { +-- +2.23.0 + diff --git a/SOURCES/0001-xsetwacom-error-if-we-re-running-this-under-Wayland.patch b/SOURCES/0001-xsetwacom-error-if-we-re-running-this-under-Wayland.patch deleted file mode 100644 index 31d061c..0000000 --- a/SOURCES/0001-xsetwacom-error-if-we-re-running-this-under-Wayland.patch +++ /dev/null @@ -1,91 +0,0 @@ -From ba21208fadd9588ef61a6165480ce1092ba7e699 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 10 Dec 2018 11:03:22 +1000 -Subject: [PATCH] xsetwacom: error if we're running this under Wayland - -xsetwacom cannot work under Wayland, even with XWayland because there is no -xf86-input-wacom driver. So let's not continue normally and not find any -devices because that'll be confusing to the user when the tablet is clearly -working. - -Print an error and exit code of 1. - -Signed-off-by: Peter Hutterer ---- - man/xsetwacom.man | 8 ++++++++ - tools/xsetwacom.c | 26 ++++++++++++++++++++++++++ - 2 files changed, 34 insertions(+) - -diff --git a/man/xsetwacom.man b/man/xsetwacom.man -index 1c5e445..9674a6b 100644 ---- a/man/xsetwacom.man -+++ b/man/xsetwacom.man -@@ -289,6 +289,14 @@ will require less distance and be more sensitive. Larger values will - require more distance and be less sensitive. Default: 1300 or 2600 - depending on tablet resolution (corresponds to 13 mm of distance). - -+.SH WAYLAND SUPPORT -+ -+This tool provides access to the device properties implemented in the -+\fBxf86-input-wacom\fR X server input module. It does not work under a -+Wayland compositor as the input module is not active. -+.TP -+See https://github.com/linuxwacom/xf86-input-wacom/wiki/Wayland for details. -+ - - .SH "AUTHORS" - Peter Hutterer -diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c -index 8b66944..cb5b7f0 100644 ---- a/tools/xsetwacom.c -+++ b/tools/xsetwacom.c -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -2795,6 +2796,24 @@ void argsfromstdin(int *argc, char ***argv) - } - #endif /* BUILD_FUZZINTERFACE */ - -+static bool check_for_wayland(Display *dpy) -+{ -+ bool has_xwayland_devices = false; -+ XDeviceInfo *info; -+ int ndevices, i; -+ -+ info = XListInputDevices(dpy, &ndevices); -+ for (i = 0; i < ndevices; i++) { -+ if (strncmp(info[i].name, "xwayland-", 9) == 0) { -+ has_xwayland_devices = true; -+ break; -+ } -+ } -+ XFreeDeviceList(info); -+ -+ return has_xwayland_devices; -+} -+ - int main (int argc, char **argv) - { - int c; -@@ -2880,6 +2899,13 @@ int main (int argc, char **argv) - return -1; - } - -+ if (check_for_wayland(dpy)) { -+ fprintf(stderr, -+ "Wayland devices found but this tool is incompatible with Wayland. See\n" -+ "https://github.com/linuxwacom/xf86-input-wacom/wiki/Wayland\n"); -+ return 1; -+ } -+ - if (!do_list && !do_get && !do_set) - { - if (optind < argc) --- -2.19.2 - diff --git a/SPECS/xorg-x11-drv-wacom.spec b/SPECS/xorg-x11-drv-wacom.spec index de1bfdc..b9721e0 100644 --- a/SPECS/xorg-x11-drv-wacom.spec +++ b/SPECS/xorg-x11-drv-wacom.spec @@ -8,8 +8,8 @@ Summary: Xorg X11 wacom input driver Name: xorg-x11-drv-wacom -Version: 0.36.1 -Release: 5%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Version: 0.38.0 +Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} URL: http://www.x.org License: GPLv2+ Group: User Interface/X Hardware Support @@ -22,8 +22,7 @@ Source2: commitid Source0: https://github.com/linuxwacom/xf86-input-wacom/releases/download/xf86-input-wacom-%{version}/xf86-input-wacom-%{version}.tar.bz2 %endif -# Bug 1657568 - xsetwacom doesn't warn about Wayland -Patch01: 0001-xsetwacom-error-if-we-re-running-this-under-Wayland.patch +Patch01: 0001-tools-Fix-potential-buffer-overflow-when-reading-fro.patch BuildRequires: xorg-x11-server-devel >= 1.10.99.902 BuildRequires: xorg-x11-util-macros >= 1.3.0 @@ -108,6 +107,9 @@ will be available as normal evdev node. %{_unitdir}/wacom-inputattach@.service %changelog +* Mon Nov 04 2019 Peter Hutterer 0.38.0-1 +- wacom 0.38.0 (#1728822) + * Fri Dec 14 2018 Peter Hutterer 0.36.1-5 - Warn when running xsetwacom on Wayland (#1657568)