Package: nx-libs / 2:3.5.99.19-3+deb10u2

Metadata

Package Version Patches format
nx-libs 2:3.5.99.19-3+deb10u2 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
0001_nxagent Determine nxagentProgName only once.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/Args.c | 28 21 + 7 - 0 !
nx-X11/programs/Xserver/hw/nxagent/Init.c | 7 6 + 1 - 0 !
2 files changed, 27 insertions(+), 8 deletions(-)

 [patch] nxagent: determine nxagentprogname only once

also add TEST prints, init nxagentProgName with NULL and add const
where it was missing.

Fixes ArcticaProject/nx-libs#803

0002_nxdialog bin nxdialog Fix error dialog type not supp.patch | (download)

nxdialog/bin/nxdialog | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 [patch] nxdialog/bin/nxdialog: fix error dialog-type-not-supplied
 error message.

Fixes ArcticaProject/nx-libs#793.

0003_xkbUtils.c Catch division by zero.patch | (download)

nx-X11/programs/Xserver/xkb/xkbUtils.c | 4 4 + 0 - 0 !
1 file changed, 4 insertions(+)

 [patch 1/2] xkbutils.c: catch division by zero

Fixes ArcticaProject/nx-libs#808

0004_libNX_X11 add additional checks for dpy and xkb.patch | (download)

nx-X11/lib/src/xkb/XKBBind.c | 14 14 + 0 - 0 !
1 file changed, 14 insertions(+)

 [patch 2/2] libnx_x11: add additional checks for dpy and xkb

We have seen crashes during session shutdown/connection problems
here. These patches should avoid them. There's no proper way to test
them, but they should do no harm..

Fixes ArcticaProject/nx-libs#801
Fixes https://bugs.x2go.org/cgi-bin/bugreport.cgi?bug=695

0012_xkb initialize tsyms.patch | (download)

nx-X11/programs/Xserver/xkb/xkbUtils.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 [patch 12/53] xkb: initialize tsyms
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Backport of this commit:

  commit b2167015043a458e9cf93b827b43eb5b7c552ce9
0013_Screen.c correctly free stuff in nxagentCloseScreen.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/Screen.c | 18 15 + 3 - 0 !
1 file changed, 15 insertions(+), 3 deletions(-)

 [patch 13/53] screen.c: correctly free stuff in nxagentclosescreen

fixes a memory leak:

==19074== 2 bytes in 1 blocks are definitely lost in loss record 8 of 313
==19074==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==19074==    by 0x1FD83D: fbAllocatePrivates (fballpriv.c:79)
==19074==    by 0x20A666: fbSetupScreen (fbscreen.c:110)
==19074==    by 0x20A666: fbScreenInit (fbscreen.c:300)
==19074==    by 0x1DEA4C: nxagentOpenScreen (Screen.c:1356)
==19074==    by 0x16D7F8: AddScreen (dispatch.c:4257)
==19074==    by 0x1DA0CF: InitOutput (Init.c:397)
==19074==    by 0x14DCC2: main (main.c:280)

0014_Screen.c Fix make sure RRCloseScreen is being called.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/Screen.c | 14 7 + 7 - 0 !
1 file changed, 7 insertions(+), 7 deletions(-)

 [patch 14/53] screen.c: fix: make sure rrclosescreen is being called

Fixes ArcticaProject/nx-libs#598

In nxagentOpenScreen we first initialized the RRExtension for the
screen and then replaced pScreen->CloseScreen by
nxagentCloseScreen. This resulted in RandR's RRCloseScreen (and any
other CloseScreen procedure installed by extensions) being no longer
called.

Moving RandR init after configuring pScreen->CloseScreen ensures the
correct calling cascade:

RRCloseScreen -> nxagentCloseScreen ->fbCloseScreen (called explicitly
by nxagentCloseScreen).

Which in turn will fix this memory leak:

