Commit Graph

433 Commits

Author SHA1 Message Date
Eamon Walsh
e40cc5305b xselinux: Don't throw BadAccess if DixUnknownAccess is passed in to a hook.
The avc will still appear, however, so that the callsite can be fixed.
2008-02-27 22:48:28 -05:00
Eamon Walsh
3f0681fb0b xselinux: Stub out selection protocol requests. 2008-02-26 23:14:29 -05:00
Eamon Walsh
4632ea2258 xselinux: Rip out the selection code in advance of polyinstantiation support.
This resolves an issue where BadWindow errors were being thrown.
2008-02-26 22:00:52 -05:00
Eamon Walsh
c8e979b3b8 security: Register resource names in the server-side name registry. 2008-02-26 21:36:46 -05:00
Adam Jackson
ee21aba6be Fix Xinerama's consolidated visual handling.
Formerly the code claimed it could only handle up to 256 visuals, which
was true.  Also true, but not explicitly stated, was that it could only
handle visuals with VID < 256.  If you have enough screens, and subsystems
that add lots of visuals, you can easily run off the end.  (Made worse
because we allocate visual IDs from the same pool as XIDs.)  If your app
then chooses a visual > 256, then the Xinerama code would throw BadMatch
on CreateColormap and your app wouldn't start.

With this change, PanoramiXVisualTable is gone.  Other subsystems that
were using it as a translation table between each screen's visuals now
use a PanoramiXTranslateVisual() helper.
2008-02-22 15:19:54 -05:00
Eamon Walsh
f343265a28 XACE: Make the default window background state configurable per-window.
To recap: the original XC-SECURITY extension disallowed background "None" if
the window was untrusted.  XACE 1.0 preserved this check as a hook function.
XACE pre-2.0 removed the hook and first abolished background "None entirely,
then restored it as a global on/off switch in response to Bug #13683.
Now it's back to being per-window, via a flag instead of a hook function.
2008-02-20 15:59:40 -05:00
Eamon Walsh
4573cb2ce4 security: Revise set of permissions granted to untrusted clients.
Bug #14480: untrusted access broken on 7.3.
2008-02-13 20:20:49 -05:00
Eamon Walsh
e99aadbc26 xselinux: Add use to permission map for devices. 2008-02-13 20:20:49 -05:00
Adam Jackson
f3b3b37ec6 Use strerror instead of errno values in user strings. 2008-02-14 07:52:02 +11:00
Adam Jackson
62cfe88638 Redact all mention of PanoramiX from user strings. 2008-02-14 07:11:14 +11:00
Eamon Walsh
0d492b2166 XACE: Move the selection access hook to its own function. 2008-02-12 19:59:10 -05:00
Eamon Walsh
31934132a4 xselinux: Use the device name in debugging output. 2008-02-07 16:32:06 -05:00
Eamon Walsh
6dcb7d732b xselinux: Split devPrivate state into subject and object records. 2008-02-07 16:00:52 -05:00
Eamon Walsh
2259b144f0 xselinux: Add getattr and setattr to the permission map for properties. 2008-02-07 14:35:02 -05:00
Eamon Walsh
5c30327275 XACE: Push the dix "structure" includes down to the security modules. 2008-02-05 21:06:05 -05:00
Eamon Walsh
bb1a577a68 XACE: Move the property access hook to its own function. 2008-02-05 20:07:08 -05:00
Peter Hutterer
0ac1755977 Merge branch 'master' into mpx
Conflicts:

	Xext/sampleEVI.c
