Subject: Re: RedHat finds a 'serious bug' in fvwm2? (fwd) (fwd)

From: Dominik Vogt <[email-masked]>
Date: Sat, 2 Jan 1999 07:31:48 +0100

On Fri, Dec 18, 1998 at 12:30:39PM +0000, [email-masked] wrote:
> This is the bug Red Hat found and fixed.
> 
> Can someone try and reproduce this?
> 
> Austin
> 
> ------- start of forwarded message (RFC 934 encapsulation) -------
> From: Cristian Gafton <[email-masked]>
> To: Alan Cox <[email-masked]>
> cc: Austin Donnelly <[email-masked]>
> Subject: Re: RedHat finds a 'serious bug' in fvwm2? (fwd)
> Date: Thu, 17 Dec 1998 14:58:45 -0500 (EST)
> 
> On Thu, 17 Dec 1998, Alan Cox wrote:
> 
> > > Alan, could you let us (Debian and the fvwm-workers team) know what
> > > the Red Hat fvwm2 bug was?  Is it security-related (a la /tmp usage
> > > from several years ago).
> 
> It was not a security bug, it was a stupid bug where fvwm2 will completely
> crash because move_window or resize_window functions can be called for an
> unexisiting window. Somehow our setup triggered those before fvwm2 will
> have any chance to give focus to an valid open window, causeing a
> segfault.

Can I get my hands on the patch for this somehow?

Bye

Dominik

-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 6 Jan 1999 23:41:14 +0100

> Can I get my hands on the patch for this somehow?

No answer is an answer too. Let's try it another way:
If Red Hat has this fixed it must be visible in the
code. Could anybody with a Red Hat distribution and
fvwm2.0.46 see if there are any patches distributed
with the source (and send it to me)? Or if not, tar
the code in the fvwm/fvwm directory?

Bye

Dominik

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]

---

From: Kent Howard <[email-masked]>
Date: Wed, 6 Jan 1999 17:31:17 -0800

On Wed, Jan 06, 1999 at 11:41:14PM +0100, Dominik Vogt wrote:
+----------
| > > It was not a security bug, it was a stupid bug where fvwm2 will completely
| > > crash because move_window or resize_window functions can be called for an
| > > unexisiting window. Somehow our setup triggered those before fvwm2 will
| > > have any chance to give focus to an valid open window, causeing a
| > > segfault.
| > 
| > Can I get my hands on the patch for this somehow?
| 
| No answer is an answer too. Let's try it another way:
| If Red Hat has this fixed it must be visible in the
| code. Could anybody with a Red Hat distribution and
| fvwm2.0.46 see if there are any patches distributed
| with the source (and send it to me)? Or if not, tar
| the code in the fvwm/fvwm directory?
+----------

Just downloaded the SRPM and took a look at the patches.
I think this is it.

- Kent

--- fvwm-2.0.46/fvwm/functions.c.bad	Fri Dec 11 14:33:09 1998
+++ fvwm-2.0.46/fvwm/functions.c	Fri Dec 11 14:46:46 1998
@@ -224,7 +224,8 @@
   if (bif)
   {
     matched = TRUE;
-    bif->action(eventp,w,tmp_win,context,action,&Module);
+/*     if (tmp_win != NULL) */
+	bif->action(eventp,w,tmp_win,context,action,&Module);
   }
 
   if(!matched)
--- fvwm-2.0.46/fvwm/resize.c.bad	Fri Dec 11 15:02:10 1998
+++ fvwm-2.0.46/fvwm/resize.c	Fri Dec 11 15:11:03 1998
@@ -56,6 +56,9 @@
   if (DeferExecution(eventp,&w,&tmp_win,&context, MOVE, ButtonPress))
     return;
   
