Subject: Re: Re: [X2Go-Dev] Bug#776: nx-X11: Size of pointer 'server_support' used instead of size of its data

From: "Heinrich Schuchardt" <[email-masked]>
Date: Sat, 31 Jan 2015 22:24:24 +0100

Hello Mike,

when I look at nx-libs it seems that nomachine once copied a lot of xorg packages added the nx part and afterwards the xorg libraries were never updated.

In the last year a lot of security relevant errors were discovered and fixed in the x-server code. What is the policy of the x2go project? Do you want to rebase the nx-libs package on current xorg code? Do you plan to support Wayland which will be replacing x11?

Best regards

Heinrich Schuchardt

http://www.xypron.de

Mike Gabriel <[email-masked]>schrieb:

Hi Heinrich,

On Fr 30 Jan 2015 20:29:51 CET, Heinrich Schuchardt wrote:

> package: nx-libs

> version: head

> In nx-libs/nx-X11/extras/Mesa/src/glx/x11/glxextensions.c

> the length of the zeroed memory is the length of the pointer (4 bytes in

> case of a 32bit system) not the length of the data the pointer points to

> (8 byte).

> static void

> __glXProcessServerString( const struct extension_info * ext,

> const char * server_string,

> unsigned char * server_support )

> {

> unsigned base;

> unsigned len;

> (void) memset( server_support, 0, sizeof( server_support ) );

> Furthermore the length of the memory area pointed to by server_support

> is defined in varying ways in the coding:

> #define __GL_EXT_BYTES ((__NUM_GL_EXTS + 7) / 8)

> unsigned char server_support[ __GL_EXT_BYTES ];

> unsigned char server_support[8];

> Currently __NUM_GL_EXTS = 123, so __GL_EXT_BYTES = 8.

> What is expected to happen if __GL_EXT_BYTES > 8 after defining six more

> values in the unamed (sic!) enum with the different bits?

> This questionable code was identified with cppcheck.

> http://cppcheck.sourceforge.net/

> Best regards

> Heinrich Schuchardt

Now that you have analyzed it, do you see a chance for coming up with patch?

THANKS+GREETS,

Mike

--

DAS-NETZWERKTEAM

mike gabriel, herweg 7, 24357 fleckeby

fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31

mail: [email-masked], http://das-netzwerkteam.de

freeBusy:

https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb

---

From: Mihai Moldovan <[email-masked]>
Date: Sun, 01 Feb 2015 06:37:18 +0100

If I may...

On 31.01.2015 10:24 PM, Heinrich Schuchardt wrote:
> In the last year a lot of security relevant errors were discovered and
> fixed in the x-server code. What is the policy of the x2go project? Do
> you want to rebase the nx-libs package on current xorg code? Do you
> plan to support Wayland which will be replacing x11?

The long-term goal is to rebase nx-libs against current Xorg code and
have it even potentially merged upstream. This will however require a
lot of funding or alternatively time. We discussed this issue to great
length during the last X2Go meeting in October/November 2014.

Meanwhile, Mike is currently factoring out a lot of dead code which has
been copied verbatim by NoMachine, but is not actually used for building
nx-libs. And doing a tremendous job at that.

Mihai