Commit graph

19707 commits

Author SHA1 Message Date
kohnish
a6500098ef Merge branch 'mi-revert' into 'master'
Revert all commits that have broken libvnc.so

Closes #1855

See merge request xorg/xserver!2102
2025-12-19 14:37:27 +00:00
Mikhail Dmitrichenko
f83807647e os: avoid closing null fd at Fopen
In `Fopen` function variable `iop` may store NULL as a result of `fopen`
call. In this case, if later privileges couldn't be restored (`seteuid`
call fails), further `fclose(iop)` call will cause runtime error.

This commit adds check `iop` for NULL before calling `fclose` to prevent
potential NULL pointer dereference.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2115>
2025-12-19 03:32:35 +00:00
Liu Heng
7fb5e00ad8 xwayland: Fix incorrect pointer coordinates in enter events
Xwayland was sending incorrect pointer coordinates to X clients on
pointer enter events.

This was caused by calling CheckMotion() with a NULL event, which
prevented the pointer sprite hot coordinates from being updated
properly.

Fix this by constructing a proper DeviceEvent of type ET_Enter in
pointer_handle_enter, initializing it with the current timestamp
and EVENT_SOURCE_FOCUS, and passing it to CheckMotion() instead
of NULL.

This ensures the pointer sprite coordinates are correctly updated
when the pointer enters a window.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2113>
2025-12-16 10:51:34 +08:00
Alan Coopersmith
ac42c39145 dix: set errorValue correctly when XID lookup fails in ChangeGCXIDs()
dixLookupResourceByType always overwrites the pointer passed in as the
first arg, so we shouldn't use the union it's in after that to get the
requested XID value to put in the errorValue.