2008-01-26 13:55:07 +10:30
Eamon Walsh
e915a26397 xselinux: Move the extension to extmod instead of being built-in. 2008-01-25 19:22:19 -05:00
Eamon Walsh
f6a78ee143 XACE: Remove the extension code entirely, XACE is completely static now. 2008-01-25 18:04:10 -05:00
Eamon Walsh
7724c30a75 XACE: Stop using fake requestVectors in favor of a simple hook call. 2008-01-25 17:28:17 -05:00
Eamon Walsh
f82329b081 XACE: Don't need to actually register a protocol extension. 2008-01-25 16:20:46 -05:00
Eamon Walsh
46794d0c96 xselinux: Rename SelectionManager to more generic SecurityManager. 2008-01-24 19:49:13 -05:00
Peter Hutterer
379f057646 Xext: add GEDeviceMaskIsSet (GE mask checking per device)
If a mask was set for the NULL device, then we pretend the mask is set for all
devices.
2008-01-25 10:27:26 +10:30
Peter Hutterer
94a6a65ae7 Xext: allow per-device GE masks.
Instead of a single mask per client we allow the storage of a mask per client
per device.
2008-01-25 10:26:41 +10:30
Eamon Walsh
6ffeecabb7 xselinux: Use a privileged bit in the state instead of passing an index
to the permission checking function.
2008-01-24 18:11:49 -05:00
Eamon Walsh
7ba8e97cba xselinux: Implement "get context" protocol requests. 2008-01-24 19:09:58 -05:00
Eamon Walsh
f0bf9a5231 xselinux: Whitespace fixups. 2008-01-24 19:02:35 -05:00
Matthias Hopf
be6c17fcf9 CVE-2007-6429: Always test for size+offset wrapping. 2008-01-21 16:13:21 +01:00
Adam Jackson
e9fa7c1c88 CVE-2007-6429: Don't spuriously reject <8bpp shm pixmaps.
Move size validation after depth validation, and only validate size if
the bpp of the pixmap format is > 8.  If bpp < 8 then we're already
protected from overflow by the width and height checks.
2008-01-18 14:41:20 -05:00
Peter Hutterer
883811c2be dix: remove inputInfo.pointer reference in TryClientEvents.
Unfortunately, this requires a change in the TCE API, and thus a change in all
callers. Tough luck.
2008-01-18 18:48:46 +10:30
Matthieu Herrb
6de61f8272 Fix for CVE-2007-6429 - MIT-SHM and EVI extensions integer overflows. 2008-01-17 15:28:42 +01:00
Matthieu Herrb
7dc1717ff0 Fix for CVE-2007-6428 - TOG-cup extension memory corruption. 2008-01-17 15:28:03 +01:00
Michel Dänzer
e46f6ddecc Yet another Xv extension byte swapping fix. 2008-01-16 14:24:22 +01:00
Alan Coopersmith
6844bd2e63 More Xv extension byte swapping fixes 2008-01-09 19:52:00 -08:00
Peter Hutterer
38bf01bd1c Merge branch 'master' into mpx 2008-01-10 13:38:46 +10:30
Richard Purdie
c31aead0fe [Kdrive] make XCalibrate 'orientation aware' 2008-01-08 12:31:47 +01:00
Eamon Walsh
39cb782f28 XACE: DeleteCallbackList zeroes out its argument so don't do it twice. 2008-01-03 23:17:06 -05:00
Eamon Walsh
cd0603c2dc Bug #13765: Heap corruption in XC-SECURITY extension code. 2008-01-03 21:41:02 -05:00
Eamon Walsh
17a9714a67 Bug #13794: Update MBE extension devPrivates to new interface. 2008-01-03 14:46:54 -05:00
Peter Hutterer
8da83836b6 Merge branch 'master' into mpx
Conflicts:

	XTrap/xtrapddmi.c
	Xext/security.c
	Xext/xprint.c
	Xext/xtest.c
	Xext/xvdisp.c
	Xi/exevents.c
	Xi/grabdevb.c
	Xi/grabdevk.c
	Xi/opendev.c
	Xi/ungrdev.c
	Xi/ungrdevb.c
	Xi/ungrdevk.c
	dix/cursor.c
	dix/devices.c
	dix/dixutils.c
	dix/events.c
	dix/getevents.c
	dix/main.c
	dix/window.c
	hw/xfree86/ramdac/xf86Cursor.c
	include/dix.h
	include/input.h
	include/inputstr.h
	mi/midispcur.c
	mi/miinitext.c
	mi/misprite.c
	render/animcur.c
	xfixes/cursor.c
	xkb/xkbAccessX.c
2008-01-03 17:04:54 +10:30
Alan Coopersmith
dfd682b582 X.Org bug 4947/Sun bug 6646626: Xv extension not byte-swapping properly
X.Org Bugzilla #4947 <https://bugs.freedesktop.org/show_bug.cgi?id=4947>
Sun bug 6646626 <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6646626>

