1. 18 Feb, 2015 4 commits
    • Olivier Fourdan's avatar
      xkb: Check strings length against request size · d7258444
      Olivier Fourdan authored
      Ensure that the given strings length in an XkbSetGeometry request remain
      within the limits of the size of the request.
      
      v3: backport to nx-libs 3.6.x because this is
      the CVE-2015-0255 fix (Mike DePaulo)
      Signed-off-by: 's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      Signed-off-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      (cherry picked from commit 20079c36cf7d377938ca5478447d8b9045cb7d43)
      (cherry picked from commit f160e722672dbb2b5215870b47bcc51461d96ff1)
      Signed-off-by: 's avatarJulien Cristau <jcristau@debian.org>
      d7258444
    • Olivier Fourdan's avatar
      xkb: Don't swap XkbSetGeometry data in the input buffer · 9308c79b
      Olivier Fourdan authored
      The XkbSetGeometry request embeds data which needs to be swapped when the
      server and the client have different endianess.
      
      _XkbSetGeometry() invokes functions that swap these data directly in the
      input buffer.
      
      However, ProcXkbSetGeometry() may call _XkbSetGeometry() more than once
      (if there is more than one keyboard), thus causing on swapped clients the
      same data to be swapped twice in memory, further causing a server crash
      because the strings lengths on the second time are way off bounds.
      
      To allow _XkbSetGeometry() to run reliably more than once with swapped
      clients, do not swap the data in the buffer, use variables instead.
      
      v3: backport to nx-libs 3.6.x as a prereq for
      the CVE-2015-0255 fix (Mike DePaulo)
      Signed-off-by: 's avatarOlivier Fourdan <ofourdan@redhat.com>
      Signed-off-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      (cherry picked from commit 81c90dc8f0aae3b65730409b1b615b5fa7280ebd)
      (cherry picked from commit 29be310c303914090298ddda93a5bd5d00a94945)
      Signed-off-by: 's avatarJulien Cristau <jcristau@debian.org>
      index 2405090..7db0959 100644
      9308c79b
    • Peter Hutterer's avatar
      include: introduce byte counting functions. · 3937db18
      Peter Hutterer authored
      This patch adds the following three functions:
       bits_to_bytes(bits) - the number of bytes needed to hold 'bits'
       bytes_to_int32(bytes) - the number of 4-byte units to hold 'bytes'
       pad_to_int32(bytes) - the closest multiple of 4 equal to or larger than
                              'bytes'.
      
      All three operations are common in protocol processing and currently the
      server has ((foo + 7)/8 + 3)/4 operations all over the place. A common set
      of functions reduce the error rate of these (albeit simple) calculations and
      improve readability of the code.
      
      The functions do not check for overflow.
      
      v2: backport to nx-libs 3.6.x as a prereq for
      the CVE-2015-0255 fix (Mike DePaulo)
      Signed-off-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
      3937db18
    • Daniel Stone's avatar
      Coverity #844, #845, #846: Fix memory leaks. · d6ce946f
      Daniel Stone authored
      v2: backport to nx-libs 3.6.x as a prereq for
      the CVE-2015-0255 fix (Mike DePaulo)
      d6ce946f
  2. 17 Feb, 2015 2 commits
  3. 16 Feb, 2015 18 commits
  4. 14 Feb, 2015 16 commits