Unix Technical Forum

Re: use after free in sys/net/if_gif.c

This is a discussion on Re: use after free in sys/net/if_gif.c within the mailing.openbsd.tech forums, part of the OpenBSD category; --> On Tue, Apr 17, 2007 at 12:31:48PM -0400, Stefan Schmieta wrote: > Revision 1.41 of sys/net/if_gif.c broke the gif-loop ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 10:20 AM
Claudio Jeker
 
Posts: n/a
Default Re: use after free in sys/net/if_gif.c

On Tue, Apr 17, 2007 at 12:31:48PM -0400, Stefan Schmieta wrote:
> Revision 1.41 of sys/net/if_gif.c broke the gif-loop detection by
> introducing a use-after-free that causes a kernel panic if a loop is
> detected. Not sure if the patch below is the way to go, but it
> definitely makes the crash go away.
>


I like the following solution better.

--
:wq Claudio

Index: if_gif.c
================================================== =================
RCS file: /cvs/src/sys/net/if_gif.c,v
retrieving revision 1.41
diff -u -p -r1.41 if_gif.c
--- if_gif.c 22 Feb 2007 15:31:44 -0000 1.41
+++ if_gif.c 17 Apr 2007 17:07:28 -0000
@@ -196,9 +196,11 @@ gif_start(ifp)
log(LOG_NOTICE, "gif_output: "
"recursively called too many times\n");
m_freem(m);
- continue;
+ break;
}
}
+ if (mtag)
+ continue;

mtag = m_tag_get(PACKET_TAG_GIF, sizeof(caddr_t), M_NOWAIT);
if (mtag == NULL) {

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:56 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com