[prev in list] [next in list] [prev in thread] [next in thread] 

List:       clamav-devel
Subject:    [Clamav-devel] Re: Fixes for: ERROR: ScanStream: Can't create
From:       "Mark Pizzolato" <clamav-devel () subscriptions ! pizzolato ! net>
Date:       2004-12-02 2:07:12
Message-ID: 002a01c4d813$a79b5650$173ca8c0 () AlohaSunset ! com
[Download RAW message or body]

On Wednesday, December 01, 2004 3:24 PM. Mark Pizzolato wrote:

> On Wednesday, December 01, 2004 2:28 PM, Mark Pizzolato wrote:
>
>> While exploring the issue of threadsafety in ClamAV, I dug deeper into 
>> the
>> other places where temp files are created and used in libclamav.  I found
>> numerous places where concurrency issues existed, even though mutexes 
>> were
>> being used to try to manage the problem.  The attached patch includes 
>> fixes
>> for files in both clamd and libclamav.  While fixing these issues I also
>> found and fixed several other issues that existed in error paths in the 
>> code
>> that I was modifying.  (i.e. memory/open file leaks, possible invalid 
>> memory
>> references).  There was also logic in scanners.c which attempted to use
>> mutex to limit concurrency  while scan rar files (to avoid issues with 
>> using
>> tmpfile()).  This logic would serialize RAR checking, but some of the 
>> logic
>> attempted to not even try (if enabled) if another was in progress which
>> would return success instead.  The need for this mutex logic has been
>> eliminated.
>
> Oops.  Hold off on adopting this patch.  I looked deeper into the RAR 
> subject, (i.e the implementation of the rar unpacking code in unrarlib.c), 
> and the code that is called is definately NOT reentrant.  So, some 
> external serialization is necessary anywy.  I'll fix this.

OK, now rar scanning is properly serialized.  While fixing this I found an 
error path memory leak, but more importantly found a common path  memory 
leak (leaked on every virus found).

- Mark Pizzolato 

["20041130.patch.new" (application/octet-stream)]

_______________________________________________
http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic