Bug 11049 - Review and revise OnAccess scanning
Review and revise OnAccess scanning
Status: RESOLVED FIXED
Product: ClamAV
Classification: ClamAV
Component: clamd
ALL
x86_64 GNU/Linux
: P3 normal
: 0.99.1
Assigned To: Mickey Sola
:
: 11248 11308 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-02 13:18 EDT by Steven Morgan
Modified: 2015-10-29 15:34 EDT (History)
4 users (show)

See Also:
QA Contact:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Morgan 2014-07-02 13:18:38 EDT
OnAccess scanning needs review and revision. Path inclusion/exclusion does not work as expected, among other issues. A member of the ClamAV user community, Martin Wilck, recently pointed out some of the problems on the ClamAV mailing list:

Hello,

I have recently made some experiments with on-access scanning with
clamd, using clamav 0.98.3 from Fedora 19.

The documentation of the "OnAccessIncludePath" option says "Set the
include paths (all files inside them will be scanned)".

The clamd code calls fanotify_mark() with
fan_mask=(FAN_ACCESS|FAN_EVENT_ON_CHILD). This means that clamd will
only receive events for *immediate* children of a directory listed as
"OnAccessIncludePath" (see fanotify_mark(2)).

Is that really meant by "all files inside them will be scanned"? My
expectation would have been that by specifying "/home" as
OnAccessIncludePath, all user's home directories would be scanned
(rather than just regular files directly under /home, which is probably
an empty set).

Why doesn't clamd use FAN_MARK_MOUNT instead?

Regards
Martin

PS: I'd also be curious to understand why FAN_ACCESS (notification on
read) is used by clamd. For the commen case of files that are read more
often than written, this would result some files being re-scanned over
and over again. Why not scan files as they are written, at least for a
host's local, non-removable file systems?

--
Dr. Martin Wilck
Comment 1 Steven Morgan 2015-04-28 16:46:20 EDT
*** Bug 11308 has been marked as a duplicate of this bug. ***
Comment 2 Steven Morgan 2015-04-28 16:50:04 EDT
*** Bug 11248 has been marked as a duplicate of this bug. ***
Comment 3 Steven Morgan 2015-04-28 16:55:49 EDT
Targeting for next feature release.
Comment 4 Steven Morgan 2015-07-01 15:24:59 EDT
Reminder - review tickets 2236, 11308, and 11248 in conjunction with this effort.
Comment 5 Steven Morgan 2015-10-21 19:44:29 EDT
Mickey,

Please review this ticket and the tickets in comment 4 w.r.t On-access overhaul to see if we can close this.
Comment 6 Mickey Sola 2015-10-22 14:02:22 EDT
The overhaul being released in 0.99 adds the requested functionality. This can be closed.