Bug 345131 - VUL-0: xorg-x11-server: X Server MIT-SHM Extension Integer Overflow Vulnerability [IDEF2904]
Summary: VUL-0: xorg-x11-server: X Server MIT-SHM Extension Integer Overflow Vulnerabi...
Status: RESOLVED FIXED
: 354593 354615 354930 354946 354952 354954 354974 355006 355083 355127 355239 355512 355564 355928 (view as bug list)
Alias: None
Product: openSUSE 11.0
Classification: openSUSE
Component: X.Org (show other bugs)
Version: Alpha 2
Hardware: Other Other
: P1 - Urgent : Critical with 15 votes (vote)
Target Milestone: ---
Assignee: Security Team bot
QA Contact: E-mail List
URL:
Whiteboard: CVE-2007-6429: CVSS v2 Base Score: 9....
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-30 08:13 UTC by Thomas Biege
Modified: 2009-10-14 00:20 UTC (History)
29 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
pub_Multiple Vendor X Server MIT-SHM Extension Integer Overflow Vulnerability.txt (4.66 KB, text/plain)
2007-11-30 08:13 UTC, Thomas Biege
Details
Screenshot of broken icewm decorations (41.67 KB, image/jpeg)
2008-01-23 11:04 UTC, Friedrich Delgado Friedrichs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Biege 2007-11-30 08:13:44 UTC
Created attachment 185373 [details]
pub_Multiple Vendor X Server MIT-SHM Extension Integer Overflow Vulnerability.txt

iDefense Vendor Notification [IDEF2904]
Comment 2 Stefan Dirsch 2007-11-30 12:24:31 UTC
Any fix available?
Comment 4 Sebastian Krahmer 2007-12-18 09:41:03 UTC
Freedesktop.org has made a bug-entry with test-case:

http://bugs.freedesktop.org/show_bug.cgi?id=13520

I dont have an account though.
Comment 5 Stefan Dirsch 2007-12-18 10:02:44 UTC
Thanks. I've added myself to Cc of this upstream bugreport. There's even a proposal for a fix attached to this bugreport.
Comment 7 Marcus Meissner 2007-12-22 16:48:45 UTC
CVE-2007-6429 - EVI and MIT-SHM integer overflows
Comment 15 Thomas Biege 2008-01-17 14:26:20 UTC
updates released
Comment 16 Ludwig Nussel 2008-01-18 13:03:45 UTC
made bug public
Comment 18 Marcus Meissner 2008-01-18 21:26:15 UTC
Ludwig Nussel wrote:
> Hi,
>
> After we've released packages for CVE-2007-6429 we've got reports  
> that older versions of xine-ui, vlc and (not yet confirmed) eclipse
> fail now due to the new SHM size checks. Anyone got reports for
> other programs too?
> 

Yes see the bug reports cited by Julien Cristau :
http://lists.freedesktop.org/archives/xorg/2008-January/031979.html

I'm currently trying to figure out exactly what test fails and will
propose a better patch... 

--
Matthieu Herrb
Comment 19 Marcus Meissner 2008-01-18 21:26:41 UTC
From: Kees Cook <kees@ubuntu.com>

On Fri, Jan 18, 2008 at 03:55:26PM +0100, Ludwig Nussel wrote:
> After we've released packages for CVE-2007-6429 we've got reports
> that older versions of xine-ui, vlc and (not yet confirmed) eclipse
> fail now due to the new SHM size checks. Anyone got reports for
> other programs too?

Java (SWT), AMule, Xara, things wxwidget-based:

https://bugs.launchpad.net/ubuntu/+bug/183969
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=461410

Ubuntu is already in progress of reverting the entire patch set.

Likely suspect is:

+    unsigned long size;
...
+    size = PixmapBytePad(width, depth) * height;
+    if (sizeof(size) == 4) {
+       if (size < width * height)
+           return BadAlloc;
+       /* thankfully, offset is unsigned */
+       if (stuff->offset + size < size)
+           return BadAlloc;
+    }

-Kees

--
Kees Cook
Comment 20 Marcus Meissner 2008-01-18 21:27:07 UTC
On Fri, Jan 18, 2008 at 08:37:47AM -0800, Kees Cook wrote:
> On Fri, Jan 18, 2008 at 03:55:26PM +0100, Ludwig Nussel wrote:
> > After we've released packages for CVE-2007-6429 we've got reports
> > that older versions of xine-ui, vlc and (not yet confirmed) eclipse
> > fail now due to the new SHM size checks. Anyone got reports for
> > other programs too?
>
> Java (SWT), AMule, Xara, things wxwidget-based:
>
> https://bugs.launchpad.net/ubuntu/+bug/183969
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=461410
>
> Ubuntu is already in progress of reverting the entire patch set.
>
> Likely suspect is:
>
> +    unsigned long size;
> ...
> +    size = PixmapBytePad(width, depth) * height;
> +    if (sizeof(size) == 4) {
> +       if (size < width * height)
> +           return BadAlloc;
> +       /* thankfully, offset is unsigned */
> +       if (stuff->offset + size < size)
> +           return BadAlloc;
> +    }

