Skip to content
Snippets Groups Projects
  1. Dec 14, 2022
    • Peter Hutterer's avatar
      Xi: return an error from XI property changes if verification failed · b8a84cb0
      Peter Hutterer authored
      
      Both ProcXChangeDeviceProperty and ProcXIChangeProperty checked the
      property for validity but didn't actually return the potential error.
      
      Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
      Acked-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      b8a84cb0
    • Peter Hutterer's avatar
      Xext: free the screen saver resource when replacing it · 842ca3cc
      Peter Hutterer authored
      
      This fixes a use-after-free bug:
      
      When a client first calls ScreenSaverSetAttributes(), a struct
      ScreenSaverAttrRec is allocated and added to the client's
      resources.
      
      When the same client calls ScreenSaverSetAttributes() again, a new
      struct ScreenSaverAttrRec is allocated, replacing the old struct. The
      old struct was freed but not removed from the clients resources.
      
      Later, when the client is destroyed the resource system invokes
      ScreenSaverFreeAttr and attempts to clean up the already freed struct.
      
      Fix this by letting the resource system free the old attrs instead.
      
      CVE-2022-46343, ZDI-CAN 19404
      
      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>
      Acked-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      842ca3cc
    • Peter Hutterer's avatar
      Xext: free the XvRTVideoNotify when turning off from the same client · b79f32b5
      Peter Hutterer authored
      
      This fixes a use-after-free bug:
      
      When a client first calls XvdiSelectVideoNotify() on a drawable with a
      TRUE onoff argument, a struct XvVideoNotifyRec is allocated. This struct
      is added twice to the resources:
        - as the drawable's XvRTVideoNotifyList. This happens only once per
          drawable, subsequent calls append to this list.
        - as the client's XvRTVideoNotify. This happens for every client.
      
      The struct keeps the ClientPtr around once it has been added for a
      client. The idea, presumably, is that if the client disconnects we can remove
      all structs from the drawable's list that match the client (by resetting
      the ClientPtr to NULL), but if the drawable is destroyed we can remove
      and free the whole list.
      
      However, if the same client then calls XvdiSelectVideoNotify() on the
      same drawable with a FALSE onoff argument, only the ClientPtr on the
      existing struct was set to NULL. The struct itself remained in the
      client's resources.
      
      If the drawable is now destroyed, the resource system invokes
      XvdiDestroyVideoNotifyList which frees the whole list for this drawable
      - including our struct. This function however does not free the resource
      for the client since our ClientPtr is NULL.
      
      Later, when the client is destroyed and the resource system invokes
      XvdiDestroyVideoNotify, we unconditionally set the ClientPtr to NULL. On
      a struct that has been freed previously. This is generally frowned upon.
      
      Fix this by calling FreeResource() on the second call instead of merely
      setting the ClientPtr to NULL. This removes the struct from the client
      resources (but not from the list), ensuring that it won't be accessed
      again when the client quits.
      
      Note that the assignment tpn->client = NULL; is superfluous since the
      XvdiDestroyVideoNotify function will do this anyway. But it's left for
      clarity and to match a similar invocation in XvdiSelectPortNotify.
      
      CVE-2022-46342, ZDI-CAN 19400
      
      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>
      Acked-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      b79f32b5
    • Peter Hutterer's avatar
      Xi: disallow passive grabs with a detail > 255 · 51eb63b0
      Peter Hutterer authored
      
      The XKB protocol effectively prevents us from ever using keycodes above
      255. For buttons it's theoretically possible but realistically too niche
      to worry about. For all other passive grabs, the detail must be zero
      anyway.
      
      This fixes an OOB write:
      
      ProcXIPassiveUngrabDevice() calls DeletePassiveGrabFromList with a
      temporary grab struct which contains tempGrab->detail.exact = stuff->detail.
      For matching existing grabs, DeleteDetailFromMask is called with the
      stuff->detail value. This function creates a new mask with the one bit
      representing stuff->detail cleared.
      
      However, the array size for the new mask is 8 * sizeof(CARD32) bits,
      thus any detail above 255 results in an OOB array write.
      
      CVE-2022-46341, ZDI-CAN 19381
      
      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>
      Acked-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      51eb63b0
  2. Dec 12, 2022
    • Peter Hutterer's avatar
      Xtest: disallow GenericEvents in XTestSwapFakeInput · b320ca0f
      Peter Hutterer authored
      
      XTestSwapFakeInput assumes all events in this request are
      sizeof(xEvent) and iterates through these in 32-byte increments.
      However, a GenericEvent may be of arbitrary length longer than 32 bytes,
      so any GenericEvent in this list would result in subsequent events to be
      misparsed.
      
      Additional, the swapped event is written into a stack-allocated struct
      xEvent (size 32 bytes). For any GenericEvent longer than 32 bytes,
      swapping the event may thus smash the stack like an avocado on toast.
      
      Catch this case early and return BadValue for any GenericEvent.
      Which is what would happen in unswapped setups anyway since XTest
      doesn't support GenericEvent.
      
      CVE-2022-46340, ZDI-CAN 19265
      
      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>
      Acked-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      b320ca0f
  3. Dec 09, 2022
    • Doğukan Korkmaztürk's avatar
      GLX: Free the tag of the old context later · 4781f2a5
      Doğukan Korkmaztürk authored and Olivier Fourdan's avatar Olivier Fourdan committed
      
      In CommonMakeCurrent() function, the tag of the old context is freed
      before the new context is made current. This is problematic because if
      the CommonMakeNewCurrent() function fails, the tag of the old context
      ends up being removed, even though it is still active. This causes
      subsequent glXMakeCurrent() or glXMakeContextCurrent() requests to
      generate a GLXBadContextTag error.
      
      This change moves the function call that frees the old tag to a location
      where the result of CommonMakeNewCurrent() call is known and it is safe
      to free it.
      
      Signed-off-by: Doğukan Korkmaztürk's avatarDoğukan Korkmaztürk <dkorkmazturk@nvidia.com>
      4781f2a5
  4. Dec 06, 2022
  5. Dec 01, 2022
  6. Nov 30, 2022
  7. Nov 28, 2022
  8. Nov 27, 2022
  9. Nov 24, 2022
  10. Nov 16, 2022
    • Shashank Sharma's avatar
      xf86: allow DDX driver for GPU/PCI hot-plug · 82bf391c
      Shashank Sharma authored and Shashank Sharma's avatar Shashank Sharma committed
      
      The current X server infrastructure sets modesetting driver as default driver
      to handle PCI-hotplug of a GPU device. This prevents the respective DDX driver
      (like AMDGPU DDX driver) to take control of the card.
      
      This patch:
      - Adds a few functions and fine-tunes the GPU hotplug infrastructure to allow
        the DDX driver to be loaded, if it is configured in the X config file
        options as "hotplug-driver".
      - Scans and updates the PCI device list before adding the new GPU device
        in platform, so that the association of the platform device and PCI device
        is in place (dev->pdev).
      - Adds documentation of this new option
      
      An example usage in the config file would look like:
      
      Section "OutputClass"
              Identifier "AMDgpu"
              MatchDriver "amdgpu"
              Driver "amdgpu"
      	HotplugDriver "amdgpu"
      EndSection
      
      V2:
      Fixed typo in commit message (Martin)
      Added R-B from Adam.
      Added ACK from Alex and Martin.
      
      V3:
      Added an output class based approach for finding the DDX driver (Aaron)
      Rebase
      
      V4:
      Addressed review comment from Aaron:
      GPU hot-plug handling driver's name to be read from the DDX config file options.
      In this way only the DDX drivers interested in handling GPU hot-plug will be
      picked and loaded, for others modesetting driver will be used as usual.
      
      V5:
      Addressed review comments from Aaron:
      - X config option to be listed in CamelCase.
      - Indentation fix at one place.
      - Code readability related optimization.
      
      V6:
      Addressed review comments from Aaron:
      - Squash the doc in the same patch
      - Doc formatting changes
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Suggested-by: Aaron Plattner aplattner@nvidia.com (v3)
      Acked-by: default avatarMartin Roukala <martin.roukala@mupuf.org(v1)>
      Acked-by: Alex Deucher alexander.deucher@amd.com (v1)
      Reviewed-by: default avatarAdam Jackson <ajax@redhat.com(v1)>
      Signed-off-by: default avatarShashank Sharma <shashank.sharma@amd.com>
      82bf391c
  11. Nov 05, 2022
    • pkubaj's avatar
      Fix build on FreeBSD/powerpc* · 8c54d590
      pkubaj authored and Alan Coopersmith's avatar Alan Coopersmith committed
      Current error:
      ld: error: undefined symbol: xf86EnableIO
      >>> referenced by xf86Configure.c
      >>>               libxorg_common.a.p/xf86Configure.c.o:(DoConfigure) in archive hw/xfree86/common/libxorg_common.a
      >>> referenced by xf86Events.c
      >>>               libxorg_common.a.p/xf86Events.c.o:(xf86VTEnter) in archive hw/xfree86/common/libxorg_common.a
      >>> referenced by xf86Init.c
      >>>               libxorg_common.a.p/xf86Init.c.o:(InitOutput) in archive hw/xfree86/common/libxorg_common.a
      >>> referenced 1 more times
      8c54d590
  12. Oct 28, 2022
  13. Oct 19, 2022
  14. Oct 18, 2022
  15. Sep 28, 2022
  16. Sep 20, 2022
  17. Sep 13, 2022
    • Olivier Fourdan's avatar
      xwayland: Prevent Xserver grabs with rootless · a77d95af
      Olivier Fourdan authored and Olivier Fourdan's avatar Olivier Fourdan committed
      
      Because of the design of most Wayland compositors, where the compositor
      is both a Wayland server and an X11 window manager, any X11 client
      issuing a server grab (i.e. XGrabServer()) can possibly hang the whole
      desktop when Xwayland is running rootless.
      
      This can happen with e.g. ImageMagick's import command with mutter.
      
      1. "import" is launched and issues an XServerGrab(),
      2. Xwayland restricts access to that "import" X11 client alone,
      3. mutter continues to process events until it needs to sync with
         Xwayland (there's variability in time before the hang occurs),
      4. When mutter does an XSync() (explicitly or implicitly through some
         other Xlib call), it will stop waiting for Xwayland to reply,
      5. Xwayland waits for the XServerGrab() to be released by import,
      6. "import" waits for a user input to release the XServerGrab(),
      7. mutter is stuck waiting on Xwayland and does not process input
         events...
      
      To prevent this, re-route the GrabServer/UngrabServer requests and
      pretend the grab works but actually does nothing at all for all clients
      but the X11 window manager (which can still issue X11 server grabs, at
      its own risks).
      
      Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
      Closes: https://bugzilla.redhat.com/1914021
      a77d95af
  18. Sep 12, 2022
    • Michel Dänzer's avatar
      dix: Skip more code in SetRootClip for ROOT_CLIP_INPUT_ONLY · f778b56a
      Michel Dänzer authored
      Despite e957a2e5 ("dix: Add hybrid full-size/empty-clip mode to
      SetRootClip"), I was still seeing all X11 client windows flashing when
      the root window size changes with rootless Xwayland (e.g. due to
      hotplugging a monitor).
      
      Skipping this code for ROOT_CLIP_INPUT_ONLY fixes the issue for me.
      f778b56a
  19. Sep 11, 2022
  20. Sep 09, 2022
    • Peter Harris's avatar
      os: Restore buffer when writing to network · 2ab70ded
      Peter Harris authored and Alan Coopersmith's avatar Alan Coopersmith committed
      
      The commit 9bf46610 "os: Immediately
      queue initial WriteToClient" effectively disables buffering (of all
      writes, not just the "initial" write), since the OS's network buffers
      will usually be large enough to hold whatever replies we have sent.
      
      This does improve performance when drawing over a Unix socket (I measure
      approximtely 10%, not the ~5x mentioned in that commit message, probably
      due to the large changes in this area since that commit), but it
      decreases performance when drawing over a network due to the additional
      TCP packets. This decrease is small (~10%) in most cases, but if the two
      machines have mismatched Nagle / tcp_delay settings it can cause
      XGetWindowAttributes to take 200ms (because it's composed of two
      requests, the 2nd of which might wait for the ack which is delayed).
      
      Avoid network slowdowns by making the immediate flush conditional on
      who->local.
      
      Signed-off-by: default avatarPeter Harris <pharris@opentext.com>
      2ab70ded
  21. Sep 08, 2022
  22. Sep 07, 2022
    • Maya Rashish's avatar
      Simplify auto device configuration for choosing wsfb, fbdev · 399cf127
      Maya Rashish authored and Alan Coopersmith's avatar Alan Coopersmith committed
      I wanted to simplify the logic, and thought this is a good opportunity
      to eliminate local diffs.
      
      I don't want to list OSes without wsfb, because I understand that is a
      netbsd/openbsd driver, and always have it as a fallback for us.
      
      Additionally, I understand "fbdev" is linux-specific, so have the logic
      match this intent.
      399cf127
    • Michel Dänzer's avatar
      ci: Check that all expected piglit results are there · 421e066e
      Michel Dänzer authored
      Without these, the build jobs would spuriously pass if some of the
      expected piglit tests didn't run at all.
      
      v2:
      * Use local variables instead of starting their names with underscores
        (Peter Hutterer)
      421e066e
  23. Sep 02, 2022
Loading