Don't use swapped data after swapping it.   When done swapping data,
send the swapped data, not the address of the pointer to it, to the client.
2008-01-02 19:27:22 -08:00
Eamon Walsh
3b23dd9fd4 xselinux: Fix whitespace warnings. 2007-12-28 13:29:45 -05:00
Eamon Walsh
643c52be32 xselinux: Remove "X" prefix on remaining functions and strings.
Should be evident from the context.
2007-12-28 13:27:28 -05:00
Eamon Walsh
f4bc333fc1 xselinux: don't FatalError on an invalid class mapping, just disable support. 2007-12-28 13:27:28 -05:00
Eamon Walsh
f3780ece52 xselinux: Implement swapped protocol request logic. 2007-12-28 13:27:28 -05:00
Eamon Walsh
1bbf64ab11 xselinux: Remove unnecessary structure definition. 2007-12-28 13:27:28 -05:00
Adam Jackson
743008a481 Report serverClient resources in the X-Resource extension. 2007-12-23 14:27:14 -05:00
Eamon Walsh
1393a97ea9 xselinux: Send AVC messages to audit system instead of log file/stderr. 2007-12-20 16:23:49 -05:00
Peter Hutterer
66b00029e5 Xext: remove redefinition of Bool.
Thanks to Simon Thum.
2007-12-19 18:11:32 +10:30
Sam Lau
51fab1eb30 Sun bug 6278039: Xevie checking wrong size in swapped XevieSelectInput requests
<http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6278039>
2007-12-18 11:40:09 -08:00
Eamon Walsh
97c82ce051 XACE: Restore the old background None behavior in response to bug #13683.
From the X11 protocol spec:

"If background None is specified, the window has no defined background."

This means that toolkits and apps cannot rely on the "transparent" nature
of the current implementation!  At some point before the next release,
XACE will switch back to a solid background as the default.
2007-12-17 23:12:01 -05:00
Eamon Walsh
c8feb73f58 Merge branch 'master' into XACE-SELINUX
Conflicts:

	Xext/EVI.c
	Xext/bigreq.c
	Xext/cup.c
	Xext/dpms.c
	Xext/fontcache.c
	Xext/mitmisc.c
	Xext/xcmisc.c
	Xext/xf86bigfont.c
	Xext/xtest.c
	configure.ac
	dbe/dbe.c
	hw/darwin/darwin.h
	hw/darwin/darwinEvents.c
	hw/darwin/iokit/xfIOKit.h
	hw/darwin/iokit/xfIOKitCursor.c
	hw/darwin/quartz/fullscreen/fullscreen.c
	hw/darwin/quartz/fullscreen/quartzCursor.c
	hw/darwin/quartz/quartz.c
	hw/darwin/quartz/quartzCommon.h
	hw/darwin/quartz/quartzCursor.c
	hw/darwin/quartz/xpr/dri.c
	hw/darwin/quartz/xpr/dristruct.h
	hw/darwin/quartz/xpr/xprCursor.c
	hw/darwin/quartz/xpr/xprFrame.c
	hw/xfree86/modes/xf86RandR12.c
	include/cursor.h
	miext/rootless/rootlessCommon.h
	miext/rootless/rootlessScreen.c
	miext/rootless/rootlessWindow.c
	render/picturestr.h

Trying to pick up the pieces from the darwin churn here...
2007-12-13 18:38:25 -05:00
Eamon Walsh
9a7ce57363 xselinux: Add new protocol for setting device create context. 2007-12-12 20:44:59 -05:00
Peter Harris
2d723bbd0d Add missing swaps in panoramiXSwap.c 2007-12-05 18:29:54 +00:00
Adam Jackson
0fff01f566 Fix swapped Xv dispatch under Xinerama.
Same-endian dispatch was properly calling through the Xinerama wrapping,
but other-endian dispatch wasn't.
2007-12-02 14:15:36 -05:00
Adam Jackson
fa47910045 Clean up many #if 0. 2007-12-02 12:40:25 -05:00
Peter Hutterer
f9269bebae DeviceIntRec: move lastx/lasty from valuator into DeviceIntRec.
We free the ValuatorClassRec quite regularly. If a SIGIO is handled while
we're swapping device classes, we can bring the server down when we try to
access lastx/lasty of the master device.
2007-11-22 17:30:14 +10:30
Peter Hutterer
33f1568992 xtest: switch an inputInfo.pointer over to PickPointer.
Couple of whitespace fixes too.
2007-11-21 16:14:49 +10:30
Peter Hutterer
e5dd7a9579 Xext: Scruffy the janitor don't like no "register" keywords. 2007-11-21 15:59:31 +10:30
Eamon Walsh
4363d70c6b registry: Fix some mistakes in the reversion of prior commits. 2007-11-20 18:58:55 -05:00
Eamon Walsh
5269da2bde Revert "registry: Register XvMC extension protocol names."
This reverts commit 853ea337bd.

