xserver/Xext
Peter Hutterer 842ca3ccef Xext: free the screen saver resource when replacing it
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: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2022-12-14 11:02:40 +10:00
..
bigreq.c
dpms.c
dpmsproc.h
geext.c More missing version checks in SProcs 2021-08-08 12:43:01 +00:00
geext.h
geint.h
hashtable.c
hashtable.h Fix spelling/wording issues 2020-07-05 13:07:33 -07:00
meson.build meson: hide C API if Xorg is disabled (like autotools) 2021-03-11 00:22:36 +00:00
panoramiX.c
panoramiX.h
panoramiXSwap.c
panoramiXh.h
panoramiXprocs.c
panoramiXsrv.h
saver.c Xext: free the screen saver resource when replacing it 2022-12-14 11:02:40 +10:00
security.c
securitysrv.h
shape.c
shm.c os, shm: fcntl()'s third argument is integer, not pointer 2020-12-18 09:36:30 -05:00
shmint.h
sleepuntil.c
sleepuntil.h
sync.c
syncsdk.h
syncsrv.h
vidmode.c Fix spelling/wording issues 2020-07-05 13:07:33 -07:00
xace.c
xace.h
xacestr.h
xcmisc.c
xf86bigfont.c
xf86bigfontsrv.h
xres.c Fix spelling/wording issues 2020-07-05 13:07:33 -07:00
xselinux.h
xselinux_ext.c selinux: Stop using security_context_t 2021-08-17 16:02:39 -04:00
xselinux_hooks.c selinux: Stop using security_context_t 2021-08-17 16:02:39 -04:00
xselinux_label.c selinux: Stop using security_context_t 2021-08-17 16:02:39 -04:00
xselinuxint.h selinux: Stop using security_context_t 2021-08-17 16:02:39 -04:00
xtest.c Xtest: disallow GenericEvents in XTestSwapFakeInput 2022-12-12 10:55:49 +10:00
xvdisp.c
xvdisp.h
xvdix.h
xvmain.c Xext: free the XvRTVideoNotify when turning off from the same client 2022-12-14 11:02:06 +10:00
xvmc.c
xvmcext.h