You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Aram Mirzadeh <aw...@luers.qosina.com> on 1997/01/25 16:02:29 UTC

[BUG]: "suexec causes segvs because it tries to free memory never allocated" on Linux (fwd)


no ack.  It looks to be a correct patch for the problem.

steve@hero.com said:
> From nobody@hyperreal.com  Sat Jan 25 02:00:55 1997
> Message-Id: <19...@taz.hyperreal.com>
> From: steve@hero.com
> To: awm@qosina.com
> Date: Fri Jan 24 23:02:02 1997
> Subject: [BUG]: "suexec causes segvs because it tries to free memory never allocated" on Linux
> 
> Submitter: steve@hero.com
> Operating system: Linux, version: 2.0.??
> Version of Apache Used: 1.2b4
> Extra Modules used: referer
> URL exhibiting problem: 
> 
> Symptoms:
> --
> SEGV caused by trying free() strings that were never malloc()
> below is a patch:
> 
> /usr/src/apache_1.2b4 diff support/suexec.c support.patch/suexec.c
> 75a76,78
> > 
> > #include <sys/signal.h> /* need this so we can catch the SEGV caused by freeing memorye did not allocate */
> > 
> 84a88
> > 
> 85a90,94
> > void segvCOOL(){
> >    fprintf(stderr,"SEGVS ARE COOL IN SETUID ROOT PROGRAMS. SEE MAN FREE\n");
> >    fflush(stderr);
> >    exit(-1);
> > }
> 141c150,151
> < 
> ---
> >    signal(SIGSEGV,(void (*)())segvCOOL);
> >    
> 246c256
> <         free(dwd);
> ---
> >       /*  free(dwd);*/
> 250,252c260,262
> <     else
> <         free(dwd);
> < 
> ---
> > /*    else
> >  *       free(dwd);
> >  */
> 259c269
> <         free(cwd);
> ---
> > /*        free(cwd);*/
> 263,265c273,275
> <     else
> <         free(cwd);
> < 
> ---
> > /*    else
> > *        free(cwd);
> > */
> 
>  
> --
> 
> Backtrace:
> --
> 
> --
> 


-- 
Aram Mirzadeh						awm@qosina.com
MIS Manager				      Apache httpd team member
Qosina Corporation				    aram@hyperreal.com
http://www.qosina.com/			    http://www.qosina.com/~awm
PGP Key 			http://www.qosina.com/~awm/pgpkey.html
Key Sig 	      BE 49 9D F6 2A A7 22 FC  02 E9 1E 3D F7 0C 67 A0

You're not drunk if you can lie on the floor without holding on.
                -- Dean Martin