Moving all the names into dix/registry.c
2007-11-20 18:43:38 -05:00
Eamon Walsh
03a86c8d5e Revert "registry: Register Xv extension protocol names."
This reverts commit 12766c5b5f.

Moving all the names into dix/registry.c
2007-11-20 18:42:19 -05:00
Eamon Walsh
edcf490cdb registry: Remove registry code from XTest extension.
Moving all the names into dix/registry.c
2007-11-20 18:41:10 -05:00
Eamon Walsh
5fea1ed50f registry: Remove registry code from SELinux extension.
Moving all the names into dix/registry.c
2007-11-20 18:39:48 -05:00
Eamon Walsh
9a8af33718 Revert "registry: Register Resource extension protocol names."
This reverts commit 5c8b1a9172.

Moving all the names into dix/registry.c
2007-11-20 18:38:24 -05:00
Eamon Walsh
e6023e0208 Revert "registry: Register XPrint extension protocol names."
This reverts commit f077578e42.

Moving all the names into dix/registry.c
2007-11-20 18:36:49 -05:00
Eamon Walsh
277345fb70 registry: Remove registry code from XF86Bigfont extension.
Moving all the names into dix/registry.c
2007-11-20 18:35:57 -05:00
Eamon Walsh
bf27edd365 Revert "registry: Register EVIE extension protocol names."
This reverts commit 48891d5696.

Moving all the names into dix/registry.c
2007-11-20 18:34:14 -05:00
Eamon Walsh
6874271794 registry: Remove registry code from XC-MISC extension.
Moving all the names into dix/registry.c
2007-11-20 18:32:54 -05:00
Eamon Walsh
4b0274e8f7 Revert "registry: Register SYNC extension protocol names."
This reverts commit 9f597f6c87.

Moving all the names into dix/registry.c
2007-11-20 18:25:15 -05:00
Eamon Walsh
4c7cf5aa4c Revert "registry: Register SHM extension protocol names."
This reverts commit 2c9646ad4e.

Moving all the names to dix/registry.c
2007-11-20 18:23:57 -05:00
Eamon Walsh
67e82e306f Revert "registry: Register SHAPE extension protocol names."
This reverts commit 4e274e90e1.

Moving all the names to dix/registry.c
2007-11-20 18:22:59 -05:00
Eamon Walsh
8583bf78ad registry: Remove registry code from XC-SECURITY extension.
Moving all the names to dix/registry.c
2007-11-20 18:21:09 -05:00
Eamon Walsh
55744d8e5d Revert "registry: Register MIT-SCREEN-SAVER extension protocol names."
This reverts commit 58c3240fcb.

Moving all the names into dix/registry.c
2007-11-20 18:19:44 -05:00
Eamon Walsh
36ef45928c registry: Remove registry code from MIT-MISC extension.
Moving all the names to dix/registry.c
2007-11-20 18:18:01 -05:00
Eamon Walsh
816e6e612e Revert "registry: Register Multibuffer extension protocol names."
This reverts commit 3877faf7d9.

Moving all the names into dix/registry.c
2007-11-20 18:15:37 -05:00
Eamon Walsh
40a0da044e registry: Remove registry code from Fontcache extension.
Moving all the names into dix/registry.c
2007-11-20 18:13:43 -05:00
Eamon Walsh
46412baf60 registry: Remove registry code from EVI extension.
Moving all the names into dix/registry.c
2007-11-20 18:11:06 -05:00
Eamon Walsh
460c43032f registry: Remove registry code from DPMS extension.
Moving all the names into dix/registry.c
2007-11-20 18:10:14 -05:00
Eamon Walsh
76e89d45b4 registry: Remove registry code from TOG-CUP extension.
Moving all the names into dix/registry.c
2007-11-20 18:06:40 -05:00
Eamon Walsh
ce93c5772d registry: Remove registry code from BigRequests extension.
Moving all the names into dix/registry.c
2007-11-20 18:03:57 -05:00
Eamon Walsh
0756d12712 Revert "registry: Register APPGROUP extension protocol names."
This reverts commit b504678ba5.

