Commit Graph

16334 Commits

Author SHA1 Message Date
Olivier Fourdan
da8de2a7f6 xwayland: Add optional xdg-output support
The xdg-output protocol aims at describing outputs in way which is
more in line with the concept of an output on desktop oriented systems.

For now it just features the position and logical size which describe
the output position and size in the global compositor space.

This is however much useful for Xwayland to advertise the output size
and position to X11 clients which need this to configure their surfaces
in the global compositor space as the compositor may apply a different
scale from what is advertised by the output scaling property (to achieve
fractional scaling, for example).

This was added in wayland-protocols 1.10.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2018-01-24 11:34:59 -05:00
Michel Dänzer
75408f53d4 xf86XvMCScreenInit: Clear pScreenPriv->dixinfo when freeing pAdapt
Fixes double-free later in xf86XvMCCloseScreen, which would generally
cause fireworks.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2018-01-24 11:21:08 -05:00
Michel Dänzer
76732f498f Revert "present: Only send PresentCompleteNotify events to the presenting client"
This reverts commit 5c00e69363.

It broke the Gallium nine state tracker, which makes PresentPixmap
requests on one display connection and processes the corresponding
events on another one.

The issue that motivated this change is prevented on the client side by
https://cgit.freedesktop.org/mesa/mesa/commit/?id=7b0e8264dd21ae05521d08d41fecd84139401fef

Bugzilla: https://bugs.freedesktop.org/104678
2018-01-24 11:40:50 +01:00
Adam Jackson
f704620e5d glx: Move provider setup interface to glx_extinit.h
Keeps us from needing to add glx/ to the include path everywhere, since
we can't add it to the dix include path because the header file names
conflict with glxproxy.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2018-01-22 17:29:45 -05:00
Adam Jackson
c2b2f06aa0 miinitext: General cleanup (v2)
This really just wants to be the list of disable booleans and
initialization functions, and nothing else. Stop including the protocol
headers from extinit.h, remove a stray mention of xgl, and move an
XInput declaration to a better place.

v2: A bunch of drivers assume they'll get the DPMS tokens implicitly,
so add it to globals.h.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2018-01-22 17:28:12 -05:00
Keith Packard
4d5aab66c0 xfree86: Disable cursor whenever turning off CRTC during modeset
This makes sure the CRTC's cursor is hidden before we hand the CRTC
over to some other application.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-01-22 17:22:21 -05:00
Keith Packard
29f79bedf2 randr: Declare incoming property values const
RRChangeOutputProperty and RRConfigureOutputProperty should not modify
their parameters, and callers may want to pass pointers to fixed data,
so declare the value pointers as const in both cases.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2018-01-22 17:22:21 -05:00
Keith Packard
a12485ed84 xf86-video-modesetting: Update property values at detect and uevent time
We were updating the link-status property when a uevent came in, but
we also want to update the non-desktop property, and potentially
others as well. We also want to check at detect time in case we don't
get a hotplug event.

This patch updates every property provided by the kernel, sending
changes to DIX so it can track things as well.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2018-01-22 17:22:21 -05:00
Keith Packard
44d5f2eb8a xf86-video-modesetting: Support new vblank kernel API [v2]
drmCrtcGetSequence returns the current vblank sequence and time.

drmCrtcQueueSequence queues an event for delivery at a specified
vblank sequence.

Use these (when available) in preference to drmWaitVBlank.

v2: Remove FIRST_PIXEL_OUT_FLAG. This has been removed from the kernel
    API.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2018-01-22 17:22:21 -05:00
Adam Jackson
627dfc2f83 automake: Fix 'make distcheck'
Add some missing meson.builds to the distball, and update the meson
build test to work when the distcheck srcdir != builddir. The test build
directory will be $(srcdir)/_distcheck_build so srcdir will need to be
writable; this shouldn't be too much to ask I hope.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-01-22 17:19:03 -05:00
Jon Turney
2d29daf4c6 meson.build: Fix hw/xwin build when dependencies are installed in a non-default location
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2018-01-22 13:50:20 -05:00
Jon Turney
514d2c243e meson: Use and prefer tirpc for Secure RPC authentication
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-01-22 13:15:10 -05:00
Pekka Paalanen
f72587ecc7 xwayland: reduce over-damage
If an X11 app draws a little here, some there, and a tiny bit in the
opposite corner, using RegionExtents for the damage to be sent to the
Wayland compositor will cause massive over-damaging.

