Re: CalmAV In-Memory Scan

Eugene Crosser <[email protected]>
Newsgroups gmane.comp.security.virus.clamav.devel
Message-ID <[email protected]>
On 04/05/2017 09:27 PM, Michael Engstler wrote:
> Hi,
> I noticed that when using the INSTREAM command and sending it a memory
> buffer of a file, clamd takes the memory buffer and saves it to
> the TemporaryDirectory (as defined in the config file).
> 
> This is an unnecessary overhead as it requires disk IO in order to scan the
> file which is already loaded in-memory.
> Is there any way to command clamd to scan the buffer completely in-memory
> without writing anything to the disk?

That's a feature that I requested many years ago because I had a non-copying
MIME parser that worked on mmap()ed files, and I wanted to virus-scan some parts
of the message. It was not possible, and I think it's not possible now.

I suggest you to mmap() your memory region to a temp. file, ideally on tmpfs,
and pass this file to clamav. That ought to minimize the overhead.

Eugene

_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

http://www.clamav.net/contact.html#ml
signature.asc (application/pgp-signature, 455 B)
-----BEGIN PGP SIGNATURE-----

iQEcBAEBCAAGBQJY5U8FAAoJEHykB8ORnUWMfJgH/jVsxpITQcah3bGSlnk5v3xQ
s66oG+GxvWughNqw34pLAZWKsS6hFaDpb5SlTWxM7lLZgdYBVEDl2szSwQ83TUDr
t/fngaQ2NEDq9VpylepVTwtQb0/hbjGlWL1Q0Gn/P3iNJo2zg/H8VmfhWTy81BsP
rbIv/3+9UkW8Kgck7XNu/mHBtAqZMJaf+KwyUBzRBgB/xLDwsuGRCBXDV7bjuPII
MhJzyCvvMhUeIJ0jCv+0NPMd/iLmdTaeoFAlUSwrUveKNJHTIbJ0CunpLKxHq/uf
x9rIIjzqcbeW2GOinnTnhtBi1/sTqmNAq3Ltx5nNpdQkqd/m1OXeVlAsb6U52I4=
=/4vs
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.