Bug 1897909 - not respecting --max-filesize / MaxFileSize limit
Summary: not respecting --max-filesize / MaxFileSize limit
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: clamav
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Sergio Basto
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-15 14:46 UTC by uggadri
Modified: 2021-05-25 16:59 UTC (History)
15 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-05-25 16:59:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description uggadri 2020-11-15 14:46:25 UTC
Description of problem:
clamscan is not respecting --max-filesize or MaxFileSize limit

Version-Release number of selected component (if applicable):
clamav-0.103.0-1.fc32 

How reproducible:
100%

Steps to Reproduce:
[user@localhost ~]$ fallocate --length 5G bigfile;
[user@localhost ~]$ clamscan --max-filesize=1M --max-scansize=1M 'bigfile';
LibClamAV Error: CRITICAL: fmap() failed
/home/user/bigfile: Can't allocate memory ERROR

----------- SCAN SUMMARY -----------
Known viruses: 8937614
Engine version: 0.103.0
Scanned directories: 0
Scanned files: 0
Infected files: 0
Total errors: 1
Data scanned: 0.00 MB
Data read: 5120.00 MB (ratio 0.00:1)
Time: 16.448 sec (0 m 16 s)
Start Date: 2020:11:15 09:24:57
End Date:   2020:11:15 09:25:14
[user@localhost ~]$ echo $?;
2

Actual results:
files larger than the limit aren't being skipped, resulting in error messages

Expected results:
files larger than the limit should be skipped

Additional info:
this is especially problematic for me because my nightly malware scan is returning errors every night since this package was updated.

Comment 1 Orion Poplawski 2020-11-20 03:12:53 UTC
So you think this is a regression and was working before with 0.102.4?

Comment 2 uggadri 2020-11-20 17:38:43 UTC
It does indeed seem to be a regression with respect to generation of errors (although it's worth pointing out it appears both versions spend time looking at the file). Here's the result after downgrading to the version you mention ...


[user@localhost ~]$ fallocate --length 5G bigfile;
[user@localhost ~]$ clamscan --max-filesize=1M --max-scansize=1M 'bigfile';
/home/user/bigfile: OK

----------- SCAN SUMMARY -----------
Known viruses: 8940784
Engine version: 0.102.4
Scanned directories: 0
Scanned files: 1
Infected files: 0
Data scanned: 0.00 MB
Data read: 5120.00 MB (ratio 0.00:1)
Time: 16.255 sec (0 m 16 s)
[user@localhost ~]$ echo $?;
0

Comment 3 Sergio Basto 2020-11-29 01:22:31 UTC
if so (it is an regression) we should report it upstream I didn't find any bug report related [1] 


[1] 
 https://bugzilla.clamav.net/buglist.cgi?classification=ClamAV&list_id=162250&product=ClamAV&query_format=advanced

Comment 4 uggadri 2020-11-29 22:21:59 UTC
it appears this is upstream at https://bugzilla.clamav.net/show_bug.cgi?id=12374 , where i've added a comment.

Comment 5 Sergio Basto 2020-12-01 05:10:51 UTC
(In reply to uggadri from comment #4)
> it appears this is upstream at
> https://bugzilla.clamav.net/show_bug.cgi?id=12374 , where i've added a
> comment.

good catch, thanks

Comment 6 Sergio Basto 2020-12-01 05:17:53 UTC
Hum, but the original report is about 0.100.3, we already had versions 0.101.x and 0.102.x , now we are testing 0.103.0

Comment 7 uggadri 2020-12-01 12:01:25 UTC
right, but it appears the only thing that's new is that error messages are being produced; the --max-filesize flag appears not to have been respected all along. if that issue is addressed, the fact that error messages are produced on too-large files is moot (and expected behavior anyway).

Comment 8 Ville-Pekka Vainio 2021-02-17 13:48:12 UTC
Here's a bug report from upstream of a certain commit causing the "Can't allocate memory ERROR". Might be useful: https://bugzilla.clamav.net/show_bug.cgi?id=12673

Comment 9 Sergio Basto 2021-02-17 14:44:21 UTC
Hi, I just saw that we have a new version of clamav 0.103.1 , we will start do the packages updates . 

about this bug , I hope upstream can take care of it , I persoanlly think the commit is too big to do something in downstream (here) 


Thank you for the report.

Comment 10 Fedora Program Management 2021-04-29 16:43:50 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 11 Ben Cotton 2021-05-25 16:59:51 UTC
Fedora 32 changed to end-of-life (EOL) status on 2021-05-25. Fedora 32 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.