However, we cannot blindly send an arbitrary number of damage
rectangles, because there is a risk of overflowing the Wayland
connection. If that happens, it triggers an abort in libwayland-client.

Try to be more accurate with the damage by sending up to 256 rectangles
per window, and fall back to extents otherwise. The number is completely
arbitrary.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-01-22 12:27:28 -05:00
Martin Wilck
a5e9bcad7a xfree86: add default modes for 16:9 and 16:10
Improve the user experience for users with wide screens by adding standard
16:9 and 16:10 modes to extramodes, as suggested previously
(https://lists.x.org/archives/xorg-devel/2016-February/048866.html).
Tested successfully on my laptop. Feedback welcome.

See also https://bugs.freedesktop.org/show_bug.cgi?id=37858.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-01-18 14:16:35 -05:00
David Weinehall
528cf6fcee sync: Fix diffgreater comparison
xsync: Fix diffgreater comparison

While transitioning from CARD64 to int64,
the GreaterThan call was mistakenly transformed into ">=".
Part of this was fixed already in
commit 8060196a3e

This patch fixes the remaining issue.

Signed-off-by: David Weinehall <david.weinehall@linux.intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-01-18 14:08:46 -05:00
Keith Packard
32b4262721 modesetting: Use seq instead of msc in ms_queue_vblank failure path
When the call to queue a vblank event fails, we need to clean up by
removing the user-space queue entry. That is indexed by the local
sequence number, not by the kernel vblank count. The call in this
case was just passing the wrong value.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2018-01-16 16:10:27 -05:00
Adam Jackson
15d91df474 x86emu: Teach the debug code about varargs
With -Wformat-nonliteral and a debug build you'd get yelled at here:

../hw/xfree86/x86emu/x86emu/debug.h:188:9: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]

To fix this, rewrite the printf code to actually use varargs and the
appropriate format attribute. All callers of DECODE_PRINTF() pass a
string with no % specifiers, so we pass that as the argument to
printf("%s"). For DECODE_PRINTF2() we just pass the args through.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2018-01-16 16:08:38 -05:00
Adam Jackson
1274015186 build: Remove <*dbm.h> checks
Formerly used by the rgb database code, which hasn't been a thing in
over a decade.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-01-16 16:08:28 -05:00
Adam Jackson
c3fbe2bbff meson: Enable SUN-DES-1 auth code
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2018-01-16 16:04:39 -05:00
Adam Jackson
4d82a150b2 animcur: Handle allocation failure for the animation timer
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
2018-01-09 14:39:07 -05:00
Adam Jackson
de60245e05 animcur: Fix transitions between animated cursors
We weren't cancelling the old timer when changing cursors, making things
go all crashy. Logically we could always cancel the timer first, but
then we'd have to call TimerSet to re-arm ourselves, and GetTimeInMillis
is potentially expensive.

Reported-by: https://devtalk.nvidia.com/default/topic/1028172/linux/titan-v-ubuntu-16-04lts-and-387-34-driver-crashes-badly/post/5230967/#5230967
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
2018-01-09 14:38:45 -05:00
Adam Jackson
a09fbe6c82 glx: Stop printing messages about what GLX extensions we enable
glxinfo already exists, use it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-01-08 16:25:11 -05:00
Adam Jackson
4ed8d5c946 ddc: Port some paranoia from drm_edid.c
Avoid adding a "standard" mode timing if we've already got a matching
detailed timing. To help with that, parse CEA blocks for detailed
timings before doing standard or established timings.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-01-08 16:24:59 -05:00
Adam Jackson
652913cd94 os: Fix a type error in the IPv6 XDMCP code
Building with strict-aliasing rightly chirps here:

../os/xdmcp.c: In function ‘XdmcpRegisterConnection’:
../os/xdmcp.c:489:31: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
                     &((struct sockaddr_in6 *) &address)->sin6_addr.s6_addr[12];
                               ^~~~~~~~~~~~

We have "const char *address", so &address here is a char ** (i.e., it
points to the slot on the stack containing the pointer to the character
array passed in as an argument). Casting that to a struct sockaddr_in6 *
is wrong, because it means that area of the stack will be reinterpreted
as a struct sockaddr_in6.

Instead, cast address, not &address.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-01-08 16:19:42 -05:00
Jon Turney
da4ffb2f6a meson: Correct the option for disabled int10 from 'disabled' to 'false'
Fix meson_option.txt to align with the check of the int10 option against
'disabled', not 'false' in hw/xfree/meson.build, to see if it shouldn't be
built at all.

This keeps everything consistent that 'false' always turns things off.

Not noticed before as options weren't validated against choices until meson
0.43

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2018-01-08 16:08:13 -05:00
Helmut Grohne
c601c8faf5 build: guess availability of monotonic clock for cross compilation
When cross compiling, the value of MONOTONIC_CLOCK would be "cross
compiling", because AC_RUN_IFELSE doesn't work. However when enabling
wayland, a monotonic clock is required and configure aborts.

We change detection of CLOCK_MONOTONIC to degrade it gracefully from a
run check to a declaration check in case of cross compilation based on
the assumption that most systems will have a monotonic clock and those
that don't won't be able to run Xwayland anyway. The trade-off
essentially is either "always fail cross compilation" or "produce an
unusable Xwayland for unusual platform" and this commit switches to the
latter.

Signed-off-by: Helmut Grohne <helmut@subdivi.de>
Bug-Debian: https://bugs.debian.org/882531
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-01-08 14:59:30 -05:00
Peter Hutterer
a309323328 config: fix NULL value detection for ID_INPUT being unset
Erroneous condition caused us to keep going with all devices that didn't have
ID_INPUT set.

Fixes: 5aad81445c
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104382
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-01-08 14:48:04 -05:00
Corentin Rossignon
dbfbe58b94 glamor: Specify GLSL version for xv shader
SAMPLE is a GLSL keyword in newer OpenGL version.
This fix issue with gnome-shell and playing video using xv

Signed-off-by: Corentin Rossignon <corentin.rossignon@gmail.com>
Bugzilla: https://bugs.freedesktop.org/104405
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-01-08 14:46:20 -05:00
Adam Jackson
ab54bc295c animcur: Stop tracking the last display time in the SpriteInfoRec
Reviewed-by: Robert Morell <rmorell@nvidia.com>
Tested-by: Robert Morell <rmorell@nvidia.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-01-08 14:36:49 -05:00
Adam Jackson
094a63d56f animcur: Run the timer from the device, not the screen
This is very slightly more efficient since the callback now doesn't need
to walk every input device, instead we know exactly which device's
cursor is being updated. AnimCurTimerNotify() gets outdented nicely as a
result. A more important side effect is that we can stop using the
TimerAbsolute mode and just pass in the relative delay.

In AnimCurSetCursorPosition, we no longer need to rearm the timer with
the new screen; it is enough to update the device's state. In
AnimCurDisplayCursor we need to notice when we're switching from
animated cursor to regular and cancel the existing timer.

Reviewed-by: Robert Morell <rmorell@nvidia.com>
Tested-by: Robert Morell <rmorell@nvidia.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-01-08 14:36:49 -05:00
Adam Jackson
cc3241a712 animcur: Return the next interval directly from the timer callback
If the return value is non-zero here, DoTimer() will automatically rearm
the timer for the new (relative) delay. 'soonest' is in absolute time,
so subtract off 'now' and return that.

