Commit Graph

16 Commits

Author SHA1 Message Date
Adam Jackson dc7ceda90f dispatch: Mark swapped dispatch as _X_COLD
This touches everything that ends up in the Xorg binary; the big missing
part is GLX since that's all generated code. Cuts about 14k from the
binary on amd64.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-03-01 10:16:20 -05:00
Alan Coopersmith 73c63afb93 Xi: unvalidated lengths in Xinput extension [CVE-2014-8095]
Multiple functions in the Xinput extension handling of requests from
clients failed to check that the length of the request sent by the
client was large enough to perform all the required operations and
thus could read or write to memory outside the bounds of the request
buffer.

This commit includes the creation of a new REQUEST_AT_LEAST_EXTRA_SIZE
macro in include/dix.h for the common case of needing to ensure a
request is large enough to include both the request itself and a
minimum amount of extra data following the request header.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-08 18:09:48 -08:00
Peter Hutterer 94d4e29aed Xi: allow for XIAllowEvent requests larger than XI < 2.2 size (#68554)
XIAllowEvents changed length in XI 2.2 (for the touchid). A bug in libXi
causes libXi to always use the new request length if the server supports
2.2, regardless of the client's XIQueryVersion request.

The server takes the client's XIQueryVersion request into account though,
resulting in a BadLength error if a 2.[0,1] client calls XIAllowEvents on a
XI 2.2+ server.

Can't fix this in libXi, so work around this in the server.

X.Org Bug 68554 <http://bugs.freedesktop.org/show_bug.cgi?id=68554>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-08-30 14:26:55 +10:00
Keith Packard 9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Peter Hutterer 7674d00b04 Xi: handle new XIAllowEvents request in inputproto 2.1.99.6
grab_window and touchid were removed from the struct for ABI compatibility
reasons, we need to pull in the new, XI 2.2-specific struct.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-02-11 15:26:05 +13:00
Chase Douglas 656ab879f2 Check for proper window ID when processing touch allow requests
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-08 18:04:15 +10:00
Chase Douglas 9a260e9af8 Move AllowTouch to dix/touch.c, and rename to TouchAcceptReject
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-08 18:04:15 +10:00
Peter Hutterer bb0af002dc Xi: handle grab accept/reject requests
Consists mostly of generating an ownership event and processing it.

Co-authored-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-21 12:38:36 +10:00
Matt Turner 2c7c520cfe Use internal temp variable for swap macros
Also, fix whitespace, mainly around
	swaps(&rep.sequenceNumber)

Reviewed-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-21 17:12:04 -04:00
Peter Hutterer 17f9723f48 input: bump to ints for deviceids - XI2 requires 16-bit deviceids.
Note: ABI break, but ABI_XINPUT_VERSION has NOT been bumped. Recompile input
drivers.

Revert "Xi: return BadImplementation for deviceids 256 and above"
This reverts commit 2b459f44f3.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-18 14:40:54 +10:00
Peter Hutterer 2b459f44f3 Xi: return BadImplementation for deviceids 256 and above
The protocol allows for 16 bit device ids, but the implementation doesn't
yet. We need to break the input ABI once more to shift the DeviceIntRec's
CARD8 to a CARD16, along with some changes in the privates.

Once that is done, revert this patch.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-05 16:09:09 +10:00
Peter Hutterer b12d302df8 Input: rename DeviceIntRec->isMaster to ->type.
isMaster is not enough as long as we differ between master pointers and
keyboard. With flexible device classes, the usual checks for whether a
master device is a pointer (currently check for ->button, ->valuators or
->key) do not work as an SD may post an event through a master and mess this
check up.

Example, a device with valuators but no buttons would remove the button
class from the VCP and thus result in the
IsPointerDevice(inputInfo.pointer) == FALSE.

This will become worse in the future when new device classes are introduced
that aren't provided in the current system (e.g. a switch class).

This patch replaces isMaster with "type", one of SLAVE, MASTER_POINTER and
MASTER_KEYBOARD. All checks for dev->isMaster are replaced with an
IsMaster(dev).
2009-05-22 15:44:50 +10:00
Peter Hutterer bae070914f input: update to inputproto 1.9.99.8 XI2 defines.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08 14:33:44 +10:00
Peter Hutterer c3c64978c4 Xi: fix a couple of wrong dixLookupDevice permission tags.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08 14:33:23 +10:00
Peter Hutterer 95628b797e Xi: use the XI2 defines for AsyncPair, SyncDevice, etc, not the XI ones.
And don't allow some values on SDs either.
2009-04-20 14:07:08 +10:00
Peter Hutterer eeb1e4cd25 Xi: add support for XIAllowEvents.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:28:11 +10:00