+  if (tmp_win == NULL)
+      return;
+  
   if(check_allowed_function2(F_RESIZE,tmp_win) == 0
 #ifdef WINDOWSHADE
      || (tmp_win->buttons & WSHADE)
--- fvwm-2.0.46/fvwm/move.c.bad	Fri Dec 11 15:02:51 1998
+++ fvwm-2.0.46/fvwm/move.c	Fri Dec 11 15:03:48 1998
@@ -45,6 +45,9 @@
   if (DeferExecution(eventp,&w,&tmp_win,&context, MOVE,ButtonPress))
     return;
 
+  if (tmp_win == NULL)
+      return;
+  
   /* gotta have a window */
   w = tmp_win->frame;
   if(tmp_win->flags & ICONIFIED)
--- fvwm-2.0.46/fvwm/builtins.c.bad	Fri Dec 11 15:04:00 1998
+++ fvwm-2.0.46/fvwm/builtins.c	Fri Dec 11 15:06:34 1998
@@ -69,7 +69,7 @@
 
   original_w = *w;
 
-  if((*context != C_ROOT)&&(*context != C_NO_CONTEXT))
+  if((*context != C_ROOT) && (*context != C_NO_CONTEXT) && (*tmp_win != NULL))
   {
     if((FinishEvent == ButtonPress)||((FinishEvent == ButtonRelease) &&
                                       (eventp->type != ButtonPress)))

---

From: Michael M Han <[email-masked]>
Date: Wed, 06 Jan 1999 22:39:13 -0800

Previously...
>the code in the fvwm/fvwm directory?

Kent already posted what looks very much like the fix in question. I
noticed in the same package though, that there are several patches
that don't look like they were ever submitted back to fvwm-workers. I
extracted all the patches and put them in my anonymous ftp at
ftp://shell7.ba.best.com/pub/mikehan/ if anyone wants to take a look.
I see that they patch 2.0.46 w/ anim-shade and balloons, but I didn't
recognize the other patches.
_________
mike ([email-masked])
I will not yell "fire" in a crowded classroom
 - The collected wisdom of Bart Simpson
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 7 Jan 1999 09:07:57 +0100

> recognize the other patches.

Thanks to you both, Kent and Mike. I'll take care of these patches.

Bye

Dominik

---

From: [email-masked] (Peter Funk)
Date: Thu, 7 Jan 1999 09:16:40 +0100 (MET)

Hello!

> the code in the fvwm/fvwm directory?

I just grabbed the RedHat 5.1 CDs from my sideboard, since
I am currently running SuSE... The fvwm2-2.0.46-10.src.rpm
on RedHat 5.1 CD 2 contains the following files:

fvwm-2.0.46-anim_shade.patch
fvwm-2.0.46-balloon.patch
fvwm-2.0.46-bugs.patch
fvwm-2.0.46-fixes.patch
fvwm-2.0.46-form.patch
fvwm-2.0.46-fvwm2rc.sample
fvwm-2.0.46-iconboxes.patch
fvwm-2.0.46-ks.patch
fvwm-2.0.46-misc.patch
fvwm-2.0.46-rh.patch
fvwm-2.0.46-taskbar.patch
fvwm-2.0.46-wharf.patch
fvwm-2.0.46.icons.tar.gz
fvwm-2.0.46.tar.gz
fvwm2-2.0.46.spec

The .spec-File applies these patches in the following order:
%prep
%setup -n fvwm-2.0.46 -a 1
%patch0 -p1 -b .balloon
%patch1 -p1 -b .rh
%patch2 -p1 -b .fixes
%patch3 -p1 -b .taskbar
%patch4 -p1 -b .form
%patch5 -p0 -b .ks
%patch6 -p1 -b .shade
%patch7 -p0 -b .bugs
%patch8 -p0 -b .iconbox
%patch9 -p0 -b .wharf
%patch10 -p1 -b .misc

I could mail the *patch-files and the .spec file to the list or
directly to Dominik or to anyone interested.  But since these
files are also available on the red hat ftp server, this does
not make much sense?  So what should I do?  I've no write access
to the fvwm directory, or have I missed something?

Regards, Peter
-- 
Peter Funk, Oldenburger Str.86, 27777 Ganderkesee, Tel: 04222 9502 70, Fax: -60
Microsoft does have a year 2000 problem. I am part of it. I am running Linux.
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 7 Jan 1999 09:42:40 +0100

On Thu, Jan 07, 1999 at 09:16:40AM +0100, [email-masked] wrote:
> ...

It would be nice if you mailed the patches to my private
mail address: [email-masked]
That saves me some time.

Thanks

Dominik

---

From: Kent Howard <[email-masked]>
Date: Thu, 7 Jan 1999 01:15:43 -0800

On Thu, Jan 07, 1999 at 09:16:40AM +0100, Peter Funk wrote:
+----------
| Dominik Vogt:
| > > Can I get my hands on the patch for this somehow?
| > 
| > No answer is an answer too. Let's try it another way:
| > If Red Hat has this fixed it must be visible in the
| > code. Could anybody with a Red Hat distribution and
| > fvwm2.0.46 see if there are any patches distributed
| > with the source (and send it to me)? Or if not, tar
| > the code in the fvwm/fvwm directory?
| 
| I just grabbed the RedHat 5.1 CDs from my sideboard, since
| I am currently running SuSE... The fvwm2-2.0.46-10.src.rpm
| on RedHat 5.1 CD 2 contains the following files:
+----------

This source-RPM is the old one before the 'bad' patch was
applied.  As far as I could tell the most recent source-RPM is

fvwm2-2.0.46-12.src.rpm

which is two versions newer than the one on the CD you have.  It
can be found on updates.redhat.com.

- Kent