Reviewed-by: Robert Morell <rmorell@nvidia.com>
Tested-by: Robert Morell <rmorell@nvidia.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-01-08 14:36:49 -05:00
Adam Jackson
3abbdb7318 animcur: Use fixed-size screen private
Reviewed-by: Robert Morell <rmorell@nvidia.com>
Tested-by: Robert Morell <rmorell@nvidia.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-01-08 14:36:33 -05:00
Lukáš Krejčí
f615cb62d4 Xorg.wrap: Ensure correct ordering of post-install hook
The install rule of Xorg.wrap is currently a dependency of the
install-data target instead of the install-exec target. The build also
uses install-exec-hook to change the ownership and set the SUID bit on
the Xorg.wrap binary. The problem is that install-exec-hook is only
ordered respective to the install-exec target, the rules of install-data
may or may not have been executed.

If install-exec-hook runs before the Xorg.wrap binary is in place,
a message similar to the following will be present in the build log:

chown: cannot access '/pkgdir/usr/lib/xorg-server/Xorg.wrap': No such file or directory
make[6]: [Makefile:1151: install-exec-hook] Error 1 (ignored)

All that needs to be done is to change the name of the program variable
to contain 'exec' for the install rule to depend on the install-exec
target.

Excerpt from the Automake manual, chapter 12.2 The Two Parts of Install:
"Any variable using a user-defined directory prefix with ‘exec’ in the
name (e.g., myexecbin_PROGRAMS) is installed by install-exec. All other
user-defined prefixes are installed by install-data."

https://bugs.freedesktop.org/show_bug.cgi?id=104419

Signed-off-by: Lukáš Krejčí <lskrejci@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-01-08 09:54:22 +10:00
Olivier Fourdan
170c959785 xwayland: avoid race condition on new keymap
When the Wayland compositor notifies of a new keymap, for the first X11
client using the keyboard, the last slave keyboard used might still not
be set (i.e. “lastSlave” is still NULL).

As a result, the new keymap is not applied, and the first X11 window
will have the wrong keymap set initially.

Apply the new keymap to the master keyboard as long as there's one.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=791383
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-12-19 10:30:42 +10:00
Konstantin Kharlamov
c720495305 modesetting: simplify bailing on calloc fail
The "done" label restores crtc-> {x,y,rotation,mode}, frees output_id.
Doing the calloc() before writing to those values frees us from
necessity to restore them if calloc fails, and allows to merge
"if (mode)" block.

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-12-18 08:52:55 +10:00
Tapani Pälli
c2954b16c8 glx: do not pick sRGB config for 32-bit RGBA visual
This fixes blending issues seen with kwin and gnome-shell when
32bit visual has sRGB capability set.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103699
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103646
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103655
2017-12-14 16:19:14 -05:00
Keith Packard
cf7517675d xfree86: Hold input_lock across SPRITE functions in VGA arbiter
Avoid scrambling the sprite functions wrapper.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101995
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-12-13 12:06:31 -05:00
Jon Turney
3265d0c81f meson: Add dependency on generated code fragments in hw/xwin/glx/
Somehow I'd managed to write this with this dependency missing, so this only
works correctly when the generated files already exist and the correct
automatic dependencies generated, but fails on a clean build.

