fumiyas / samba-virusfilter

Samba-VirusFilter - On-access anti-virus filter for Samba (DISCONTINUED. See vfs_virusfilter(8) in Samba upstream)
GNU General Public License v3.0
8 stars 7 forks source link

Update svf-utils.c #2

Closed steve999lee closed 11 years ago

steve999lee commented 11 years ago

We experience a problem with scan on close = yes (and scan on open = no) where the samba process is terminated and coredump produced. This seems to happen only on slower network connections when saving microsoft office documents. On investigation it looks like an access after free error when accessing the cache and this is caused when the last entry of the cache is deleted (and freed) and the end pointer is set to the prev pointer of the entry about to be deleted. In samba 3.6 the prev pointer points the itself for the last entry (see DLIST_ADD) which means that end is set to an entry which has been removed and freed. This fix seems to fix it and so does disabling the cache (svf-clamav:cache entry limit = -1). I'm still not entirely sure why it only happens on slow connections?

I'm not really sure why you would want to use the cache when just using scan on close - seems like it should never get used.

fumiyas commented 11 years ago

I've add test cases for the 'cache time limit' and the 'cache entry limit' and fix your issue.

Could you test samba-virusfilter-0.1.3.900.tar.bz2 uploaded at https://bitbucket.org/fumiyas/samba-virusfilter/downloads ?

steve999lee commented 11 years ago

I rebuilt and deployed the new libraries on our test server and have tried to reproduce the problem without success so I guess we can say that the issue is fixed.

Thank-you for your help.

I'm still tempted to switch caching off as it doesn't seem to add any value if we are only scanning on close. svf-clamav:cache entry limit = -1

fumiyas commented 11 years ago

I'll release 0.1.4 soon. Thank you!

steve999lee commented 11 years ago

Thanks