Commit Graph

5754 Commits

Author SHA1 Message Date
okan
a53fef7b1e Add an argument to the callbacks to pass the xevent context, button or
key press. This allows to remove a few hacks to duplicate functions only
for behaviour changes; now differing behaviours are pushed down to the
callback. Also will allow for previously unavailable actions to be bind-able
down the road.
2016-10-06 14:41:19 +00:00
okan
4e1d180946 Check the ptr bounds in the new client during cycling, since not all
actions do ptrsave, such as restoring client geometry; adapted from a
diff by Vadim Vygonets.
2016-10-06 14:30:05 +00:00
okan
4a70ba0924 More accurate to say 'toggle', rather than 'select', for group[n]/nogroup. 2016-10-05 14:01:23 +00:00
okan
62af7b9761 Add CM-a for 'nogroup' (CM-0 stays for now); update manpage to reflect. 2016-10-05 13:35:17 +00:00
okan
ddbad284c7 Stash wmname into conf. 2016-10-05 13:10:59 +00:00
okan
c42b7d0a28 When removing xrandr regions, ensure clients are within the bounds of
the screen; adapted from an ancient diff from Sviatoslav Chagaev. Things
in this area will likely change, but put this in so it works now and
serves as a reminder.
2016-10-04 20:15:55 +00:00
deraadt
13cbbbd6c0 ignore chown error (for systems which don't install a Xserver) 2016-10-04 19:48:48 +00:00
okan
a7e1d9acfc Calculate client nameqlen in client_setname(), the only place it's
needed/used.
2016-10-04 15:52:32 +00:00
okan
d592dd99f7 Turn CALMWM_NGROUPS define into variable, ngroups. 2016-10-04 15:18:20 +00:00
matthieu
e61292a300 Avoid buffer underflow on empty strings.
If an empty string is received from an x-server, do not underrun the
buffer by accessing "rep.nameLen - 1" unconditionally, which could end
up being -1.

From Tobias Stoeckmann / X.Org security advisory Oct 4, 2016
2016-10-04 15:11:05 +00:00
matthieu
1e4e5956d0 Protocol handling issues in libXv
The Xv query functions for adaptors and encodings suffer from out of boundary
accesses if a hostile X server sends a maliciously crafted response.

A previous fix already checks the received length against fixed values but
ignores additional length specifications which are stored inside the received
data.

These lengths are accessed in a for-loop. The easiest way to guarantee a
correct processing is by validating all lengths against the remaining size
left before accessing referenced memory.

This makes the previously applied check obsolete, therefore I removed it.

From Tobias Stoeckmann / X.Org security advisory Oct 4, 2016
2016-10-04 15:09:40 +00:00
matthieu
ce0f69616f Out of boundary access and endless loop in libXtst
A lack of range checks in libXtst allows out of boundary accesses.
The checks have to be done in-place here, because it cannot be done
without in-depth knowledge of the read data.

If XRecordStartOfData, XRecordEndOfData, or XRecordClientDied
without a client sequence have attached data, an endless loop would
occur. The do-while-loop continues until the current index reaches
the end. But in these cases, the current index would not be
incremented, leading to an endless processing.

From Tobias Stoeckmann / X.Org security advisory Oct 4, 2016
2016-10-04 15:08:08 +00:00
matthieu
26cabdb32f Validate lengths while parsing server data.
Individual lengths inside received server data can overflow
the previously reserved memory.

It is therefore important to validate every single length
field to not overflow the previously agreed sum of all invidual
length fields.

From Tobias Stoeckmann / X.Org security advisory Oct 4, 2016
2016-10-04 15:05:13 +00:00
matthieu
9f957a9f79 Avoid OOB write in XRenderQueryFilters
The memory for filter names is reserved right after receiving the reply.
After that, filters are iterated and each individual filter name is
stored in that reserved memory.

The individual name lengths are not checked for validity, which means
that a malicious server can reserve less memory than it will write to
during each iteration.

From Tobias Stoeckmann / X.Org security advisory Oct 4, 2016
2016-10-04 15:03:48 +00:00
matthieu
aebb61b811 Avoid out of boundary accesses on illegal responses
The responses of the connected X server have to be properly checked
to avoid out of boundary accesses that could otherwise be triggered
by a malicious server.

From Tobias Stoeckmann / X.Org security advisory Oct 4, 2016
2016-10-04 15:02:31 +00:00
matthieu
342b1570d2 Properly validate server responses
By validating length fields from server responses, out of boundary
accesses and endless loops can be mitigated.

From Tobias Stoeckmann / X.Org security advisory Oct 4, 2016
2016-10-04 15:01:03 +00:00
matthieu
269364ad66 Integer overflow on illegal server response
The 32 bit field "rep.length" is not checked for validity, which allows
an integer overflow on 32 bit systems.

A malicious server could send INT_MAX as length, which gets multiplied
by the size of XRectangle. In that case the client won't read the whole
data from server, getting out of sync.

From Tobias Stoeckmann / X.Org security advisory Oct 4, 2016
2016-10-04 14:59:47 +00:00
matthieu
89e55bbf5a Validation of server responses in XGetImage()
Check if enough bytes were received for specified image type and
geometry. Otherwise GetPixel and other functions could trigger an
out of boundary read later on.
From Tobias Stoeckmann / X.Org security advisory Oct 4, 2016
2016-10-04 14:58:26 +00:00
matthieu
bd2560e2ec The validation of server responses avoids out of boundary accesses.
From Tobias Stoeckmann / Xorg Securiry adrvisory Oct 4, 2016.
2016-10-04 14:56:37 +00:00
okan
cdbe6c3bc9 Start simplifying menu code; and in turn, remove a cursor no longer
needed.
2016-10-03 18:43:49 +00:00
okan
6889482fc7 Defaults are split between defines and conf_init(); normalize these, as
well as give 'sticky' groups its own variable.
2016-10-03 14:42:34 +00:00
okan
dcdbf54e85 For both kb and mouse move, it is possible to grab a client and move it
completely off the screen/region; instead, if the pointer is outside of
the client bounds, warp the pointer to the closest edge before moving.
2016-10-03 13:52:17 +00:00
okan
3881d6ad85 client_ptrwarp should not deal with unhiding or raising clients (non ptr
requests); most callers do this already - deal with the few that do not.
client_ptrwarp becomes a simple wrapper (setpos) but it will be expanded.
2016-10-03 13:41:30 +00:00
matthieu
c542153d63 revert pixman-vmx.c to the version of pixman-0.32.8.
gcc 4.2 is not able to compile the new version.
XXX switch back to 0.34 once macppc switches to clang.
2016-10-03 06:57:44 +00:00
matthieu
1a97432a77 Fix ownership of fonts.dir and font.scale files as well as
fontconfig font caches.
mkfontdir and mkfontscale are now run out of font/alias at the end
of the build or install, like fc-cache.
fc-cache is using its -y (sysroot) flag that works if used correctly.
2016-10-02 20:55:09 +00:00
matthieu
400881a786 Fix ownership of /etc/fonts/conf.d/42-luxi-mono.conf link 2016-10-02 20:51:20 +00:00
matthieu
71be0511eb Fix installation of libXaw.so.15.0 link. 2016-10-02 19:11:16 +00:00
matthieu
8587a95e4f fix the ownership of the link /usr/X11R6/bin/X -> Xorg 2016-10-02 17:21:29 +00:00
matthieu
321b9b9f5f regen 2016-10-02 17:17:04 +00:00
matthieu
b0eedeca6e Handle the libXaw.so.xx.y symlink in afterinstall: in Makefile.bsd-wrapper
No more diffs with upstreams in autoconf files;
owneship of links for non-root/noperm installs is handled too.
2016-10-02 17:16:31 +00:00
matthieu
f086547c98 regen 2016-10-02 10:30:28 +00:00
matthieu
d9e10c2579 Remove local patch for platforms without shared libs 2016-10-02 10:30:06 +00:00
matthieu
99edbe0a23 Reduce diffs with upstreams 2016-10-02 10:00:36 +00:00
matthieu
836cc0eece regen 2016-10-02 09:36:26 +00:00
matthieu
245607701d Typo font.dir -> fonts.dir 2016-10-02 09:34:35 +00:00
tb
0ba6be2810 Explicitly set owner and group of the mouse(4) manpage symlink.
Needed for noperm release.

ok matthieu
2016-10-02 09:30:18 +00:00
tb
da27f01d12 Set owner and group of the XScreenSaver(3) manpage symlink.
Needed for noperm release.

ok matthieu
2016-10-02 09:28:53 +00:00
tb
d026ee755f Set owner and group of the mandoc.db, the xetcsum file for sysmerge
and of the app-defaults symlink.  Needed for noperm release.

ok matthieu
2016-10-02 09:25:23 +00:00
tb
2b5da2cd8d Explicitly set owner and group of the symlinks in etc/fonts/conf.d and
of the fonts.dir and fonts.scale indexes. Needed for noperm release.

ok matthieu
2016-10-02 09:23:26 +00:00
tb
c3666a91f0 chown -h symbolic links in conf.d. Needed for noperm release.
There are a few remaining symlinks that will be fixed later.

ok matthieu
2016-10-02 09:19:28 +00:00
tb
7112b55027 Explicitly set owners of the xorg.db locate(1) database and of the
xetc.tgz set for sysmerge.  Needed for noperm release.

ok matthieu
2016-10-02 09:16:22 +00:00
tb
c5b53bf9ac Explicitly set the owner of the shell scripts in etc/X11/xdm and of the
chooser and xdm binaries to BINOWN:BINGRP.  Needed for noperm release.

ok mathieu
2016-10-02 09:12:46 +00:00
matthieu
cb8938ecc4 Update to pixman 0.34.0. 2016-10-01 10:17:43 +00:00
okan
679d00b4fa remove unused proto 2016-09-30 21:44:51 +00:00
okan
5a1d71fd93 Set the initial ptr position during client init, instead of waiting
until (maybe) a ptrwarp call. Likewise, explicitly ensure an inbounds ptr
position (same as initial) when saving.
2016-09-30 20:55:54 +00:00
okan
54cccf114b Use instinsic X11 functions for key/btn/ptr grab/ungrab/regrab requests;
the one line wrappers provided no value and limited altering calls where
needed; additionally, most of them had but one caller.
2016-09-30 18:28:06 +00:00
okan
e49083a483 Replace mousefunc_sweep_draw() with a generic menu_windraw() using va
lists; use it appropriately for both window dimension and position in
the respective mousefunc calls.

ok bryent@
2016-09-30 15:12:19 +00:00
okan
e30959f62f Switch to XWindowEvent() pulling out events that match the mask *and*
window.
2016-09-30 15:05:02 +00:00
okan
035ba40ddc no need to unmap menu window again 2016-09-29 00:30:40 +00:00
okan
1b369f6063 Mechanical change: move screen menu bits to their own struct. 2016-09-29 00:21:55 +00:00