]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/xserver.git/blob - debian/patches/122_xext_fix_card32_overflow_in_xauth.patch
Revert "Refresh patches"
[glsdk/xserver.git] / debian / patches / 122_xext_fix_card32_overflow_in_xauth.patch
1 Description:  Xext: "xauth generate" with large timeout crashes Xorg #27134
2  The security timout CARD32 millis would overflow with large timeouts, causing 
3  the timer callback to be called immediately and hit an assertion in
4  SecurityAuthorizationExpired.
5  .
6  This has not been applied upstream yet.  Discussion of the patch faltered
7  without resolution.  This patch has a problem when the epoch time is
8  sufficiently far in the future (about 2035) that it doesn't matter right now.
9 Origin: http://patchwork.freedesktop.org/patch/242/
10 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27134
11 Bug-Ubuntu: https://launchpad.net/bugs/519049
13 Index: xorg-server/Xext/security.c
14 ===================================================================
15 --- xorg-server.orig/Xext/security.c    2011-08-24 12:52:45.635647146 +0300
16 +++ xorg-server/Xext/security.c 2011-08-24 12:56:49.595650621 +0300
17 @@ -271,10 +271,10 @@
18      /* maxSecs is the number of full seconds that can be expressed in
19       * 32 bits worth of milliseconds
20       */
21 -    CARD32 maxSecs = (CARD32)(~0) / (CARD32)MILLI_PER_SECOND;
22 +    CARD32 maxSecs = (CARD32)(MAXINT) / (CARD32)MILLI_PER_SECOND;
23  
24      if (seconds > maxSecs)
25 -    { /* only come here if we want to wait more than 49 days */
26 +    { /* only come here if we want to wait more than 24 days */
27         pAuth->secondsRemaining = seconds - maxSecs;
28         return maxSecs * MILLI_PER_SECOND;
29      }
30 @@ -312,8 +312,6 @@
31  {
32      SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)pval;
33  
34 -    assert(pAuth->timer == timer);
35 -
36      if (pAuth->secondsRemaining)
37      {
38         return SecurityComputeAuthorizationTimeout(pAuth,