Moving all the names into dix/registry.c
2007-11-20 17:59:40 -05:00
Eamon Walsh
546d46224e Revert "registry: Register XINERAMA extension protocol names."
This reverts commit b9f5ab98c8.

Moving all the names into dix/registry.c
2007-11-20 17:37:48 -05:00
Eamon Walsh
709c1a70c8 Remove some duplicate include statements. 2007-11-20 15:18:02 -05:00
Eamon Walsh
60be452c2e xace: restore the old SaveScreens function and introduce new API, since the
old version is called from drivers...
2007-11-19 16:59:34 -05:00
Eamon Walsh
1603130236 Merge branch 'master' into XACE-SELINUX
Conflicts:

	Xext/xace.c
	Xext/xace.h
2007-11-14 13:35:50 -05:00
Eamon Walsh
f207e69d62 xselinux: adjust receive hook to use new synthetic_event class. 2007-11-14 12:23:29 -05:00
Eamon Walsh
45f884d79c xselinux: add new synthetic_event security class, and fix registry code. 2007-11-09 15:00:15 -05:00
Eamon Walsh
b092856bab registry: Register XC-SECURITY extension protocol names. 2007-11-09 14:45:02 -05:00
Peter Hutterer
c0a0580578 Xext: add simple macro to easily check a generic event's type. 2007-11-09 23:07:10 +10:30
Eamon Walsh
9d03cad144 Remove SecurityPolicy file and associated references in the manpages. 2007-11-08 16:46:31 -05:00
Eamon Walsh
8b5d21cc1d Rework of the XC-SECURITY extension. The gen-auth protocol has not changed,
but the XC-QUERY-SECURITY-1 authorization method and the SecurityPolicy
configuration file have been removed.  The semantics of the trusted vs.
untrusted split have been changed.  This will be documented in a future
commit.
2007-11-08 16:32:42 -05:00
Peter Hutterer
0b729051c0 Merge branch 'master' into mpx
Conflicts:

	Xi/extinit.c
	Xi/grabdev.c
	Xi/setmode.c
	Xi/ungrdev.c
	dix/devices.c
	dix/events.c
	dix/getevents.c
	include/dix.h
	mi/midispcur.c
	mi/misprite.c
	xkb/xkbActions.c
	xkb/xkbEvents.c
	xkb/xkbPrKeyEv.c
2007-11-07 15:37:23 +10:30
Eamon Walsh
d7c5e8bfc1 Modified performance patches from Arjan van de Ven <arjan@infradead.org>
Subject: [PATCH] fix some performance gaps in Xace

The XaceHook function is used in several hotpaths.
The problem with it (performance wise) is twofold:
 * The XaceHook function has a big switch() statement for the hook number in it
 * The XaceHook function uses varargs to reassemble the final dispatch arguments again

Both are expensive operations... for something that is known at compile time

This patch turns the hotpath XaceHook call into a direct call to avoid
the switch and varargs; this gives me over 10% performance gain
on the x11perf benchmark.
2007-11-06 16:26:09 -05:00
Eamon Walsh
a52c9b2a59 Merge branch 'master' into XACE-SELINUX
Conflicts:

	dix/dispatch.c
	dix/property.c
	hw/xfree86/common/xf86VidMode.c
	include/xkbsrv.h
	render/glyph.c
	xkb/xkbActions.c
2007-11-05 19:08:36 -05:00
Eamon Walsh
c7e18beb3c xselinux: Register SELinux extension protocol names. 2007-11-05 15:02:05 -05:00
Daniel Stone
934281126f Xext: Remove usage of alloca
Replace with heap allocations.
2007-11-05 14:34:46 +00:00
Aaron Plattner
f2e310132f Add CreatePixmap allocation hints.
These hints allow an acceleration architecture to optimize allocation of certain
types of pixmaps, such as pixmaps that will serve as backing pixmaps for
redirected windows.
2007-11-04 16:11:28 -08:00
Eamon Walsh
3b7af72fe3 xselinux: Add a SetDeviceContext request and stubs for more requests. 2007-10-26 20:32:47 -04:00
Eamon Walsh
7d14ca59c5 xselinux: Don't include the client in the receive hook audit messages. 2007-10-25 19:00:50 -04:00