From a15bd8bea7ba842a06e995d474bc8d52b8f59d0ef44d8fb5c4d3aba98b648c26 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Tue, 2 Jun 2009 22:58:26 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xorg-x11-server?expand=0&rev=125 --- ...server-bnc381139-randr-fix-timestamps.diff | 140 +++++++ ...-bnc381139-randr-reprobe-on-unsuspend.diff | 55 +++ cache-xkbcomp-output-for-fast-start-up.patch | 358 ++++++++++++++++++ libdri_noPanoramiXExtension_symbol.patch | 12 + ...crash-caused-by-wrong-ordering-of-fo.patch | 31 ++ ...untrusted-windows-remove-access-on-a.patch | 38 ++ ...-behavior-of-extension-access-for-co.patch | 67 ++++ xorg-detect-psb.patch | 12 + xorg-x11-server.changes | 22 ++ xorg-x11-server.spec | 38 +- xserver-1.5.0-bg-none-root.patch | 185 +++++++++ xserver-boottime.patch | 38 ++ 12 files changed, 995 insertions(+), 1 deletion(-) create mode 100644 bug-507190_xorg-x11-server-bnc381139-randr-fix-timestamps.diff create mode 100644 bug-507190_xorg-x11-server-bnc381139-randr-reprobe-on-unsuspend.diff create mode 100644 cache-xkbcomp-output-for-fast-start-up.patch create mode 100644 libdri_noPanoramiXExtension_symbol.patch create mode 100644 security-Fix-a-crash-caused-by-wrong-ordering-of-fo.patch create mode 100644 security-Grant-untrusted-windows-remove-access-on-a.patch create mode 100644 security-Revert-behavior-of-extension-access-for-co.patch create mode 100644 xorg-detect-psb.patch create mode 100644 xserver-1.5.0-bg-none-root.patch create mode 100644 xserver-boottime.patch diff --git a/bug-507190_xorg-x11-server-bnc381139-randr-fix-timestamps.diff b/bug-507190_xorg-x11-server-bnc381139-randr-fix-timestamps.diff new file mode 100644 index 0000000..1019a1d --- /dev/null +++ b/bug-507190_xorg-x11-server-bnc381139-randr-fix-timestamps.diff @@ -0,0 +1,140 @@ +From 0b1a5ecb8f7f8338cffff5b2441116687d2bbb66 Mon Sep 17 00:00:00 2001 +From: Keith Packard +Date: Thu, 28 May 2009 14:46:05 -0700 +Subject: [PATCH 1/3] Make RANDR 'set' timestamps follow client specified time. Bug 21987. + +The lastSetTime value which indicates when the configuration within the +server was last changed was not getting set in the appropriate RandR +requests. + +Signed-off-by: Keith Packard +--- + randr/rrcrtc.c | 3 ++- + randr/rrscreen.c | 4 +++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c +index ec65a04..3bd0138 100644 +--- a/randr/rrcrtc.c ++++ b/randr/rrcrtc.c +@@ -837,6 +837,7 @@ ProcRRSetCrtcConfig (ClientPtr client) + goto sendReply; + } + rep.status = RRSetConfigSuccess; ++ pScrPriv->lastSetTime = time; + + sendReply: + if (outputs) +@@ -846,7 +847,7 @@ sendReply: + /* rep.status has already been filled in */ + rep.length = 0; + rep.sequenceNumber = client->sequence; +- rep.newTimestamp = pScrPriv->lastConfigTime.milliseconds; ++ rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; + + if (client->swapped) + { +diff --git a/randr/rrscreen.c b/randr/rrscreen.c +index f391973..6683731 100644 +--- a/randr/rrscreen.c ++++ b/randr/rrscreen.c +@@ -921,8 +921,10 @@ ProcRRSetScreenConfig (ClientPtr client) + + if (!RRCrtcSet (crtc, mode, 0, 0, stuff->rotation, 1, &output)) + rep.status = RRSetConfigFailed; +- else ++ else { ++ pScreenPriv->lastSetTime = time; + rep.status = RRSetConfigSuccess; ++ } + + /* + * XXX Configure other crtcs to mirror as much as possible +-- +1.6.0.2 + + +From 33944b5fe72385b40ff9a8ed42394ce1687b3974 Mon Sep 17 00:00:00 2001 +From: Federico Mena Quintero +Date: Fri, 29 May 2009 13:57:05 -0500 +Subject: [PATCH 2/3] Add missing fields to SRR*NotifyEvent() + +Also, remove redundant field swaps and make others match the order in which +they are declared in the xRR*NotifyEvent structs. + +Signed-off-by: Federico Mena Quintero +--- + randr/randr.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/randr/randr.c b/randr/randr.c +index bc2b995..77807d8 100644 +--- a/randr/randr.c ++++ b/randr/randr.c +@@ -120,11 +120,11 @@ SRRScreenChangeNotifyEvent(xRRScreenChangeNotifyEvent *from, + cpswapl(from->root, to->root); + cpswapl(from->window, to->window); + cpswaps(from->sizeID, to->sizeID); ++ cpswaps(from->subpixelOrder, to->subpixelOrder); + cpswaps(from->widthInPixels, to->widthInPixels); + cpswaps(from->heightInPixels, to->heightInPixels); + cpswaps(from->widthInMillimeters, to->widthInMillimeters); + cpswaps(from->heightInMillimeters, to->heightInMillimeters); +- cpswaps(from->subpixelOrder, to->subpixelOrder); + } + + static void +@@ -138,7 +138,6 @@ SRRCrtcChangeNotifyEvent(xRRCrtcChangeNotifyEvent *from, + cpswapl(from->window, to->window); + cpswapl(from->crtc, to->crtc); + cpswapl(from->mode, to->mode); +- cpswapl(from->window, to->window); + cpswaps(from->rotation, to->rotation); + cpswaps(from->x, to->x); + cpswaps(from->y, to->y); +@@ -160,6 +159,8 @@ SRROutputChangeNotifyEvent(xRROutputChangeNotifyEvent *from, + cpswapl(from->crtc, to->crtc); + cpswapl(from->mode, to->mode); + cpswaps(from->rotation, to->rotation); ++ to->connection = from->connection; ++ to->subpixelOrder = from->subpixelOrder; + } + + static void +@@ -173,6 +174,7 @@ SRROutputPropertyNotifyEvent(xRROutputPropertyNotifyEvent *from, + cpswapl(from->output, to->output); + cpswapl(from->atom, to->atom); + cpswapl(from->timestamp, to->timestamp); ++ to->state = from->state; + } + + static void +-- +1.6.0.2 + + +From 9834c1c5d27eedc28ff8e488c476f12487a1d749 Mon Sep 17 00:00:00 2001 +From: Federico Mena Quintero +Date: Fri, 29 May 2009 17:07:08 -0500 +Subject: [PATCH 3/3] Fix field name + +--- + randr/rrscreen.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/randr/rrscreen.c b/randr/rrscreen.c +index 6683731..aa85a9b 100644 +--- a/randr/rrscreen.c ++++ b/randr/rrscreen.c +@@ -922,7 +922,7 @@ ProcRRSetScreenConfig (ClientPtr client) + if (!RRCrtcSet (crtc, mode, 0, 0, stuff->rotation, 1, &output)) + rep.status = RRSetConfigFailed; + else { +- pScreenPriv->lastSetTime = time; ++ pScrPriv->lastSetTime = time; + rep.status = RRSetConfigSuccess; + } + +-- +1.6.0.2 + diff --git a/bug-507190_xorg-x11-server-bnc381139-randr-reprobe-on-unsuspend.diff b/bug-507190_xorg-x11-server-bnc381139-randr-reprobe-on-unsuspend.diff new file mode 100644 index 0000000..f8b5d07 --- /dev/null +++ b/bug-507190_xorg-x11-server-bnc381139-randr-reprobe-on-unsuspend.diff @@ -0,0 +1,55 @@ +diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c +index 6f93a0d..01310e6 100644 +--- a/hw/xfree86/modes/xf86RandR12.c ++++ b/hw/xfree86/modes/xf86RandR12.c +@@ -55,6 +55,13 @@ typedef struct _xf86RandR12Info { + int pointerY; + Rotation rotation; /* current mode */ + Rotation supported_rotations; /* driver supported */ ++ ++ /* Used to wrap EnterVT so we can re-probe the outputs when a laptop unsuspends ++ * (actually, any time that we switch back into our VT). ++ * ++ * See https://bugs.freedesktop.org/show_bug.cgi?id=21554 ++ */ ++ xf86EnterVTProc *orig_EnterVT; + } XF86RandRInfoRec, *XF86RandRInfoPtr; + + #ifdef RANDR_12_INTERFACE +@@ -1646,10 +1653,25 @@ xf86RandR13SetPanning (ScreenPtr pScreen, + } + + static Bool ++xf86RandR12EnterVT (int screen_index, int flags) ++{ ++ ScreenPtr pScreen = screenInfo.screens[screen_index]; ++ XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); ++ ++ if (randrp->orig_EnterVT) { ++ if (!randrp->orig_EnterVT (screen_index, flags)) ++ return FALSE; ++ } ++ ++ return RRGetInfo (pScreen, TRUE); /* force a re-probe of outputs and notify clients about changes */ ++} ++ ++static Bool + xf86RandR12Init12 (ScreenPtr pScreen) + { + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + rrScrPrivPtr rp = rrGetScrPriv(pScreen); ++ XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); + + rp->rrGetInfo = xf86RandR12GetInfo12; + rp->rrScreenSetSize = xf86RandR12ScreenSetSize; +@@ -1665,6 +1687,10 @@ xf86RandR12Init12 (ScreenPtr pScreen) + rp->rrModeDestroy = xf86RandR12ModeDestroy; + rp->rrSetConfig = NULL; + pScrn->PointerMoved = xf86RandR12PointerMoved; ++ ++ randrp->orig_EnterVT = pScrn->EnterVT; ++ pScrn->EnterVT = xf86RandR12EnterVT; ++ + if (!xf86RandR12CreateObjects12 (pScreen)) + return FALSE; + diff --git a/cache-xkbcomp-output-for-fast-start-up.patch b/cache-xkbcomp-output-for-fast-start-up.patch new file mode 100644 index 0000000..86a6f44 --- /dev/null +++ b/cache-xkbcomp-output-for-fast-start-up.patch @@ -0,0 +1,358 @@ +From 0f70ba9d3412b17ac4e08e33e1be3c226c06ea54 Mon Sep 17 00:00:00 2001 +From: Yan Li +Date: Tue, 12 May 2009 17:49:07 +0800 +Subject: [PATCH] XKB: cache xkbcomp output for fast start-up v5 for 1.6.1 +Organization: Intel + +xkbcomp outputs will be cached in files with hashed keymap as +names. This saves boot time for around 1s on commodity netbooks. + +Signed-off-by: Yan Li +--- + configure.ac | 6 +- + xkb/README.compiled | 8 +- + xkb/ddxLoad.c | 192 +++++++++++++++++++++++++++++++++++++++++--------- + 3 files changed, 164 insertions(+), 42 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 4c4c797..7a5020a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -476,9 +476,9 @@ AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [ + AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]), + [ XKBPATH="$withval" ], + [ XKBPATH="${datadir}/X11/xkb" ]) +-AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]), ++AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${localstatedir}/cache/xkb)]), + [ XKBOUTPUT="$withval" ], +- [ XKBOUTPUT="compiled" ]) ++ [ XKBOUTPUT="${localstatedir}/cache/xkb" ]) + AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH], + [Directory where ancillary server config files are installed (default: ${libdir}/xorg)]), + [ SERVERCONFIG="$withval" ], +@@ -1757,7 +1757,7 @@ AC_DEFINE_DIR(XKB_BIN_DIRECTORY, bindir, [Path to XKB bin dir]) + XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1` + + if [[ x$XKBOUTPUT_FIRSTCHAR != x/ ]] ; then +- XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT" ++ AC_MSG_ERROR([xkb-output must be an absolute path.]) + fi + + # XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed +diff --git a/xkb/README.compiled b/xkb/README.compiled +index 71caa2f..a4a2ae0 100644 +--- a/xkb/README.compiled ++++ b/xkb/README.compiled +@@ -4,10 +4,10 @@ current keymap and/or any scratch keymaps used by clients. The X server + or some other tool might destroy or replace the files in this directory, + so it is not a safe place to store compiled keymaps for long periods of + time. The default keymap for any server is usually stored in: +- X-default.xkm +-where is the display number of the server in question, which makes +-it possible for several servers *on the same host* to share the same +-directory. ++ server-.xkm ++ ++where is the SHA1 hash of keymap source, so that compiled ++keymap of different keymap sources are stored in different files. + + Unless the X server is modified, sharing this directory between servers on + different hosts could cause problems. +diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c +index 4d5dfb6..60a68af 100644 +--- a/xkb/ddxLoad.c ++++ b/xkb/ddxLoad.c +@@ -32,6 +32,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. + #include + #endif + ++#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */ ++# include ++#else /* Use OpenSSL's libcrypto */ ++# include /* buggy openssl/sha.h wants size_t */ ++# include ++#endif + #include + #include + #define NEED_EVENTS 1 +@@ -46,24 +52,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. + #define XKBSRV_NEED_FILE_FUNCS + #include + #include ++#include + #include "xkb.h" + + #if defined(CSRG_BASED) || defined(linux) || defined(__GNU__) + #include + #endif + +- /* +- * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is +- * relative to the top-level XKB configuration directory. +- * Making the server write to a subdirectory of that directory +- * requires some work in the general case (install procedure +- * has to create links to /var or somesuch on many machines), +- * so we just compile into /usr/tmp for now. +- */ +-#ifndef XKM_OUTPUT_DIR +-#define XKM_OUTPUT_DIR "compiled/" +-#endif +- + #define PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\"" + #define ERROR_PREFIX "\"> \"" + #define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\"" +@@ -179,6 +174,45 @@ OutputDirectory( + } + + static Bool ++Sha1Asc(char sha1Asc[SHA_DIGEST_LENGTH*2+1], const char * input) ++{ ++ int i; ++ unsigned char sha1[SHA_DIGEST_LENGTH]; ++ ++#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */ ++ SHA1_CTX ctx; ++ ++ SHA1Init (&ctx); ++ SHA1Update (&ctx, input, strlen(input)); ++ SHA1Final (sha1, &ctx); ++#else /* Use OpenSSL's libcrypto */ ++ SHA_CTX ctx; ++ int success; ++ ++ success = SHA1_Init (&ctx); ++ if (! success) ++ return BadAlloc; ++ ++ success = SHA1_Update (&ctx, input, strlen(input)); ++ if (! success) ++ return BadAlloc; ++ ++ success = SHA1_Final (sha1, &ctx); ++ if (! success) ++ return BadAlloc; ++#endif ++ ++ /* convert sha1 to sha1_asc */ ++ for(i=0; i nameRtrnLen) && nameRtrn) { ++ ErrorF("[xkb] nameRtrn too small to hold xkmfile name\n"); ++ return False; ++ } ++ strncpy(nameRtrn, xkmfile, nameRtrnLen); ++ ++ /* if the xkm file already exists, reuse it */ ++ canonicalXkmFileName = Xprintf("%s%s.xkm", xkm_output_dir, xkmfile); ++ if (access(canonicalXkmFileName, R_OK) == 0) { ++ /* yes, we can reuse the old xkm file */ ++ LogMessage(X_INFO, "XKB: reuse xkmfile %s\n", canonicalXkmFileName); ++ result = True; ++ goto _ret; ++ } ++ LogMessage(X_INFO, "XKB: generating xkmfile %s\n", canonicalXkmFileName); ++ ++ /* continue to call xkbcomp to compile the keymap. to avoid race ++ condition, we compile it to a tmpfile then rename it to ++ xkmfile */ ++ + #ifdef WIN32 + strcpy(tmpname, Win32TempDir()); + strcat(tmpname, "\\xkb_XXXXXX"); +@@ -230,19 +322,30 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, + } + } + ++ if ( (tmpXkmFile = tempnam(xkm_output_dir, NULL)) == NULL ) { ++ ErrorF("[xkb] Can't generate temp xkm file name"); ++ result = False; ++ goto _ret; ++ } ++ + buf = Xprintf("\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" " +- "-em1 %s -emp %s -eml %s \"%s%s.xkm\"", ++ "-em1 %s -emp %s -eml %s \"%s\"", + xkbbindir, xkbbindirsep, + ( (xkbDebugFlags < 2) ? 1 : + ((xkbDebugFlags > 10) ? 10 : (int)xkbDebugFlags) ), +- xkbbasedirflag, xkmfile, ++ xkbbasedirflag, xkbfile, + PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1, +- xkm_output_dir, keymap); ++ tmpXkmFile); + + if (xkbbasedirflag != emptystring) { + xfree(xkbbasedirflag); + } + ++ /* there's a potential race condition between calling tempnam() ++ and invoking xkbcomp to write the result file (potential temp ++ file name conflicts), but since xkbcomp is a standalone ++ program, we have to live with this */ ++ + #ifndef WIN32 + out= Popen(buf,"w"); + #else +@@ -250,31 +353,43 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, + #endif + + if (out!=NULL) { +-#ifdef DEBUG +- if (xkbDebugFlags) { +- ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n"); +- XkbWriteXKBKeymapForNames(stderr,names,xkb,want,need); ++ /* write XKBKeyMapBuf to xkbcomp */ ++ if (EOF==fputs(xkbKeyMapBuf, out)) ++ { ++ ErrorF("[xkb] Sending keymap to xkbcomp failed\n"); ++ result = False; ++ goto _ret; + } +-#endif +- XkbWriteXKBKeymapForNames(out,names,xkb,want,need); + #ifndef WIN32 + if (Pclose(out)==0) + #else + if (fclose(out)==0 && System(buf) >= 0) + #endif + { ++ /* xkbcomp success */ + if (xkbDebugFlags) + DebugF("[xkb] xkb executes: %s\n",buf); +- if (nameRtrn) { +- strncpy(nameRtrn,keymap,nameRtrnLen); +- nameRtrn[nameRtrnLen-1]= '\0'; ++ ++ /* if canonicalXkmFileName already exists now, we simply ++ overwrite it, this is OK */ ++ ret = rename(tmpXkmFile, canonicalXkmFileName); ++ if (0 != ret) { ++ ErrorF("[xkb] Can't rename %s to %s, error: %s\n", ++ tmpXkmFile, canonicalXkmFileName, ++ strerror(errno)); ++ ++ /* in case of error, don't unlink tmpXkmFile, leave it ++ for debugging */ ++ ++ result = False; ++ goto _ret; + } +- if (buf != NULL) +- xfree (buf); +- return True; ++ ++ result = True; ++ goto _ret; + } + else +- LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap); ++ LogMessage(X_ERROR, "Error compiling keymap (%s)\n", xkbfile); + #ifdef WIN32 + /* remove the temporary file */ + unlink(tmpname); +@@ -289,9 +404,17 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, + } + if (nameRtrn) + nameRtrn[0]= '\0'; ++ result = False; ++ ++_ret: ++ if (tmpXkmFile) ++ free(tmpXkmFile); ++ if (canonicalXkmFileName) ++ xfree(canonicalXkmFileName); + if (buf != NULL) + xfree (buf); +- return False; ++ ++ return result; + } + + static FILE * +@@ -375,7 +498,6 @@ unsigned missing; + DebugF("Loaded XKB keymap %s, defined=0x%x\n",fileName,(*xkbRtrn)->defined); + } + fclose(file); +- (void) unlink (fileName); + return (need|want)&(~missing); + } + +-- +1.5.6.5 + diff --git a/libdri_noPanoramiXExtension_symbol.patch b/libdri_noPanoramiXExtension_symbol.patch new file mode 100644 index 0000000..ec8519c --- /dev/null +++ b/libdri_noPanoramiXExtension_symbol.patch @@ -0,0 +1,12 @@ +diff -urN xorg-server-1.5.99.3/hw/xfree86/dri/dri.c xorg-server-1.5.99.3.new/hw/xfree86/dri/dri.c +--- xorg-server-1.5.99.3/hw/xfree86/dri/dri.c 2008-12-03 15:07:38.000000000 +0800 ++++ xorg-server-1.5.99.3.new/hw/xfree86/dri/dri.c 2008-12-15 15:51:17.000000000 +0800 +@@ -75,7 +75,7 @@ + #define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu) + + #if !defined(PANORAMIX) +-extern Bool noPanoramiXExtension; ++Bool noPanoramiXExtension = TRUE; + #endif + + static int DRIEntPrivIndex = -1; diff --git a/security-Fix-a-crash-caused-by-wrong-ordering-of-fo.patch b/security-Fix-a-crash-caused-by-wrong-ordering-of-fo.patch new file mode 100644 index 0000000..165b65e --- /dev/null +++ b/security-Fix-a-crash-caused-by-wrong-ordering-of-fo.patch @@ -0,0 +1,31 @@ +From 5d48f288eccb57dfe1751946c9d60dbd3ac0129a Mon Sep 17 00:00:00 2001 +From: Eamon Walsh +Date: Thu, 16 Apr 2009 22:39:54 -0400 +Subject: security: Fix a crash caused by wrong ordering of format arguments. + (cherry picked from commit 3481b32ab971c41cb972f6819ae049f3e9f7033b) + +--- + Xext/security.c | 7 ++++--- + 1 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/Xext/security.c b/Xext/security.c +index 4b34bb0..e660cc8 100644 +--- a/Xext/security.c ++++ b/Xext/security.c +@@ -948,9 +948,10 @@ SecuritySend(CallbackListPtr *pcbl, pointer unused, pointer calldata) + + SecurityAudit("Security: denied client %d from sending event " + "of type %s to window 0x%x of client %d\n", +- rec->client->index, rec->pWin->drawable.id, +- wClient(rec->pWin)->index, +- LookupEventName(rec->events[i].u.u.type)); ++ rec->client->index, ++ LookupEventName(rec->events[i].u.u.type), ++ rec->pWin->drawable.id, ++ wClient(rec->pWin)->index); + rec->status = BadAccess; + return; + } +-- +1.6.1.3 + diff --git a/security-Grant-untrusted-windows-remove-access-on-a.patch b/security-Grant-untrusted-windows-remove-access-on-a.patch new file mode 100644 index 0000000..8f81f3a --- /dev/null +++ b/security-Grant-untrusted-windows-remove-access-on-a.patch @@ -0,0 +1,38 @@ +From 11db545a86c8933c638a0bc1fcd4f2c65279f617 Mon Sep 17 00:00:00 2001 +From: Eamon Walsh +Date: Thu, 16 Apr 2009 22:48:11 -0400 +Subject: security: Grant untrusted windows remove access on all windows. + +This allows untrusted clients to destroy their own windows when they +have been reparented by a trusted window manager. +(cherry picked from commit 4559d2ace6ac55fe361f572ded0769cdd1f3b545) +--- + Xext/security.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/Xext/security.c b/Xext/security.c +index e660cc8..b9f411e 100644 +--- a/Xext/security.c ++++ b/Xext/security.c +@@ -74,6 +74,7 @@ static char *SecurityTrustedExtensions[] = { + static const Mask SecurityResourceMask = + DixGetAttrAccess | DixReceiveAccess | DixListPropAccess | + DixGetPropAccess | DixListAccess; ++static const Mask SecurityWindowExtraMask = DixRemoveAccess; + static const Mask SecurityRootWindowExtraMask = + DixReceiveAccess | DixSendAccess | DixAddAccess | DixRemoveAccess; + static const Mask SecurityDeviceMask = +@@ -817,6 +818,10 @@ SecurityResource(CallbackListPtr *pcbl, pointer unused, pointer calldata) + if (subj->haveState && subj->trustLevel != XSecurityClientTrusted) + ((WindowPtr)rec->res)->forcedBG = TRUE; + ++ /* additional permissions for specific resource types */ ++ if (rec->rtype == RT_WINDOW) ++ allowed |= SecurityWindowExtraMask; ++ + /* special checks for server-owned resources */ + if (cid == 0) { + if (rec->rtype & RC_DRAWABLE) +-- +1.6.1.3 + diff --git a/security-Revert-behavior-of-extension-access-for-co.patch b/security-Revert-behavior-of-extension-access-for-co.patch new file mode 100644 index 0000000..bcb998d --- /dev/null +++ b/security-Revert-behavior-of-extension-access-for-co.patch @@ -0,0 +1,67 @@ +From 93e0a648138e569087fc6e07c1a28abfa92a4dde Mon Sep 17 00:00:00 2001 +From: Eamon Walsh +Date: Thu, 16 Apr 2009 22:33:12 -0400 +Subject: security: Revert behavior of extension access for compatibility. + +Previously, three extensions were defined as "trusted" by the extension: +BIG-REQUESTS, XC-MISC, and XPrint. No other extensions were permitted +to be used by untrusted clients. + +In commit 8b5d21cc1d1f4e9d20e5d5eca44cb1e60a419763 this was changed for +some reason. Return to the old, compatible behavior. +(cherry picked from commit 6045506be0cebca4ebbe943ae77f020aafa703d4) +--- + Xext/security.c | 30 ++++++++++++++++-------------- + 1 files changed, 16 insertions(+), 14 deletions(-) + +diff --git a/Xext/security.c b/Xext/security.c +index e379063..4b34bb0 100644 +--- a/Xext/security.c ++++ b/Xext/security.c +@@ -61,10 +61,10 @@ typedef struct { + } SecurityStateRec; + + /* Extensions that untrusted clients shouldn't have access to */ +-static char *SecurityUntrustedExtensions[] = { +- "RandR", +- "SECURITY", +- "XFree86-DGA", ++static char *SecurityTrustedExtensions[] = { ++ "XC-MISC", ++ "BIG-REQUESTS", ++ "XpExtension", + NULL + }; + +@@ -852,16 +852,18 @@ SecurityExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata) + + subj = dixLookupPrivate(&rec->client->devPrivates, stateKey); + +- if (subj->haveState && subj->trustLevel != XSecurityClientTrusted) +- while (SecurityUntrustedExtensions[i]) +- if (!strcmp(SecurityUntrustedExtensions[i++], rec->ext->name)) { +- SecurityAudit("Security: denied client %d access to extension " +- "%s on request %s\n", +- rec->client->index, rec->ext->name, +- SecurityLookupRequestName(rec->client)); +- rec->status = BadAccess; +- return; +- } ++ if (subj->haveState && subj->trustLevel == XSecurityClientTrusted) ++ return; ++ ++ while (SecurityTrustedExtensions[i]) ++ if (!strcmp(SecurityTrustedExtensions[i++], rec->ext->name)) ++ return; ++ ++ SecurityAudit("Security: denied client %d access to extension " ++ "%s on request %s\n", ++ rec->client->index, rec->ext->name, ++ SecurityLookupRequestName(rec->client)); ++ rec->status = BadAccess; + } + + static void +-- +1.6.1.3 + diff --git a/xorg-detect-psb.patch b/xorg-detect-psb.patch new file mode 100644 index 0000000..1364681 --- /dev/null +++ b/xorg-detect-psb.patch @@ -0,0 +1,12 @@ +--- xorg-server-1.6.0/hw/xfree86/common/xf86AutoConfig.c~ 2009-03-26 22:10:45.000000000 -0700 ++++ xorg-server-1.6.0/hw/xfree86/common/xf86AutoConfig.c 2009-03-26 22:10:45.000000000 -0700 +@@ -171,6 +171,9 @@ + case 0x8086: + if ((dev->device_id == 0x00d1) || (dev->device_id == 0x7800)) { + driverList[0] = "i740"; ++ } if ((dev->device_id == 0x8109) || (dev->device_id == 0x8108) || (dev->device_id == 0x4102) ) { ++ driverList[0] = "psb"; ++ driverList[1] = "psb_drv"; + } else { + driverList[0] = "intel"; + driverList[1] = "i810"; diff --git a/xorg-x11-server.changes b/xorg-x11-server.changes index 380e45e..d8c3300 100644 --- a/xorg-x11-server.changes +++ b/xorg-x11-server.changes @@ -1,3 +1,25 @@ +------------------------------------------------------------------- +Tue Jun 2 19:02:02 CEST 2009 - eich@suse.de + +Frederico's patches to support reprobing of connected displays on EnterVT +and fixes to set event timestamps properly. +- Re-probe RANDR outputs on laptop unsuspend. +- Make RANDR 'set' timestamps follow client specified time. +- Add missing fields to SRR*NotifyEvent(). + +------------------------------------------------------------------- +Tue Jun 2 14:46:19 CEST 2009 - eich@suse.de + +- Patches taken from Moblin: + * security: Grant untrusted windows remove access on all windows. + * security: Fix a crash caused by wrong ordering of format arguments. + * security: Revert behavior of extension access for compatibility. + * Autodetect Plousbo chips. + * add -nb command line option to supress root window background stet + on startup. + * cache xkb output for fast startup. + * make noPanoramiXExtension symbol local and initialize. + ------------------------------------------------------------------- Thu May 28 15:23:44 CEST 2009 - sndirsch@suse.de diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index f65b7a0..3b225aa 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -32,7 +32,7 @@ BuildRequires: libjpeg-devel Url: http://xorg.freedesktop.org/ %define EXPERIMENTAL 0 Version: 7.4 -Release: 37 +Release: 38 License: GPL v2 or later; X11/MIT BuildRoot: %{_tmppath}/%{name}-%{version}-build Group: System/X11/Servers/XF86_4 @@ -112,6 +112,16 @@ Patch130: radeonhd.diff Patch131: commit-cadf65a.diff Patch132: fixed-SYNC-extension-trigger-BlockHandler-test.diff Patch140: fbdev_fallback_fail_fix.diff +Patch141: bug-507190_xorg-x11-server-bnc381139-randr-fix-timestamps.diff +Patch142: bug-507190_xorg-x11-server-bnc381139-randr-reprobe-on-unsuspend.diff +Patch160: libdri_noPanoramiXExtension_symbol.patch +Patch161: cache-xkbcomp-output-for-fast-start-up.patch +Patch162: xserver-boottime.patch +Patch163: xserver-1.5.0-bg-none-root.patch +Patch164: xorg-detect-psb.patch +Patch165: security-Revert-behavior-of-extension-access-for-co.patch +Patch166: security-Fix-a-crash-caused-by-wrong-ordering-of-fo.patch +Patch167: security-Grant-untrusted-windows-remove-access-on-a.patch %description This package contains the X.Org Server. @@ -231,6 +241,16 @@ cp $RPM_SOURCE_DIR/radeonhd.h hw/xfree86/common %patch131 -p1 %patch132 -p1 %patch140 -p1 +%patch141 -p1 +%patch142 -p1 +%patch160 -p1 +%patch161 -p1 +# %patch162 -p1 +%patch163 -p1 +%patch164 -p1 +%patch165 -p1 +%patch166 -p1 +%patch167 -p1 %build pushd xorg-docs-* @@ -554,6 +574,22 @@ exit 0 %endif %changelog +* Tue Jun 02 2009 eich@suse.de + Frederico's patches to support reprobing of connected displays on EnterVT + and fixes to set event timestamps properly. +- Re-probe RANDR outputs on laptop unsuspend. +- Make RANDR 'set' timestamps follow client specified time. +- Add missing fields to SRR*NotifyEvent(). +* Tue Jun 02 2009 eich@suse.de +- Patches taken from Moblin: + * security: Grant untrusted windows remove access on all windows. + * security: Fix a crash caused by wrong ordering of format arguments. + * security: Revert behavior of extension access for compatibility. + * Autodetect Plousbo chips. + * add -nb command line option to supress root window background stet + on startup. + * cache xkb output for fast startup. + * make noPanoramiXExtension symbol local and initialize. * Thu May 28 2009 sndirsch@suse.de - fbdev_fallback_fail_fix.diff * fix fbdev fallback failure if no xorg.conf exists; fbdev driver diff --git a/xserver-1.5.0-bg-none-root.patch b/xserver-1.5.0-bg-none-root.patch new file mode 100644 index 0000000..e7b5b50 --- /dev/null +++ b/xserver-1.5.0-bg-none-root.patch @@ -0,0 +1,185 @@ +From a3e15680da24cb8259f6a83dee0c930dab024290 Mon Sep 17 00:00:00 2001 +From: Kristian +Date: Fri, 15 Aug 2008 15:15:14 +1000 +Subject: [PATCH] Add nr for background=none root + +--- + dix/globals.c | 1 + + dix/window.c | 22 ++++++++++++---------- + hw/xfree86/common/xf86Init.c | 11 +++++++++++ + hw/xfree86/common/xf86str.h | 5 ++++- + include/opaque.h | 1 + + os/utils.c | 3 +++ + 6 files changed, 32 insertions(+), 11 deletions(-) + +diff --git a/dix/globals.c b/dix/globals.c +index 973dc43..dbd76bb 100644 +--- a/dix/globals.c ++++ b/dix/globals.c +@@ -141,6 +141,7 @@ FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in + CursorPtr rootCursor; + Bool party_like_its_1989 = FALSE; + Bool whiteRoot = FALSE; ++Bool bgNoneRoot = FALSE; + + int cursorScreenDevPriv[MAXSCREENS]; + +diff --git a/dix/window.c b/dix/window.c +index c31fa87..8bb178d 100644 +--- a/dix/window.c ++++ b/dix/window.c +@@ -482,23 +482,24 @@ InitRootWindow(WindowPtr pWin) + pWin->cursorIsNone = FALSE; + pWin->optional->cursor = rootCursor; + rootCursor->refcnt++; +- ++ pWin->backingStore = defaultBackingStore; ++ pWin->forcedBS = (defaultBackingStore != NotUseful); + + if (party_like_its_1989) { + MakeRootTile(pWin); + backFlag |= CWBackPixmap; ++ pScreen->ChangeWindowAttributes(pWin, backFlag); ++ } else if (bgNoneRoot) { ++ /* nothing, handled in xf86CreateRootWindow */ + } else { + if (whiteRoot) + pWin->background.pixel = pScreen->whitePixel; + else + pWin->background.pixel = pScreen->blackPixel; + backFlag |= CWBackPixel; +- } + +- pWin->backingStore = defaultBackingStore; +- pWin->forcedBS = (defaultBackingStore != NotUseful); +- /* We SHOULD check for an error value here XXX */ +- (*pScreen->ChangeWindowAttributes)(pWin, backFlag); ++ pScreen->ChangeWindowAttributes(pWin, backFlag); ++ } + + MapWindow(pWin, serverClient); + } +diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c +index 236c00b..083a6ac 100644 +--- a/hw/xfree86/common/xf86Init.c ++++ b/hw/xfree86/common/xf86Init.c +@@ -79,6 +79,7 @@ + #ifdef RENDER + #include "picturestr.h" + #endif ++#include "xace.h" + + #include "globals.h" + +@@ -328,6 +329,7 @@ xf86CreateRootWindow(WindowPtr pWin) + int ret = TRUE; + int err = Success; + ScreenPtr pScreen = pWin->drawable.pScreen; ++ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + RootWinPropPtr pProp; + CreateWindowProcPtr CreateWindow = (CreateWindowProcPtr) + dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey); +@@ -381,6 +383,15 @@ xf86CreateRootWindow(WindowPtr pWin) + } + } + ++ if (bgNoneRoot && pScrn->canDoBGNoneRoot || 1) { ++ pWin->backgroundState = XaceBackgroundNoneState(pWin); ++ pWin->background.pixel = pScreen->whitePixel; ++ pScreen->ChangeWindowAttributes(pWin, CWBackPixmap | CWBorderPixel | CWCursor | CWBackingStore); ++ } else { ++ pWin->background.pixel = pScreen->blackPixel; ++ pScreen->ChangeWindowAttributes(pWin, CWBackPixel | CWBorderPixel | CWCursor | CWBackingStore); ++ } ++ + #ifdef DEBUG + ErrorF("xf86CreateRootWindow() returns %d\n", ret); + #endif +diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h +index 904c369..8c38f69 100644 +--- a/hw/xfree86/common/xf86str.h ++++ b/hw/xfree86/common/xf86str.h +@@ -531,7 +531,7 @@ typedef struct _confdrirec { + } confDRIRec, *confDRIPtr; + + /* These values should be adjusted when new fields are added to ScrnInfoRec */ +-#define NUM_RESERVED_INTS 16 ++#define NUM_RESERVED_INTS 15 + #define NUM_RESERVED_POINTERS 15 + #define NUM_RESERVED_FUNCS 11 + +@@ -959,6 +959,9 @@ typedef struct _ScrnInfoRec { + ClockRangesPtr clockRanges; + int adjustFlags; + ++ /* -nr support */ ++ int canDoBGNoneRoot; ++ + /* + * These can be used when the minor ABI version is incremented. + * The NUM_* parameters must be reduced appropriately to keep the +diff --git a/include/opaque.h b/include/opaque.h +index 07a0715..be1577b 100644 +--- a/include/opaque.h ++++ b/include/opaque.h +@@ -71,6 +71,7 @@ extern Bool defeatAccessControl; + extern long maxBigRequestSize; + extern Bool party_like_its_1989; + extern Bool whiteRoot; ++extern Bool bgNoneRoot; + + extern Bool CoreDump; + +diff --git a/os/utils.c b/os/utils.c +index b100949..c41b45b 100644 +--- a/os/utils.c ++++ b/os/utils.c +@@ -515,6 +515,7 @@ void UseMsg(void) + #endif + ErrorF("-nolisten string don't listen on protocol\n"); + ErrorF("-noreset don't reset after last client exists\n"); ++ ErrorF("-nr create root window with no background\n"); + ErrorF("-reset reset after last client exists\n"); + ErrorF("-p # screen-saver pattern duration (minutes)\n"); + ErrorF("-pn accept failure to listen on all ports\n"); +@@ -859,6 +860,8 @@ ProcessCommandLine(int argc, char *argv[]) + defaultBackingStore = WhenMapped; + else if ( strcmp( argv[i], "-wr") == 0) + whiteRoot = TRUE; ++ else if ( strcmp( argv[i], "-nr") == 0) ++ bgNoneRoot = TRUE; + else if ( strcmp( argv[i], "-maxbigreqsize") == 0) { + if(++i < argc) { + long reqSizeArg = atol(argv[i]); +From 6a39049e34eeefeeb821970d83e1994870af8f3e Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Thu, 1 Nov 2007 14:56:25 -0400 +Subject: [PATCH] Don't backfill bg=None windows in Composite. + +--- + composite/compalloc.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/composite/compalloc.c b/composite/compalloc.c +index 006e808..67d830d 100644 +--- a/composite/compalloc.c ++++ b/composite/compalloc.c +@@ -478,6 +478,7 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) + * Copy bits from the parent into the new pixmap so that it will + * have "reasonable" contents in case for background None areas. + */ ++#if 0 + if (pGC) + { + XID val = IncludeInferiors; +@@ -492,6 +493,7 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) + w, h, 0, 0); + FreeScratchGC (pGC); + } ++#endif + } + else + { +-- +1.5.3.4 + diff --git a/xserver-boottime.patch b/xserver-boottime.patch new file mode 100644 index 0000000..1790078 --- /dev/null +++ b/xserver-boottime.patch @@ -0,0 +1,38 @@ +diff --git a/os/log.c b/os/log.c +index 0860847..2c46f1a 100644 +--- a/os/log.c ++++ b/os/log.c +@@ -255,6 +255,33 @@ LogVWrite(int verb, const char *f, va_list args) + static char tmpBuffer[1024]; + int len = 0; + ++ struct timeval time; ++ time_t tv_sec; ++ suseconds_t tv_usec; ++ static Bool first = TRUE; ++ static time_t start_tv_sec; ++ static suseconds_t start_usec; ++ int diff_sec, diff_usec; ++ ++ gettimeofday(&time, NULL); ++ tv_sec = time.tv_sec; ++ tv_usec = time.tv_usec; ++ if (first == TRUE) { ++ start_tv_sec = tv_sec; ++ start_usec = tv_usec; ++ first = FALSE; ++ } ++ diff_sec = (int)difftime(tv_sec, start_tv_sec); ++ diff_usec = (tv_usec - start_usec); ++ if (diff_usec < 0) { ++ diff_sec--; ++ diff_usec += 1000000; ++ } ++ sprintf(tmpBuffer, "[%d sec: %06d usec]", diff_sec , diff_usec); ++ len = strlen(tmpBuffer); ++ if (logFile) ++ fwrite(tmpBuffer, len, 1, logFile); ++ + /* + * Since a va_list can only be processed once, write the string to a + * buffer, and then write the buffer out to the appropriate output