[clamav-users] About scanning files larger than 2 GB in size

Micah Snyder (micasnyd) micasnyd at cisco.com
Thu Jan 26 00:14:27 UTC 2023


Paul is sort-of correct but the 2GB limit isn't artificial as he has implied.

ClamAV code contains a lot of signed and unsigned 32bit variables that must be upgraded to 64bit variables to support larger files.  Before raising the limit, a tedious audit process must be completed to ensure that all variables are upgraded in all modules.  We cannot simply remove the limit and cross our fingers.

Regards,
Micah


Micah Snyder
ClamAV Development
Talos
Cisco Systems, Inc.
________________________________
From: clamav-users <clamav-users-bounces at lists.clamav.net> on behalf of Paul Kosinski via clamav-users <clamav-users at lists.clamav.net>
Sent: Saturday, January 21, 2023 8:02 PM
To: clamav-users at lists.clamav.net <clamav-users at lists.clamav.net>
Cc: Paul Kosinski <clamav-users at iment.com>
Subject: Re: [clamav-users] About scanning files larger than 2 GB in size

On Sun, 22 Jan 2023 05:40:18 +0900
Tsutomu Oyamada <oyamada at promark-inc.com> wrote:

> How do I set up clamd?
> Setting MaxFileSize to "0" is unlimited, but internally files larger than 2GB in size cannot be scanned.
> In this case, do you treat the file as clean without scanning it at all?


I've complained about the 2 GiB limit now and then for several years. It's a holdover from when 32-bit numbers were all that CPUs supported, and lots of code used C's signed "int" for file size and offset.

Way back in 1996, FAT32 had this limit, but even it was extended to 4 GiB (via unsigned 32-bit numbers) when Large File Support was added.

These days, media files are often bigger than 2 GiB, as are some archive files (esp. disk images). Furthermore, almost all recent versions of standard OSes are 64-bit, and very few 32-bit CPUs are even being sold. In other words, the 2 GiB limit is quite an anachronism.

_______________________________________________

Manage your clamav-users mailing list subscription / unsubscribe:
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/Cisco-Talos/clamav-documentation

https://docs.clamav.net/#mailing-lists-and-chat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clamav.net/pipermail/clamav-users/attachments/20230126/ccaddfcf/attachment.htm>


More information about the clamav-users mailing list