lkml.org 
[lkml]   [1997]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectNULL pointer dereference in find_candidate
Hi all,

This is an old bug for which the fix hasn't made it into the kernel yet.
Basically, under certain conditions, try_to_free_buffer makes bh=NULL,
the next iteration of the for loop dereferences it and... oops! :-)

The following patch should fix it (thanks to Mark Hemment for pointing it
out).

Ionut

--
It is better to keep your mouth shut and be thought a fool,
than to open it and remove all doubt.

--- linux-2.1.24/fs/buffer.c.old Sun Jan 26 05:07:30 1997
+++ linux-2.1.24/fs/buffer.c Thu Jan 30 01:40:06 1997
@@ -582,6 +582,8 @@
of other sizes, this is necessary now that we
no longer have the lav code. */
try_to_free_buffer(bh,&bh,1);
+ if (!bh)
+ break;
continue;
}


\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.019 / U:5.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site