==9688== 328 (312 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 271 of 319
==9688==    at 0x4837B65: calloc (vg_replace_malloc.c:752)
==9688==    by 0x4ED2C6: RRScreenInit (randr.c:329)
==9688==    by 0x1F2B18: nxagentInitRandRExtension (Extensions.c:122)
==9688==    by 0x1DEAFF: nxagentOpenScreen (Screen.c:1409)
==9688==    by 0x16D7F8: AddScreen (dispatch.c:4257)
==9688==    by 0x1DA0CF: InitOutput (Init.c:397)
==9688==    by 0x14DCC2: main (main.c:280)

0015_Keyboard.c nullify freed pointers.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 18 11 + 7 - 0 !
1 file changed, 11 insertions(+), 7 deletions(-)

 [patch 15/53] keyboard.c: nullify freed pointers

While trying to properly free memory allocated by XKB I accidently
called nxagentFreeKeyboardDeviceData twice and noticed it would cause
a segfault here. As the other pointers are also nullified after
being freed let's just do it here, too.

0017_Fix memleaks Free devPrivates of devices on shutdown.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 9 8 + 1 - 0 !
nx-X11/programs/Xserver/hw/nxagent/Pointer.c | 11 9 + 2 - 0 !
2 files changed, 17 insertions(+), 3 deletions(-)

 [patch 17/53] fix memleaks: free devprivates of devices on shutdown

Fixes these two memory leaks identified by valgrind:

==28336== 32 (8 direct, 24 indirect) bytes in 1 blocks are definitely lost in loss record 180 of 308
==28336==    at 0x48356AF: malloc (vg_replace_malloc.c:298)
==28336==    by 0x4837DE7: realloc (vg_replace_malloc.c:826)
==28336==    by 0x1AE322: AllocateDevicePrivate (privates.c:439)
==28336==    by 0x27527B: XkbSetExtension (xkbActions.c:72)
==28336==    by 0x198E9B: _RegisterPointerDevice (devices.c:361)
==28336==    by 0x1DBA35: InitInput (Init.c:440)
==28336==    by 0x14DBD6: main (main.c:303)
==28336==
==28336== 32 (8 direct, 24 indirect) bytes in 1 blocks are definitely lost in loss record 181 of 308
==28336==    at 0x48356AF: malloc (vg_replace_malloc.c:298)
==28336==    by 0x4837DE7: realloc (vg_replace_malloc.c:826)
==28336==    by 0x1AE322: AllocateDevicePrivate (privates.c:439)
==28336==    by 0x27527B: XkbSetExtension (xkbActions.c:72)
==28336==    by 0x198F1B: _RegisterKeyboardDevice (devices.c:384)
==28336==    by 0x1DBA3D: InitInput (Init.c:441)
==28336==    by 0x14DBD6: main (main.c:303)

0018_Screen.c fix another memory leak.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/Screen.c | 16 12 + 4 - 0 !
1 file changed, 12 insertions(+), 4 deletions(-)

 [patch 18/53] screen.c: fix another memory leak

==12280== 0 bytes in 5 blocks are definitely lost in loss record 1 of 304
==12280==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==12280==    by 0x2EFC29: init_visuals (xf86glx.c:489)
==12280==    by 0x2EFC29: __MESA_initVisuals (xf86glx.c:540)
==12280==    by 0x17C902: GlxInitVisuals (glxext.c:317)
==12280==    by 0x218C03: fbInitVisuals (fbcmap.c:668)
==12280==    by 0x20BC41: fbFinishScreenInit (fbscreen.c:229)
==12280==    by 0x20C005: fbScreenInit (fbscreen.c:273)
==12280==    by 0x1E024C: nxagentOpenScreen (Screen.c:1356)
==12280==    by 0x16D828: AddScreen (dispatch.c:4171)
==12280==    by 0x1DB7DF: InitOutput (Init.c:396)
==12280==    by 0x14DB12: main (main.c:279)
==12280==
==12280== 64 bytes in 2 blocks are definitely lost in loss record 223 of 304
==12280==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==12280==    by 0x2EFA05: init_visuals (xf86glx.c:489)
==12280==    by 0x2EFA05: __MESA_initVisuals (xf86glx.c:540)
==12280==    by 0x17C902: GlxInitVisuals (glxext.c:317)
==12280==    by 0x218C03: fbInitVisuals (fbcmap.c:668)
==12280==    by 0x20BC41: fbFinishScreenInit (fbscreen.c:229)
==12280==    by 0x20C005: fbScreenInit (fbscreen.c:273)
==12280==    by 0x1E024C: nxagentOpenScreen (Screen.c:1356)
==12280==    by 0x16D828: AddScreen (dispatch.c:4171)
==12280==    by 0x1DB7DF: InitOutput (Init.c:396)
==12280==    by 0x14DB12: main (main.c:279)

0019_mi miinitext.c fix memleaks remove double glx initia.patch | (download)

nx-X11/programs/Xserver/mi/miinitext.c | 5 1 + 4 - 0 !
1 file changed, 1 insertion(+), 4 deletions(-)

 [patch 19/53] mi/miinitext.c: fix memleaks: remove (double) glx
 initialization

Fix these memory leaks:

==30021== 128 bytes in 1 blocks are definitely lost in loss record 230 of 302
==30021==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==30021==    by 0x2EF89C: init_visuals (xf86glx.c:390)
==30021==    by 0x2EF89C: __MESA_initVisuals (xf86glx.c:541)
==30021==    by 0x17C922: GlxInitVisuals (glxext.c:317)
==30021==    by 0x218E73: fbInitVisuals (fbcmap.c:668)
==30021==    by 0x20BEB1: fbFinishScreenInit (fbscreen.c:229)
==30021==    by 0x20C275: fbScreenInit (fbscreen.c:273)
==30021==    by 0x1E0317: nxagentOpenScreen (Screen.c:1357)
==30021==    by 0x16D848: AddScreen (dispatch.c:4171)
==30021==    by 0x1DB7FF: InitOutput (Init.c:396)
==30021==    by 0x14DB12: main (main.c:279)
==30021==
==30021== 3,072 (192 direct, 2,880 indirect) bytes in 1 blocks are definitely lost in loss record 290 of 302
==30021==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==30021==    by 0x2CCCC7: _gl_context_modes_create (glcontextmodes.c:364)
==30021==    by 0x2EF87C: init_visuals (xf86glx.c:381)
==30021==    by 0x2EF87C: __MESA_initVisuals (xf86glx.c:541)
==30021==    by 0x17C922: GlxInitVisuals (glxext.c:317)
==30021==    by 0x218E73: fbInitVisuals (fbcmap.c:668)
==30021==    by 0x20BEB1: fbFinishScreenInit (fbscreen.c:229)
==30021==    by 0x20C275: fbScreenInit (fbscreen.c:273)
==30021==    by 0x1E0317: nxagentOpenScreen (Screen.c:1357)
==30021==    by 0x16D848: AddScreen (dispatch.c:4171)
==30021==    by 0x1DB7FF: InitOutput (Init.c:396)
==30021==    by 0x14DB12: main (main.c:279)

The problem here is that GlxInitVisuals is called twice. First via
fbScreenInit and then again via nxagentInitGlxExtension. We remove the
first one to ensure the code in nxagenOpenScreen works as initially
intended.

There's an xorg upstream patch that does the same
(7d74690536b64f7b8e8036507ab7790807349c50), but it also cleans up
other stuff we do not even have in out source (yet?).

0023_glxext.c fix another memory leak.patch | (download)

nx-X11/programs/Xserver/GL/glx/glxext.c | 4 1 + 3 - 0 !
1 file changed, 1 insertion(+), 3 deletions(-)

 [patch 23/53] glxext.c: fix another memory leak

==10226== 3,337 bytes in 1 blocks are definitely lost in loss record 295 of 307
==10226==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==10226==    by 0x6281DB9: strdup (strdup.c:42)
==10226==    by 0x2ABA9E: __glXClientInfo (glxcmds.c:2170)
==10226==    by 0x17CA3E: __glXDispatch (NXglxext.c:128)
==10226==    by 0x16EE77: Dispatch (NXdispatch.c:476)
==10226==    by 0x14DCE0: main (main.c:353)

There's no point in trying to free cl->* after memset(0).

This one is a bug that is found identically in xorg upstream and has
only been fixed during rework of the whole client resource freeing
stuff. So we fix it in glxext.c.

0026_glyph.c fix a read beyond end of heap buffer.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/NXglyph.c | 61 61 + 0 - 0 !
nx-X11/programs/Xserver/render/glyph.c | 2 2 + 0 - 0 !
2 files changed, 63 insertions(+)

 [patch 26/53] glyph.c: fix a read beyond end of heap buffer

If compiled with -fsanitize=address this showed up when running startlxde:

==11551==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60d000018fbc at pc 0x7f270a9ed57b bp 0x7fff30ef3050 sp 0x7fff30ef2800
READ of size 204 at 0x60d000018fbc thread T0
    #0 0x7f270a9ed57a  (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xb857a)
    #1 0x559dafcd5c93 in FindGlyphRef ../../render/glyph.c:179
    #2 0x559dafcd705d in AddGlyph /work/nx-libs/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c:71
    #3 0x559dafccc0ff in ProcRenderAddGlyphs ../../mi/../render/render.c:1186
    #4 0x559dafcbd5a5 in ProcRenderDispatch /work/nx-libs/nx-X11/programs/Xserver/hw/nxagent/NXrender.c:1689
    #5 0x559dafcbc4ea in Dispatch /work/nx-libs/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c:476
    #6 0x559dafc4e9b0 in main /work/nx-libs/nx-X11/programs/Xserver/dix/main.c:353
    #7 0x7f2708e1d09a in __libc_start_main ../csu/libc-start.c:308
    #8 0x559dafc4f5d9 in _start (/work/nx-libs/nx-X11/programs/Xserver/nxagent+0x6e5d9)

0x60d000018fbc is located 0 bytes to the right of 140-byte region [0x60d000018f30,0x60d000018fbc)
allocated by thread T0 here:
    #0 0x7f270aa1e330 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
    #1 0x559dafcd646c in AllocateGlyph ../../render/glyph.c:348

This happens when two glyphs are compared via memcmp and the smaller
one happens to be identical to the beginning of the bigger one.

Newer render implementations use a sha1 hash instead of memcmp so this
patch will (hopefully) be obsolete once render gets updated.

0027_Keyboard.c fix three memory leaks.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 4 4 + 0 - 0 !
1 file changed, 4 insertions(+)

 [patch 27/53] keyboard.c: fix three memory leaks

==12976==ERROR: LeakSanitizer: detected memory leaks

0028_Quarks.c add missing.patch | (download)

nx-X11/lib/src/Quarks.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 [patch 28/53] quarks.c: add missing )


0029_dix dispatch fix a small memory leak.patch | (download)

nx-X11/programs/Xserver/dix/dispatch.c | 3 3 + 0 - 0 !
1 file changed, 3 insertions(+)

 [patch 29/53] dix/dispatch: fix a small memory leak


0030_fb fix memory leak in fbOverlayFinishScreenInit.patch | (download)

nx-X11/programs/Xserver/fb/fboverlay.c | 8 6 + 2 - 0 !
1 file changed, 6 insertions(+), 2 deletions(-)

 [patch 30/53] fb: fix memory leak in fboverlayfinishscreeninit

  commit 2aa935bc5cc1e2d5365a97b8c5bb3d33eb5fc758
0031_render Propagate allocation failure from createSourc.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 2 2 + 0 - 0 !
nx-X11/programs/Xserver/render/picture.c | 2 2 + 0 - 0 !
2 files changed, 4 insertions(+)

 [patch 31/53] render: propagate allocation failure from
 createSourcePicture()

  commit 211d4c2d353b5e379716484055a3f58235ea65f4
0032_NXrender fix another memleak.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 6 5 + 1 - 0 !
1 file changed, 5 insertions(+), 1 deletion(-)

 [patch 32/53] nxrender: fix another memleak


0033_Screen.c fix two memleaks.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/Screen.c | 33 18 + 15 - 0 !
1 file changed, 18 insertions(+), 15 deletions(-)

 [patch 33/53] screen.c: fix two memleaks

While at it create and use the freeDepths() helper function.

0034_Screen.c fix two more memleaks of visuals.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/Screen.c | 2 2 + 0 - 0 !
1 file changed, 2 insertions(+)

 [patch 34/53] screen.c: fix two more memleaks of visuals


0036_os access.c add missing.patch | (download)

nx-X11/programs/Xserver/os/access.c | 1 1 + 0 - 0 !
1 file changed, 1 insertion(+)

 [patch 36/53] os/access.c: add missing }


0038_NXdixfonts.c fix index out of bounds.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

 [patch 38/53] nxdixfonts.c: fix index out of bounds


0041_compext Png.c Nullify after free.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/compext/Png.c | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

 [patch 41/53] compext/png.c: nullify after free


0042_mi miexpose.c add missing free.patch | (download)

nx-X11/programs/Xserver/mi/miexpose.c | 3 3 + 0 - 0 !
1 file changed, 3 insertions(+)

 [patch 42/53] mi/miexpose.c: add missing free()


0049_xkb fix what looks to be a copy paste error with fir.patch | (download)

nx-X11/programs/Xserver/xkb/xkb.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 [patch 49/53] xkb: fix what looks to be a copy-paste error with first
 vs firstMM

  commit 758393951233d1b2520cf4cefd33ec4288a3880a