Closes: #1857
Fixes: 2d7eb4a19 ("Pre-validate ChangeGC XIDs.")
Reported-by: Mouse <mouse@Rodents-Montreal.ORG>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2111>
2025-12-08 05:52:19 +00:00
kohnish
1587be832f Revert "Xace: unexport Xace functions"
This reverts commit 3e0a4ab712.
2025-12-03 17:43:35 +00:00
kohnish
2dab709030 Revert "include: split out non-exported prototypes to dix_priv.h"
This reverts commit f17bc7e24d.
2025-12-03 17:43:35 +00:00
kohnish
b7af42d3c2 Revert "dix: unexport AddScreen() and AddGPUScreen()"
This reverts commit 27b83c4cd0.
2025-12-03 17:43:35 +00:00
kohnish
b3d6c23120 Revert "os: unexport command line args handling functions"
This reverts commit 389b528203.
2025-12-03 17:43:35 +00:00
kohnish
8985398948 Revert "mi: unexport miPointerWarpCursor()"
This reverts commit 6c04f94f3b.
2025-12-03 17:43:35 +00:00
kohnish
9b5ab4f6da Revert "dix: unexport global variables"
This reverts commit 040e41c7e9.
2025-12-03 17:43:35 +00:00
kohnish
543bf972a5 Revert "os: unexport ddx callbacks"
This reverts commit e5c8b664d3.
2025-12-03 17:43:35 +00:00
kohnish
eb45328bd9 Revert "dix: unexport fields from opaque.h not used by modules/drivers"
This reverts commit 06b599edb6.
2025-12-03 17:43:35 +00:00
kohnish
5bd03e1824 Revert "mi: make miRecolorCursor() static"
This reverts commit 6dbb957922.
2025-12-03 17:43:35 +00:00
kohnish
859e4282d4 Revert "mi: make CopyGetMasterEvent() static"
This reverts commit 12c507cd1f.
2025-12-03 17:43:35 +00:00
kohnish
08f3e93502 Revert "mi: unexport miWideArc()"
This reverts commit aaaa0a35e5.
2025-12-03 17:43:35 +00:00
kohnish
0afa60c22c Revert "mi: unexport miStepDash()"
This reverts commit 8a6bbc80f3.
2025-12-03 17:43:35 +00:00
kohnish
6d8dbe3db8 Revert "mi: unexport mieqInit()"
This reverts commit 5ac361cce9.
2025-12-03 17:43:35 +00:00
kohnish
78f41e3db6 Revert "mi: unexport mieqFini()"
This reverts commit 4742790351.
2025-12-03 17:43:35 +00:00
kohnish
c2914634c4 Revert "mi: unexport mieqEnqueue()"
This reverts commit 9dd280607f.
2025-12-03 17:43:35 +00:00
kohnish
df69bf6b31 Revert "mi: unexport mieqSwitchScreen()"
This reverts commit 413e6ed2c8.
2025-12-03 17:43:35 +00:00
kohnish
a7dd684057 Revert "mi: unexport mieqProcessDeviceEvent()"
This reverts commit 0f7770bce3.
2025-12-03 17:43:35 +00:00
kohnish
fc562444bc Revert "mi: unexport mieqProcessInputEvents()"
This reverts commit 9aa23b6abd.
2025-12-03 17:43:35 +00:00
kohnish
15fac1a168 Revert "mi: unexport mieqAddCallbackOnDrained()"
This reverts commit 269d54c48f.
2025-12-03 17:43:35 +00:00
kohnish
51e68e3951 Revert "mi: unexport mieqRemoveCallbackOnDrained()"
This reverts commit 964127ce10.
2025-12-03 17:43:35 +00:00
kohnish
5425489d33 Revert "mi: unexport mieqSetHandler()"
This reverts commit 7748984e3a.
2025-12-03 17:43:35 +00:00
kohnish
06c8dbd7ff Revert "mi: unexport miSendExposures()"
This reverts commit 8d07450904.
2025-12-03 17:43:35 +00:00
kohnish
a080a088b8 Revert "mi: unexport miWindowExposures()"
This reverts commit e424f49cdb.
2025-12-03 17:43:35 +00:00
kohnish
b982c9514c Revert "mi: unexport miPaintWindow()"
This reverts commit a54e8f5343.
2025-12-03 17:43:35 +00:00
kohnish
34f7357075 Revert "mi: unexport miSourceValidate()"
This reverts commit 191cca0905.
2025-12-03 17:43:35 +00:00
kohnish
a7b98cf156 Revert "mi: unexport miShapedWindowIn()"
This reverts commit c2ee74c523.
2025-12-03 17:43:35 +00:00
kohnish
b29d022512 Revert "mi: unexport miValidateTree()"
This reverts commit 7e21a514d7.
2025-12-03 17:43:35 +00:00
kohnish
f4ae013c8f Revert "mi: unexport miClearToBackground()"
This reverts commit 3856b6cb5e.
2025-12-03 17:43:35 +00:00
kohnish
1855037ac4 Revert "mi: unexport miMarkWindow()"
This reverts commit bcbb6eec62.
2025-12-03 17:43:35 +00:00
kohnish
b8b84c6090 Revert "mi: unexport miMarkOverlappedWindows()"
This reverts commit ade6650a81.
2025-12-03 17:43:35 +00:00
kohnish
390d17fd49 Revert "mi: unexport miHandleValidateExposures()"
This reverts commit 0624a8bad4.
2025-12-03 17:43:35 +00:00
kohnish
b301b5f212 Revert "mi: unexport miMoveWindow()"
This reverts commit faad8ed1c6.
2025-12-03 17:43:35 +00:00
kohnish
d775d4c22e Revert "mi: unexport miResizeWindow()"
This reverts commit 14565a4561.
2025-12-03 17:43:35 +00:00
kohnish
cd0908b1bb Revert "mi: unexport miGetLayerWindow()"
This reverts commit f11e203215.
2025-12-03 17:43:35 +00:00
kohnish
9e0151e64a Revert "mi: unexport miSetShape()"
This reverts commit 597ba690d3.
2025-12-03 17:43:35 +00:00
kohnish
a06fac4ac2 Revert "mi: unexport miChangeBorderWidth()"
This reverts commit b23ecec2f4.
2025-12-03 17:43:35 +00:00
kohnish
0ff8654221 Revert "mi: unexport miMarkUnrealizedWindow()"
This reverts commit 6c3b432053.
2025-12-03 17:43:35 +00:00
kohnish
876c053d52 Revert "mi: unexport miSpriteTrace()"
This reverts commit 85be6c82b0.
2025-12-03 17:43:35 +00:00
kohnish
c72b0add9b Revert "mi: unexport miXYToWindow()"
This reverts commit 3cf2408232.
2025-12-03 17:43:35 +00:00
kohnish
b07202abc7 Revert "mi: unexport SetInstalledmiColormap() macro"
This reverts commit aae9bd3f62.
2025-12-03 17:43:35 +00:00
stefan11111
eccee47185 glamor: fix Option "GlxVendorLibrary"
The old code tried to use a screen pointer that was uninitialized and set to NULL.
This caused it to segfault when this option was set.

