Skip to content
Snippets Groups Projects
  1. Jul 12, 2022
    • Peter Hutterer's avatar
      xkb: add request length validation for XkbSetGeometry · 6907b6ea
      Peter Hutterer authored and Povilas Kanapickas's avatar Povilas Kanapickas committed
      
      No validation of the various fields on that report were done, so a
      malicious client could send a short request that claims it had N
      sections, or rows, or keys, and the server would process the request for
      N sections, running out of bounds of the actual request data.
      
      Fix this by adding size checks to ensure our data is valid.
      
      ZDI-CAN 16062, CVE-2022-2319.
      
      This vulnerability was discovered by:
      Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
      
      Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
      6907b6ea
    • Peter Hutterer's avatar
      xkb: swap XkbSetDeviceInfo and XkbSetDeviceInfoCheck · dd8caf39
      Peter Hutterer authored and Povilas Kanapickas's avatar Povilas Kanapickas committed
      
      XKB often uses a FooCheck and Foo function pair, the former is supposed
      to check all values in the request and error out on BadLength,
      BadValue, etc. The latter is then called once we're confident the values
      are good (they may still fail on an individual device, but that's a
      different topic).
      
      In the case of XkbSetDeviceInfo, those functions were incorrectly
      named, with XkbSetDeviceInfo ending up as the checker function and
      XkbSetDeviceInfoCheck as the setter function. As a result, the setter
      function was called before the checker function, accessing request
      data and modifying device state before we ensured that the data is
      valid.
      
      In particular, the setter function relied on values being already
      byte-swapped. This in turn could lead to potential OOB memory access.
      
      Fix this by correctly naming the functions and moving the length checks
      over to the checker function. These were added in 87c64fc5 to the
      wrong function, probably due to the incorrect naming.
      
      Fixes ZDI-CAN 16070, CVE-2022-2320.
      
      This vulnerability was discovered by:
      Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
      
      Introduced in c06e27b2
      
      Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
      dd8caf39
  2. Jul 08, 2022
  3. Jul 04, 2022
  4. Jul 02, 2022
  5. Jul 01, 2022
  6. Jun 30, 2022
  7. Jun 27, 2022
    • Adam Jackson's avatar
      ephyr: Sync even less in ephyrInternalDamageRedisplay · cf30498f
      Adam Jackson authored
      
      If we have multiple damage rects we would sync (if we would sync) after
      every hostx_paint_rect. For shm images you'd rather push all the
      ShmPutImage requests and wait after the last one.
      
            before                  after   Operation
      ------------   --------------------   -------------------------
       232000000.0    240000000.0 (1.034)   Dot
        41500000.0     41400000.0 (0.998)   1x1 rectangle
        11400000.0     11400000.0 (1.000)   10x10 rectangle
          553000.0       553000.0 (1.000)   100x100 rectangle
           37300.0        38500.0 (1.032)   500x500 rectangle
          831000.0      1140000.0 (1.372)   PutImage 10x10 square
           65200.0       134000.0 (2.055)   PutImage 100x100 square
            3410.0         3500.0 (1.026)   PutImage 500x500 square
          810000.0      1150000.0 (1.420)   ShmPutImage 10x10 square
          346000.0       364000.0 (1.052)   ShmPutImage 100x100 square
           22400.0        22800.0 (1.018)   ShmPutImage 500x500 square
      
      Reviewed-by: Emma Anholt's avatarEmma Anholt <emma@anholt.net>
      cf30498f
    • Adam Jackson's avatar
      ephyr: Sync less in hostx_paint_rect · 7f884899
      Adam Jackson authored
      
      Move the xcb_aux_sync into the shm path, where we do still need it to
      synchronize access with the host. In the non-shm path the image is
      copied to the host anyway so the sync just adds latency and keeps you
      from using all your network bandwidth.
      
      Only the non-shm-putimage path benefits from this, but the benefit is
      significant even on the local machine (here a 3.2GHz Core i7-8700, using
      XEPHYR_NO_SHM=1):
      
            before                  after   Operation
      ------------   --------------------   -------------------------
       228000000.0    225000000.0 (0.987)   Dot
        40900000.0     41600000.0 (1.017)   1x1 rectangle
        10400000.0     10700000.0 (1.029)   10x10 rectangle
          477000.0       471000.0 (0.987)   100x100 rectangle
           30900.0        31800.0 (1.029)   500x500 rectangle
          760000.0       981000.0 (1.291)   PutImage 10x10 square
           14700.0        19200.0 (1.306)   PutImage 100x100 square
             320.0          382.0 (1.194)   PutImage 500x500 square
          749000.0       984000.0 (1.314)   ShmPutImage 10x10 square
          268000.0       304000.0 (1.134)   ShmPutImage 100x100 square
           16600.0        18500.0 (1.114)   ShmPutImage 500x500 square
      
      Reviewed-by: Emma Anholt's avatarEmma Anholt <emma@anholt.net>
      7f884899
    • Morose's avatar
      xwayland: Fix check logic in sprite_check_lost_focus() · 92a00f52
      Morose authored and Olivier Fourdan's avatar Olivier Fourdan committed
      
      When the pointer leaves an X11 window, and enters a Wayland native
      window, Xwayland has no idea about Wayland native windows and may
      generate the wrong crossing events to another X11 window instead.
      
      To avoid that issue, Xwayland implements its own XYToWindow() handler to
      compare the Wayland focused surface with the X11 window found in the
      window tree.
      
      Commit 59ad0e6a ("xwayland: Fix use after free of cursors") changed the
      logic in sprite_check_lost_focus() to use IsParent() to compare the
      windows, which works when the X11 window is reparented by the window
      manager, but fails in the case of an override redirect window.
      
      To fix the issue, also check whether last_xwindow is the window itself.
      
      Signed-off-by: default avatarMorose <chenlinxiang@kylinos.cn>
      Fixes: 59ad0e6a - xwayland: Fix use after free of cursors
      Reviewed-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      92a00f52
  8. Jun 26, 2022
Loading