Including generated files with a .c extension into the sources for a target
causes meson to want to compile them (and it seems to be hard to say "make
the directory containing this generated file available to include").

So, change the extension of included generated C fragments to .ic

Update the autotools build to align.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-12-13 11:32:53 -05:00
Peter Harris
edda951fa5 os: Add epoll-like port implementation for Solaris
x11perf -noop with 200 xlogos connected is slightly faster with ports:

  before           after         Operation
----------   -----------------   --------------------
18400000.0   19200000.0 (1.04)   X protocol NoOperation

Acked-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Harris <pharris@opentext.com>
2017-12-13 11:19:09 -05:00
Peter Harris
83c04ee6ea os: Add epoll-like pollset implementation for AIX
AIX's poll only allows FD_SETSIZE entries in the fd list, which is
insufficient for expanded MaxClients.

As a bonus, x11perf -noop with ~250 xlogos connected is slightly faster
with pollset:

 before          after         Operation
---------   ----------------   --------------------
5750000.0   5990000.0 (1.04)   X protocol NoOperation

Signed-off-by: Peter Harris <pharris@opentext.com>
Acked-by: Keith Packard <keithp@keithp.com>
2017-12-13 11:18:07 -05:00
Adam Jackson
bed2830099 kdrive: remove KdSignalWrapper etc.
This no longer does anything useful.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-12-13 11:11:47 -05:00
Adam Jackson
4353d83f60 xfree86: remove xf86CaughtSignal etc.
This no longer does anything useful.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-12-13 11:11:44 -05:00
Adam Jackson
9c72887939 os: Make OsSignalHandler ask for core dumps for signo != SIGQUIT
SIGQUIT is a normal termination request, but any other signal we handle
here wants a core. This has the effect of making FatalError's call to
AbortServer trigger the

    if (CoreDump)
        OsAbort();

path. This will allow us to remove some DDX code that has the same net
effect.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-12-13 11:11:42 -05:00
Adam Jackson
0a255dceb7 xfree86: Remove xf86InterceptSignals
The only consumer of this is the Linux vm86 backend for int10 (which you
should not use), and there all it serves to do is make signals generated
by the vm86 task non-fatal. In practice this error appears never to
happen, and marching ahead with root privileges after arbitrary code has
raised a signal seems like a poor plan.

Remove the usage in the vm86 code, making this error fatal.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-12-13 11:11:38 -05:00
Adam Jackson
722c8035dc xfree86: Remove xf86InterceptSigIll
This was added in ~2004 for the sis driver, to detect whether it could
use SSE for memcpy. Charmingly, the code to check whether that feature
exists in the server is:

    #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(6,8,99,13,0)
    #define SISCHECKOSSSE           /* Automatic check OS for SSE; requires SigIll facility */
    #endif

Which means it has never worked in any modular server release.

A less gross way to do this is to check for SSE support with getauxval()
or /proc/cpuinfo or similar. Since no driver is using the existing
intercept mechanism, drop it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-12-13 11:11:23 -05:00
Olivier Fourdan
fe46cbea0f xwayland: Give up “cleanly“ on Wayland socket errors
Xwayland is a pretty standard Wayland client, we want to be able to
capture core dumps on crashes.

Yet using "-core" causes any FatalError() to generate a core dump,
meaning that we would get a core file for all Wayland server crashes,
which would generate a lot of false positives.

Instead of using FatalError() on Wayland socket errors, give up cleanly
to avoid dumping core files when "-core" is used.

See also: https://bugzilla.gnome.org/show_bug.cgi?id=790502
     and: https://bugzilla.gnome.org/show_bug.cgi?id=789086

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2017-12-13 10:56:10 -05:00
Tomasz Śniatowski
6883ae43eb os: Fix strtok/free crash in ComputeLocalClient
Don't reuse cmd for strtok output to ensure the proper pointer is
freed afterwards.

The code incorrectly assumed the pointer returned by strtok(cmd, ":")
would always point to cmd. However, strtok(str, sep) != str if str
begins with sep. This caused an invalid-free crash when running
a program under X with a name beginning with a colon.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=104123
Signed-off-by: Tomasz Śniatowski <kailoran@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-12-13 09:54:14 -05:00
Adam Jackson
aa6651f83c xfixes: Remove the CursorCurrent array
We're not wrapping all the ways a cursor can be destroyed, so this array
ends up with stale data. Rather than try harder to wrap more code paths,
just look up the cursor when we need it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-12-08 11:36:24 -05:00
Adam Jackson
3db7707df3 test: Fix build dependency for bigreq test
libxcb-xinput isn't a thing in whichever Ubuntu it is that Travis is
using. The test is already optional, make it more so.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-12-08 11:36:24 -05:00
Olivier Fourdan
9f7a9be13d dix: avoid deferencing NULL PtrCtrl
PtrCtrl really makes sense for relative pointing device only, absolute
devices such as touch devices do not have any PtrCtrl set.

In some cases, if the client issues a XGetPointerControl() immediatlely
after a ChangeMasterDeviceClasses() copied the touch device to the VCP,
a NULL pointer dereference will occur leading to a crash of Xwayland.

Check whether the PtrCtrl is not NULL in ProcGetPointerControl() and
return the default control values otherwise, to avoid the NULL pointer
dereference.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1519533
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2017-12-06 11:59:28 -05:00