XLibre Xserver
Go to file
Alan Coopersmith 8fa1ac2b50 dix: limit checks to MAX_VALUATORS when generating Xi events
Previously, it was looping through sizeof(ev->valuators.mask) * 8
valuators, where valuators.mask is defined as an array of
(MAX_VALUATORS + 7) / 8 entries.  Since MAX_VALUATORS is defined as 36,
this made it actually loop through 40 entries.  The last 4 bits in this
array should never be set, so we should never access memory outside the
bounds of the arrays defined to be exactly MAX_VALUATORS in length, but
we can make the static analyzer happier and not waste time checking bits
that should never be set.

Found by Oracle Parfait 13.3 static analyzer:

   Read outside array bounds [read-outside-array-bounds]:
      In array dereference of ev->valuators.data[i] with index i
      Array size is 36 elements (of 8 bytes each), index >= 0 and index <= 39
        at line 741 of dix/eventconvert.c in function 'eventToDeviceEvent'.

   Read outside array bounds [read-outside-array-bounds]:
      In array dereference of ev->valuators.data[i] with index i
      Array size is 36 elements (of 8 bytes each), index >= 0 and index <= 39
        at line 808 of dix/eventconvert.c in function 'eventToRawEvent'.

   Read outside array bounds [read-outside-array-bounds]:
      In array dereference of ev->valuators.data_raw[i] with index i
      Array size is 36 elements (of 8 bytes each), index >= 0 and index <= 39
        at line 809 of dix/eventconvert.c in function 'eventToRawEvent'.

Fixes: b2ba77bac ("dix: add EventToXI2 and GetXI2Type.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1730>
2024-10-31 16:24:41 +01:00
.gitlab-ci (!1675) ci: enable xv and xvmc 2024-09-18 17:23:09 +02:00
Xext (!1695) dix: unexport Ones() 2024-09-19 15:03:01 +02:00
Xi Xi: avoid NULL pointer dereference if GetXTestDevice returns NULL 2024-10-31 16:24:41 +01:00
composite (!1695) dix: unexport Ones() 2024-09-19 15:03:01 +02:00
config (!1688) os: unexport internal logging functions 2024-09-18 17:23:12 +02:00
damageext (submit/rename-panoramix-sym) rename old symbol PANORAMIX to XINERAMA 2024-09-18 17:23:12 +02:00
dbe (submit/rename-panoramix-sym) rename old symbol PANORAMIX to XINERAMA 2024-09-18 17:23:12 +02:00
dix dix: limit checks to MAX_VALUATORS when generating Xi events 2024-10-31 16:24:41 +01:00
doc dix: move colormap flags into colormap_priv.h and rename them 2024-09-01 22:06:50 +00:00
dri3 (submit/rename-panoramix-sym) rename old symbol PANORAMIX to XINERAMA 2024-09-18 17:23:12 +02:00
exa (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-09-18 17:23:11 +02:00
fb (!1695) dix: unexport Ones() 2024-09-19 15:03:01 +02:00
glamor (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-09-18 17:23:11 +02:00
glx (!1691) os: log: replace LogMessageVerbSigSafe() by LogMessageVerb() 2024-09-19 15:03:01 +02:00
hw xfree86: avoid memory leak on realloc failure 2024-10-31 16:24:41 +01:00
include (!1700) meson: drop defining BIGREQS 2024-09-19 15:03:01 +02:00
man Xserver.man: Note that -byteswappedclients is the default in this release 2024-03-23 10:27:03 -07:00
mi mi: miInitVisuals: clean up variable declarations 2024-09-19 15:04:37 +02:00
miext (submit/xnest-gcrec) fix name clash on 'GC' between Xlib and Xserver 2024-09-18 17:23:12 +02:00
os os: Fix NULL pointer dereference 2024-10-31 15:44:45 +01:00
present (submit/rename-panoramix-sym) rename old symbol PANORAMIX to XINERAMA 2024-09-18 17:23:12 +02:00
pseudoramiX (!1690) pseudoramiX: fix warning from unused REQUEST() macro calls 2024-09-19 15:03:01 +02:00
randr (submit/rename-panoramix-sym) rename old symbol PANORAMIX to XINERAMA 2024-09-18 17:23:12 +02:00
record WIP: reorder includes 2024-09-19 15:03:01 +02:00
render render: avoid NULL pointer dereference if PictureFindVisual returns NULL 2024-10-31 16:24:41 +01:00
test (!1691) os: log: replace LogMessageVerbSigSafe() by LogMessageVerb() 2024-09-19 15:03:01 +02:00
xfixes (submit/rename-panoramix-sym) rename old symbol PANORAMIX to XINERAMA 2024-09-18 17:23:12 +02:00
xkb (!1695) dix: unexport Ones() 2024-09-19 15:03:01 +02:00
.appveyor.yml appveyor: Add libxcvt build dep 2021-11-04 13:03:25 +00:00
.dir-locals.el .dir-locals.el: Add missing final newline 2019-10-01 17:05:28 +00:00
.gitignore Clean up the .gitignore file 2024-01-12 00:50:24 +00:00
.gitlab-ci.yml meson.build: change project name to xnest 2024-09-19 15:17:54 +02:00
.mailmap Add a .mailmap file to canonicalize author names and emails 2023-03-15 18:10:51 +00:00
.travis.yml travis: Add OSX meson build to matrix 2019-05-02 15:42:58 +00:00
COPYING modesetting: Merge modesetting's COPYING into the xserver's. 2014-09-15 12:46:02 -07:00
README.md Fix spelling/wording issues 2020-07-05 13:07:33 -07:00
meson.build Xnest XCB version 24.2.0.0 2024-09-19 15:23:56 +02:00
meson_options.txt meson_options: disable all DDX'es but Xnest 2024-09-19 15:17:48 +02:00
xorg-server.m4 xorg-server.m4: just all cflags instead of just sdkdir 2018-09-20 20:12:24 +01:00
xorg-server.pc.in xfree86: link modules against Xorg symbols on Cygwin 2012-04-05 21:57:07 -05:00
xserver.ent.in doc: relocate xserver.ent in the package root directory 2011-05-14 11:22:26 -07:00

X Server

The X server accepts requests from client applications to create windows, which are (normally rectangular) "virtual screens" that the client program can draw into.

Windows are then composed on the actual screen by the X server (or by a separate composite manager) as directed by the window manager, which usually communicates with the user via graphical controls such as buttons and draggable titlebars and borders.

For a comprehensive overview of X Server and X Window System, consult the following article: https://en.wikipedia.org/wiki/X_server

All questions regarding this software should be directed at the Xorg mailing list:

https://lists.freedesktop.org/mailman/listinfo/xorg

The primary development code repository can be found at:

https://gitlab.freedesktop.org/xorg/xserver

For patch submission instructions, see:

https://www.x.org/wiki/Development/Documentation/SubmittingPatches

As with other projects hosted on freedesktop.org, X.Org follows its Code of Conduct, based on the Contributor Covenant. Please conduct yourself in a respectful and civilized manner when using the above mailing lists, bug trackers, etc:

https://www.freedesktop.org/wiki/CodeOfConduct