capote
(Marko)
August 22, 2021, 2:22pm
1
NethServer Version: 7.9
Hi, last days I got error notification mails like:
Message List
Sun Aug 22 02:54:01 2021
Scanned Folder: /WARNING: Can’t open file /sys/fs/xfs/dm-0/stats/stats_clear: Permission denied
WARNING: Can’t open file /sys/fs/xfs/sda1/stats/stats_clear: Permission denied
WARNING: Can’t open file /sys/fs/xfs/stats/stats_clear: Permission denied
WARNING: Can’t open file /sys/bus/cpu/drivers/processor/bind: Permission denied
WARNING: Can’t open file /sys/bus/cpu/drivers/processor/uevent: Permission denied
<…>
WARNING: Can’t open file /sys/bus/clockevents/drivers_probe: Permission denied
WARNING: Can’t open file /sys/devices/pci0000:00/0000:00:00.0/remove: Permission denied
WARNING: Can’t open file /sys/devices/pci0000:00/0000:00:00.0/rescan: Permission denied
WARNING: Can’t open file /sys/devices/pci0000:00/0000:00:01.0/remove: Permission denied
WARNING: Can’t open file /sys/devices/pci0000:00/0000:00:01.0/rescan: Permission denied
<…>
WARNING: Can’t open file /sys/devices/LNXSYSTM:00/device:00/ACPI0010:00/LNXCPU:02/eject: Permission denied
WARNING: Can’t open file /sys/devices/LNXSYSTM:00/device:00/ACPI0010:00/LNXCPU:03/eject: Permission denied
WARNING: Can’t open file /sys/class/gpio/unexport: Permission denied
WARNING: Can’t open file /sys/class/gpio/export: Permission denied
<…>
WARNING: Can’t open file /sys/module/nf_conntrack_tftp/uevent: Permission denied
Does anyone know this error and is there a solution?
Best regards, Marko
mark_nl
(Mark Verlinde)
August 22, 2021, 3:21pm
2
only see this kind of stuff if I"m fooling around with a kernel on a device with is not really supported by that kernel. /sys
is a virtual file system where the kernel exposes the devices and their drivers to user space.
So from my (brief) scanning of your reported issue it looks like the kernel on this system is in distress… which is quite alarming…
Or clamav is trying to do stuff it is not allowed to do…
An uid/gid issue comes to mind, is clamav re installed recently?
(Or other re installs which may have messed uid/gid up…)
EDIT 3th thought:
Does clamav scan the hole rootfs ? Do not think that is possible, in /sys
are (virtual) files even root can not touch as they belong to the kernel.
capote
(Marko)
August 22, 2021, 11:32pm
3
mark_nl:
is not really supported
I use this server round about a year w/o such problems, it is a standard KVM-Server
is clamav re installed recently?
No, it runs the hole time.
Does clamav scan the hole rootfs
I use it with standard configuration out of the box. I didn’t change anything.
Thank you for your thoughts, MArko
capote
(Marko)
August 22, 2021, 11:37pm
4
I disabled the scanning. After re-enabling comes an error message
mark_nl
(Mark Verlinde)
August 23, 2021, 6:19am
5
Is /sys present on your system, (as root) ls -l /sys
?
or mount | grep sysfs
capote
(Marko)
August 23, 2021, 7:31am
6
yes, it is:
[root@srv01 ~]# mount | grep sysfs
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
mark_nl
(Mark Verlinde)
August 23, 2021, 7:44am
7
Still there is “something” not right there causing ClamAV not to except the exclusion of /sys.
1 Like
capote
(Marko)
August 23, 2021, 7:47am
8
I use exactly the same cloud server type for another Nethserver without problems
mark_nl
(Mark Verlinde)
August 23, 2021, 7:50am
9
DANGERZONE (hope this is clear !)
you may try to remount sysfs
mount -o remount,rw,nosuid,nodev,noexec,relatime -t sysfs sysfs /sys
1 Like
capote
(Marko)
August 23, 2021, 7:53am
10
I did it (also a reboot). The error persists.
Maybe i should remove clamscan completely once and reinstall? However, I am not sure how to remove the package without leaving any residue to avoid artifacts.
mark_nl
(Mark Verlinde)
August 23, 2021, 8:07am
11
I think we need to ping @stephdl
In preparation of this:
config show clamscan
and you may try to reconfigure the module manually by:
signal-event nethserver-clamscan-update
EDIT: and of course
rpm -qa | grep nethserver-clamscan
capote
(Marko)
August 23, 2021, 8:18am
12
mark_nl:
config show clamscan
config show clamscan
[root@srv01 /]# config show clamscan
clamscan=configuration
AlgoDetection=disabled
BlockEncrypted=disabled
BlockMacros=disabled
Bytecode=enabled
BytecodeTimout=120000
BytecodeUnsigned=disabled
DetectBroken=disabled
DetectPua=disabled
DetectStructured=disabled
FilesystemScan=weekly
,/usr/share/doccanExclude=/boot
FilesystemScanFilesystems=/
FilesystemScanReportTo=root
FilesystemScanUnofficialSigs=disabled
IncludePua=Packed,PwTool,NetTool,P2P,IRC,RAT,Tool,Spy,Server,Script
JobDay=7d
JobHour=2h
MaxScanFile=45
PartInstersection=disabled
PhishingScanUrl=disabled
PhishingSigs=disabled
Quarantine=enabled
QuarantineDirectory=/var/spool/clamav/quarantine
ScanArchive=enabled
ScanElf=enabled
ScanHTML=enabled
ScanHwp=enabled
ScanMail=enabled
ScanOle2=enabled
ScanPdf=enabled
ScanPe=enabled
ScanSwf=enabled
ScanXML=enabled
customSettings=
reallyWantToMove=disabled
status=enabled
[root@srv01 /]#
rpm -qa | grep nethserver-clamscan
nethserver-clamscan-1.0.4-1.ns7.sdl.noarch
I did: signal-event nethserver-clamscan-update
… and the error persists
mark_nl
(Mark Verlinde)
August 23, 2021, 8:21am
13
This is not right, maybe related to:
committed 01:28PM - 09 Aug 21 UTC
Recover and exclude a file
Change the split validator from \n to ,
capote
(Marko)
August 23, 2021, 8:24am
14
mark_nl:
This is not right,
It works on my second server well.
Maybe @stephdl can help.
Thank you Mark!
mark_nl
(Mark Verlinde)
August 23, 2021, 8:27am
15
config setprop clamscan Exclude /boot,/proc,/sys,/usr/share/doc
config show clamscan
capote
(Marko)
August 23, 2021, 8:27am
16
mark_nl:
config show clamscan
[root@srv01 /]# config setprop clamscan Exclude /boot,/proc,/sys,/usr/share/doc
[root@srv01 /]# config show clamscan
clamscan=configuration
AlgoDetection=disabled
BlockEncrypted=disabled
BlockMacros=disabled
Bytecode=enabled
BytecodeTimout=120000
BytecodeUnsigned=disabled
DetectBroken=disabled
DetectPua=disabled
DetectStructured=disabled
Exclude=/boot,/proc,/sys,/usr/share/doc
FilesystemScan=weekly
,/usr/share/doccanExclude=/boot
FilesystemScanFilesystems=/
FilesystemScanReportTo=root
FilesystemScanUnofficialSigs=disabled
IncludePua=Packed,PwTool,NetTool,P2P,IRC,RAT,Tool,Spy,Server,Script
JobDay=7d
JobHour=2h
MaxScanFile=45
PartInstersection=disabled
PhishingScanUrl=disabled
PhishingSigs=disabled
Quarantine=enabled
QuarantineDirectory=/var/spool/clamav/quarantine
ScanArchive=enabled
ScanElf=enabled
ScanHTML=enabled
ScanHwp=enabled
ScanMail=enabled
ScanOle2=enabled
ScanPdf=enabled
ScanPe=enabled
ScanSwf=enabled
ScanXML=enabled
customSettings=
reallyWantToMove=disabled
status=enabled
[root@srv01 /]#
Error persists
capote
(Marko)
August 23, 2021, 8:29am
18
config setprop clamscan Exclude /boot …?
mark_nl
(Mark Verlinde)
August 23, 2021, 8:31am
19
the db is corrupted… whatever you set that false (corrupt) entry persists.
capote
(Marko)
August 23, 2021, 8:33am
20
if I config setprop clamscan Exclude /proc,/sys,/usr/share/doc
without /boot
[root@srv01 /]# config setprop clamscan Exclude /proc,/sys,/usr/share/doc
[root@srv01 /]# config show clamscan
clamscan=configuration
AlgoDetection=disabled
BlockEncrypted=disabled
BlockMacros=disabled
Bytecode=enabled
BytecodeTimout=120000
BytecodeUnsigned=disabled
DetectBroken=disabled
DetectPua=disabled
DetectStructured=disabled
Exclude=/proc,/sys,/usr/share/doc
FilesystemScan=weekly
,/usr/share/doccanExclude=/boot
FilesystemScanFilesystems=/
FilesystemScanReportTo=root
FilesystemScanUnofficialSigs=disabled
IncludePua=Packed,PwTool,NetTool,P2P,IRC,RAT,Tool,Spy,Server,Script
JobDay=7d
JobHour=2h
MaxScanFile=45
PartInstersection=disabled
PhishingScanUrl=disabled
PhishingSigs=disabled
Quarantine=enabled
QuarantineDirectory=/var/spool/clamav/quarantine
ScanArchive=enabled
ScanElf=enabled
ScanHTML=enabled
ScanHwp=enabled
ScanMail=enabled
ScanOle2=enabled
ScanPdf=enabled
ScanPe=enabled
ScanSwf=enabled
ScanXML=enabled
customSettings=
reallyWantToMove=disabled
status=enabled
[root@srv01 /]#