0050_Keyboard.c fix another cppcheck finding.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 3 2 + 1 - 0 !
1 file changed, 2 insertions(+), 1 deletion(-)

 [patch 50/53] keyboard.c: fix another cppcheck finding

[Keyboard.c:559]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour

0051 Screen.c initialize RandR only on startup.patch | (download)

nx-X11/programs/Xserver/hw/nxagent/Screen.c | 12 6 + 6 - 0 !
1 file changed, 6 insertions(+), 6 deletions(-)

 [patch] screen.c: initialize randr only on startup...

... not on reconnect. After the reconnect RRCloseScreen was called
twice which caused a double free. This was introduced with
3b06ad51d91ff2b9442f159cddf34ed03bc2dd35

Fixes ArcticaProject/nx-libs#833

2001_nx X11_install location.debian.patch | (download)

nx-X11/config/cf/Imake.tmpl | 4 2 + 2 - 0 !
nx-X11/config/cf/site.def | 2 1 + 1 - 0 !
2 files changed, 3 insertions(+), 3 deletions(-)

 fhs adaptation for debian packaging
 On Debian, NX libraries and binaries are installed to
 /usr/lib/nx.
2002_xserver xext_set securitypolicy path.debian.patch | (download)

nx-X11/programs/Xserver/Xext/security.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 fhs path fix for securitypolicy file
 This patch is needed on Debian only, not reporting this path
 change to upstream.
 .
 Originally contributed by Marcelo Boveto Shima <marceloshima@gmail.com>.
2003_nxdialog use python3.patch | (download)

nxdialog/bin/nxdialog | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 enforce usage of python3
2004_enforce lpthread.patch | (download)

nxcomp/src/Makefile.am | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 enforce -lpthread when linking nxcomp.