Two things are wrong here:

1) PixmapBytePad uses "depth" is is not validated (it is used as an
array index).  This test needs to move below the depth validation
section.

#define PixmapBytePad(w, d) \
(PixmapWidthInPadUnits(w, d) << PixmapWidthPaddingInfo[d].padBytesLog2)

2) width * height doesn't seem to be the right test.  The failure seen
with azureus is:
ProcShmCreatePixmap (size < width * height) size: 12288 width: 1536 height: 64


--
Kees Cook
Comment 21 Marcus Meissner 2008-01-18 21:27:46 UTC
On Fri, Jan 18, 2008 at 10:19:53AM -0800, Kees Cook wrote:
> Two things are wrong here:
>
> 1) PixmapBytePad uses "depth" is is not validated (it is used as an
> array index).  This test needs to move below the depth validation
> section.
>
> #define PixmapBytePad(w, d) \
> (PixmapWidthInPadUnits(w, d) << PixmapWidthPaddingInfo[d].padBytesLog2)
>
> 2) width * height doesn't seem to be the right test.  The failure seen
> with azureus is:
> ProcShmCreatePixmap (size < width * height) size: 12288 width: 1536 height: 64

Upstream has fixed[1] these issues, and I've also verified that it works
correctly again.

-Kees

[1] http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=commitdiff;h=e9fa7c1c88a8130a48f772c92b186b8b777986b5

--
Kees Cook
Comment 22 Stefan Dirsch 2008-01-18 21:31:53 UTC
*** Bug 354615 has been marked as a duplicate of this bug. ***
Comment 23 Stefan Dirsch 2008-01-18 21:32:10 UTC
*** Bug 354593 has been marked as a duplicate of this bug. ***
Comment 24 Stefan Dirsch 2008-01-19 04:30:25 UTC
*** Bug 354930 has been marked as a duplicate of this bug. ***
Comment 25 Stefan Dirsch 2008-01-19 11:22:03 UTC
*** Bug 354946 has been marked as a duplicate of this bug. ***
Comment 26 Claudio Gregorio 2008-01-19 14:57:43 UTC
*** Bug 354954 has been marked as a duplicate of this bug. ***
Comment 27 Dominique Leuenberger 2008-01-19 15:14:30 UTC
That's the patch used in Debian systems.

http://security.debian.org/pool/updates/main/x/xorg-server/xorg-server_1.1.1-21etch3.diff.gz

This one seems not to break applications.
Comment 28 Marcus Meissner 2008-01-19 15:50:26 UTC
*** Bug 354952 has been marked as a duplicate of this bug. ***
Comment 29 Hans-Peter Jansen 2008-01-19 16:53:25 UTC
Now that I'm sensible for the problem, I remembered suffering from regular
nspluginviewer crashes lately. Some .xsession-errors extract:

Flash Player: Warning: environment variable G_FILENAME_ENCODING is set and is not UTF-8

(process:9039): GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed, use g_type_init() prior to this
 function

(process:9039): Gtk-CRITICAL **: gtk_clipboard_get_for_display: assertion `GDK_IS_DISPLAY (display)' failed
Adobe Flash Player: gtk_clipboard_get(GDK_SELECTION_PRIMARY); failed. Trying to call gtk_init(0,0);
The program '<unknown>' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 84 error_code 3 request_code 18 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
DCOP aborting call from 'konqueror-6220' to 'nspluginviewer-6220'
KCrash: Application 'nspluginviewer' crashing...
X Error: BadWindow (invalid Window parameter) 3
  Major opcode:  19
  Minor opcode:  0
  Resource id:  0x2400008
Flash Player: Warning: environment variable G_FILENAME_ENCODING is set and is not UTF-8

(process:9060): GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed, use g_type_init() prior to this
 function

(process:9060): Gtk-CRITICAL **: gtk_clipboard_get_for_display: assertion `GDK_IS_DISPLAY (display)' failed
Adobe Flash Player: gtk_clipboard_get(GDK_SELECTION_PRIMARY); failed. Trying to call gtk_init(0,0);
The program '<unknown>' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 84 error_code 3 request_code 18 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
DCOP aborting call from 'konqueror-6220' to 'nspluginviewer-6220'
KCrash: Application 'nspluginviewer' crashing...
Unable to start Dr. Konqi

Happens with:
flash-player-9.0.115.0-0.1
xorg-x11-server-7.2-30.8

Could those be related?
Comment 30 Stefan Dirsch 2008-01-19 17:17:49 UTC
Yes, this could well be.
Comment 31 Hans-Peter Jansen 2008-01-19 17:37:46 UTC
Okay, I'm going to revert to factory xorg this evening (when the kids are in bed) and call back with the outcome..
Comment 32 Hans-Peter Jansen 2008-01-19 20:36:29 UTC
That one seems to be a red herring, since firefox doesn't suffer from this:

