From 53a0a47b87986eace410addd1af546e7f6925423 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 22 Jun 2014 09:07:56 +0200 Subject: renmae patch 057 --- ...11-bigendian-ppc64-no-session-window.full.patch | 70 ---------------------- .../057_nx-X11_sanitize-eventmasks.full.patch | 70 ++++++++++++++++++++++ debian/patches/series | 2 +- 3 files changed, 71 insertions(+), 71 deletions(-) delete mode 100644 debian/patches/057_nx-X11-bigendian-ppc64-no-session-window.full.patch create mode 100644 debian/patches/057_nx-X11_sanitize-eventmasks.full.patch diff --git a/debian/patches/057_nx-X11-bigendian-ppc64-no-session-window.full.patch b/debian/patches/057_nx-X11-bigendian-ppc64-no-session-window.full.patch deleted file mode 100644 index 901aba61d..000000000 --- a/debian/patches/057_nx-X11-bigendian-ppc64-no-session-window.full.patch +++ /dev/null @@ -1,70 +0,0 @@ -Description: No session window with on PPC64 builds -Author: Mihai Moldovan -Abstract: - Multiple endiannes issues were setting incorrect event masks when creating and - drawing X11 windows. - . - This time, a smaller integer has been casted to a bigger one and passed to some - function actually setting its value. - . - This meant, that garbage from stack was attached to the smaller integer value, - putting unknown memory into the lower bytes of the bigger integer. - . - Fix this by creating a big, initialized temporary variable, let the function do - its magic on that one and pass the value back to the smaller variable--and - cross your fingers the smaller variable can hold it without overrunning. (The - last bit is a design issue we can't really fix and has been around even before - this patch.) - ---- a/nx-X11/programs/Xserver/hw/nxagent/Window.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c -@@ -327,7 +327,10 @@ - - if (mask & CWEventMask) - { -- nxagentGetEventMask(pWin, (Mask*)&attributes.event_mask); -+ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ -+ Mask tmp_mask = attributes.event_mask; -+ nxagentGetEventMask(pWin, &tmp_mask); -+ attributes.event_mask = (int)tmp_mask; - } - #ifdef WARNING - else -@@ -2891,7 +2894,10 @@ - - if (mask & CWEventMask) - { -- nxagentGetEventMask(pWin, (Mask*)&attributes.event_mask); -+ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ -+ Mask tmp_mask = attributes.event_mask; -+ nxagentGetEventMask(pWin, &tmp_mask); -+ attributes.event_mask = (int)tmp_mask; - } - #ifdef WARNING - else -@@ -3352,7 +3358,10 @@ - - if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin)) - { -- nxagentGetEventMask(pWin, (Mask*)&attributes.event_mask); -+ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ -+ Mask tmp_mask = attributes.event_mask; -+ nxagentGetEventMask(pWin, &tmp_mask); -+ attributes.event_mask = (int)tmp_mask; - - XChangeWindowAttributes(nxagentDisplay, nxagentWindow(pWin), mask, &attributes); - } ---- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c -+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c -@@ -1665,7 +1665,10 @@ - - attributes.background_pixel = nxagentBlackPixel; - -- nxagentGetDefaultEventMask((Mask*)&attributes.event_mask); -+ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ -+ Mask tmp_mask = attributes.event_mask; -+ nxagentGetDefaultEventMask(&tmp_mask); -+ attributes.event_mask = (int)tmp_mask; - - attributes.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen)); - diff --git a/debian/patches/057_nx-X11_sanitize-eventmasks.full.patch b/debian/patches/057_nx-X11_sanitize-eventmasks.full.patch new file mode 100644 index 000000000..901aba61d --- /dev/null +++ b/debian/patches/057_nx-X11_sanitize-eventmasks.full.patch @@ -0,0 +1,70 @@ +Description: No session window with on PPC64 builds +Author: Mihai Moldovan +Abstract: + Multiple endiannes issues were setting incorrect event masks when creating and + drawing X11 windows. + . + This time, a smaller integer has been casted to a bigger one and passed to some + function actually setting its value. + . + This meant, that garbage from stack was attached to the smaller integer value, + putting unknown memory into the lower bytes of the bigger integer. + . + Fix this by creating a big, initialized temporary variable, let the function do + its magic on that one and pass the value back to the smaller variable--and + cross your fingers the smaller variable can hold it without overrunning. (The + last bit is a design issue we can't really fix and has been around even before + this patch.) + +--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c +@@ -327,7 +327,10 @@ + + if (mask & CWEventMask) + { +- nxagentGetEventMask(pWin, (Mask*)&attributes.event_mask); ++ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ ++ Mask tmp_mask = attributes.event_mask; ++ nxagentGetEventMask(pWin, &tmp_mask); ++ attributes.event_mask = (int)tmp_mask; + } + #ifdef WARNING + else +@@ -2891,7 +2894,10 @@ + + if (mask & CWEventMask) + { +- nxagentGetEventMask(pWin, (Mask*)&attributes.event_mask); ++ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ ++ Mask tmp_mask = attributes.event_mask; ++ nxagentGetEventMask(pWin, &tmp_mask); ++ attributes.event_mask = (int)tmp_mask; + } + #ifdef WARNING + else +@@ -3352,7 +3358,10 @@ + + if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin)) + { +- nxagentGetEventMask(pWin, (Mask*)&attributes.event_mask); ++ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ ++ Mask tmp_mask = attributes.event_mask; ++ nxagentGetEventMask(pWin, &tmp_mask); ++ attributes.event_mask = (int)tmp_mask; + + XChangeWindowAttributes(nxagentDisplay, nxagentWindow(pWin), mask, &attributes); + } +--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c +@@ -1665,7 +1665,10 @@ + + attributes.background_pixel = nxagentBlackPixel; + +- nxagentGetDefaultEventMask((Mask*)&attributes.event_mask); ++ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ ++ Mask tmp_mask = attributes.event_mask; ++ nxagentGetDefaultEventMask(&tmp_mask); ++ attributes.event_mask = (int)tmp_mask; + + attributes.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen)); + diff --git a/debian/patches/series b/debian/patches/series index ad78912c7..1a62270d3 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -33,7 +33,7 @@ 054_nx-X11_ppc64-ftbfs.full.patch 055_nx-X11_imake-Werror-format-security.full.patch 056_nx-X11-Werror-format-security.full.patch -057_nx-X11-bigendian-ppc64-no-session-window.full.patch +057_nx-X11_sanitize-eventmasks.full.patch 101_nxagent_set-rgb-path.full.patch 102_xserver-xext_set-securitypolicy-path.full.patch 103_nxagent_set-X0-config-path.full.patch -- cgit v1.2.3