When this option was used with the modesetting driver, `glamor_egl_init`
is called indirectly in the driver PreInit proc.

`xf86ScrnToScreen(scrn)` then returns NULL.

This patch moves setting the gl vendor later in the initialization process,
when we already have a non-null pScreen.

Minimal reproducer:
```
$ cat /etc/X11/xorg.conf.d/99-screen.conf
Section "Screen"
	Identifier "Default"
	Option "GlxVendorLibrary" "Name"
EndSection
```

Backtrace:
```
| #0  in abort ()
| #1  in OsAbort () at os/utils.c:1361
| #2  in AbortServer () at os/log.c:879
| #3  FatalError () at os/log.c:1017
| #4  in OsSigHandler () at os/osinit.c:156
| #5  OsSigHandler () at os/osinit.c:110
| #6  <signal handler called>
| #7  in __pthread_kill_implementation () from /lib64/libc.so.6
| #8  in raise () from /lib64/libc.so.6
| #9  in abort () from /lib64/libc.so.6
| #10 in __assert_fail_base.cold () from /lib64/libc.so.6
| #11 in xf86ScrnToScreen () at hw/xfree86/common/xf86Helper.c:1734
| #12 in glamor_egl_init () at glamor/glamor_egl.c:1108
| #13 in try_enable_glamor () at hw/xfree86/drivers/modesetting/driver.c:984
| #14 PreInit () at hw/xfree86/drivers/modesetting/driver.c:1211
| #15 in InitOutput () at hw/xfree86/common/xf86Init.c:478
| #16 in dix_main () at dix/main.c:190
| #17 main () at dix/stubmain.c:34
```

Fixes: a449bb4c5 - glamor_egl: add support of GlxVendorLibrary option

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2096>
2025-11-27 10:28:03 +00:00
Alan Coopersmith
a5047d4a65 Create a SECURITY.md file
Provide information on where to report or learn of security bugs,
and what we do or do not consider to be a security bug.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2103>
2025-11-18 17:08:42 -08:00
kohnish
0060b91b49 Revert "dix: unexport dixLookupProperty()"
This reverts commit fb697dd644.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2101>
2025-11-17 21:33:26 +01:00
kohnish
9a4c322c4b Revert "dix: unexport DeleteAllWindowProperties()"
This reverts commit b0272692a1.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2101>
2025-11-17 21:33:26 +01:00
Alan Coopersmith
3e9baa20f3 glamor: avoid double free in glamor_make_pixmap_exportable()
Reported by gcc 15.1:

../glamor/glamor_egl.c:320:9:
 warning: double-‘free’ of ‘modifiers’ [CWE-415] [-Wanalyzer-double-free]
[...]
           │  732 |│        free(*modifiers);
           │      |│        ~~~~~~~~~~~~~~~~
           │      |│        |
           │      |└───────>(25) ...to here
           │      |         (26) first ‘free’ here
[...]
    │  320 |         free(modifiers);
    │      |         ~~~~~~~~~~~~~~~
    │      |         |
    │      |         (28) ⚠️  second ‘free’ here; first ‘free’ was at (26)

Fixes: cef12efc1 ("glamor: Implement GetSupportedModifiers")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2094>
2025-11-04 14:25:07 -08:00
Alan Coopersmith
6a4ec30af4 glamor: avoid null dereference in glamor_composite_clipped_region()
Reported in #1817:

xwayland-24.1.6/redhat-linux-build/../glamor/glamor_render.c:1577:21:
 warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2094>
2025-11-04 14:25:07 -08:00