therefor https://bugzilla.novell.com/show_bug.cgi?id=354960 added..

Sorry for the noise.
Comment 33 andrea florio 2008-01-20 08:49:56 UTC
any fix found??

ubuntu seem to had yet fixed that problem..

i found that link:

https://bugs.edge.launchpad.net/ubuntu/+source/xorg/+bug/183969
Comment 34 Stefan Dirsch 2008-01-20 13:11:48 UTC
See comment #21.
Comment 35 Stefan Dirsch 2008-01-20 13:29:00 UTC
*** Bug 354974 has been marked as a duplicate of this bug. ***
Comment 36 Stefan Dirsch 2008-01-20 13:31:02 UTC
Temporary workaround via /etc/X11/xorg.conf:

Section "Extensions"
      Option "MIT-SHM" "no"
EndSection

Disabling this extension degrades X performance so it is *not* a solution.
Comment 37 Stefan Dirsch 2008-01-20 19:48:37 UTC
Unofficial fixed packages for 10.2/10.3 will be soon availabe via
  
  http://beta.suse.com/private/sndirsch/bug345131/
Comment 38 Stefan Dirsch 2008-01-20 22:36:11 UTC
*** Bug 355006 has been marked as a duplicate of this bug. ***
Comment 42 Thomas Schmidt 2008-01-21 11:36:53 UTC
*** Bug 355083 has been marked as a duplicate of this bug. ***
Comment 44 Joern Allmers 2008-01-21 16:42:26 UTC
the fix from #37 works for me. 

thanks!

j.
Comment 45 Stefan Dirsch 2008-01-21 17:17:29 UTC
*** Bug 355127 has been marked as a duplicate of this bug. ***
Comment 46 Hugo Garcia 2008-01-21 20:47:19 UTC
+1 on fix works for me. SuSE 10.3, SuSE Java 1.6, downloaded Eclipse 3.3.x
Comment 47 Robert Ish 2008-01-21 23:04:44 UTC
Package from comment #37 works for me. I'm using OpenSuse 10.3 my problem with VLC
crashing my system after the xorg update of 1/17/08 is fixed. Thank you for the package.
Comment 51 Tamás Cservenák 2008-01-23 02:54:02 UTC
+1 on fix from comment #37, it solved the problem for me too.

openSuse 10.3 on i686, tested with both suse packaged Sun JDK 1.5 and Sun JDK 1.6 + Eclipse 3.3.x and packman packaged Azureus, all works now perfectly. Thanks!
Comment 52 Stefan Dirsch 2008-01-23 06:22:23 UTC
*** Bug 355512 has been marked as a duplicate of this bug. ***
Comment 53 Dominique Leuenberger 2008-01-23 08:38:08 UTC
How long will it approx. take until we can push out fixed packages? I see complains all over falling down.

At least an 'update' to the previous version should be considered to offer a short-term solution to the end-user that is struggling with different non-working programs.
Comment 54 Matthew Horsnell 2008-01-23 08:42:11 UTC
the fix in comment #37 works for me also. (opensuse 10.3, i386, tested with Eclipse).

Thanks!

Comment 55 Stefan Dirsch 2008-01-23 09:56:25 UTC
Dominique, fixed packages have already been checked in, so QA can test them now. An update should be available shortly. For now you can use the packages mentioned in comment #37.
Comment 56 Dominique Leuenberger 2008-01-23 10:01:39 UTC
Thank you Stefan... 

it was less an issue for me; After all I follow the bug and know about the case... I was more worried for 99% of the users that do not follow here; but the packages from comment #37 are normally what I suggest so far too... but not every average user feels comfortable with it (understandable)
Comment 57 Stefan Dirsch 2008-01-23 10:22:17 UTC
*** Bug 355564 has been marked as a duplicate of this bug. ***
Comment 58 Friedrich Delgado Friedrichs 2008-01-23 10:59:41 UTC
icewm has broken window decoration since the latest xorg update as well
Comment 59 Friedrich Delgado Friedrichs 2008-01-23 11:04:19 UTC
Created attachment 191464 [details]
Screenshot of broken icewm decorations
Comment 65 Ludwig Nussel 2008-01-23 16:43:33 UTC
I've released the openSUSE updates now based on preliminary qa results. Hopefully they don't cause more breakage than there already is :-)
Comment 66 Stefan Dirsch 2008-01-23 16:55:08 UTC
*** Bug 355239 has been marked as a duplicate of this bug. ***
Comment 67 Friedrich Delgado Friedrichs 2008-01-24 12:31:50 UTC
Both icewm and eclipse look fixed now.
Comment 68 Stefan Dirsch 2008-01-24 14:01:06 UTC
*** Bug 355928 has been marked as a duplicate of this bug. ***
Comment 69 Ludwig Nussel 2008-01-28 10:09:40 UTC
all packages released now
Comment 70 Thomas Biege 2009-10-14 00:20:21 UTC
CVE-2007-6429: CVSS v2 Base Score: 9.3 (AV:N/AC:M/Au:N/C:C/I:C/A:C)