Problème clamav sur Debian Squeeze

 

J'ai remarqué un petit problème ce matin en regardant mes logs de mise à jour de la base de virus de clamav sur un serveur de mails.


 

# tail -f /var/log/clamav/freshclam.log
Sun Sep 25 09:40:34 2011 -> --------------------------------------
Sun Sep 25 09:40:34 2011 -> ClamAV update process started at Sun Sep 25 09:40:34 2011
Sun Sep 25 09:40:34 2011 -> main.cvd is up to date (version: 53, sigs: 846214, f-level: 53, builder: sven)
Sun Sep 25 09:40:34 2011 -> Downloading daily-13666.cdiff [100%]
Sun Sep 25 09:40:34 2011 -> Downloading daily-13667.cdiff [100%]
Sun Sep 25 09:40:34 2011 -> Downloading daily-13668.cdiff [100%]
Sun Sep 25 09:40:35 2011 -> daily.cld updated (version: 13668, sigs: 198744, f-level: 60, builder: jesler)
Sun Sep 25 09:40:35 2011 -> Downloading bytecode.cvd [100%]
Sun Sep 25 09:40:35 2011 -> ERROR: Database load killed by signal 11
Sun Sep 25 09:40:35 2011 -> ERROR: Failed to load new database: No viruses detected

 

 

ERRATUM DU LUNDI MATIN

La modification d'hier matin à complètement cassée clamav, mes mails étaient marquées comme unchecked et quand j'essai de démarrer clamav :

Starting ClamAV daemon: clamd Segmentation fault

 

En passant freshclam en debug j'ai trouvé ces erreurs dans le chargement du bytecode :

LibClamAV debug: [Bytecode JIT]: emitted function bc1f0 of 624 bytes at 0x7f56004b1010
LibClamAV debug: [Bytecode JIT]: emitted function bc1f0_wrap of 21 bytes at 0x7f56004b1290
LibClamAV debug: [Bytecode JIT]: emitted function bc2f0 of 596 bytes at 0x7f56004b12b0
LibClamAV debug: [Bytecode JIT]: emitted function bc2f0_wrap of 21 bytes at 0x7f56004b1510
ERROR: During database load : LibClamAV debug: Initialized 0.97 engine [...] LibClamAV debug: [Bytecode JIT]: emitted function bc2f0_wrap of 21 bytes at 0x7f56004b1510
ERROR: Database load killed by signal 11
ERROR: Failed to load new database: No viruses detected

En cherchant un peu plus loin il se trouve que c'est un problème de la version 0.97.1 de clamav corrigé dans la 0.97.2 (Clamav 0.97.2 fixes problems with the bytecode engine).

Ce qui manquait sur mon serveur c'était les dépôts squeeze-updates :

# Debian updates
deb url_depot/debian/ squeeze-updates main contrib non-free
deb-src url_depo/debian/ squeeze-updates main contrib non-free

 

Un petit apt-get update puis un apt-get upgrade et la version 0.97.2 est installée sur ma debian squeeze :

# dpkg -l | grep clamav
ii  clamav                          0.97.2+dfsg-1~squeeze1       anti-virus utility for Unix - command-line interface
ii  clamav-base                     0.97.2+dfsg-1~squeeze1       anti-virus utility for Unix - base package
ii  clamav-daemon                   0.97.2+dfsg-1~squeeze1       anti-virus utility for Unix - scanner daemon
ii  clamav-freshclam                0.97.2+dfsg-1~squeeze1       anti-virus utility for Unix - virus database update utility
ii  libclamav6                      0.97.2+dfsg-1~squeeze1       anti-virus utility for Unix - library

 

Conclusion : toujours faire très attention aux mises à jour.

 

FIN ERRATUM

 

En listant le contenu du répertoire /var/lib/clamav :

# ls -la /var/lib/clamav/
total 37572
drwxr-xr-x  2 clamav clamav     4096 25 sept. 09:40 .
drwxr-xr-x 41 root   root       4096 11 sept. 16:20 ..
-rw-r--r--  1 clamav clamav 12233728 25 sept. 09:40 daily.cld
-rw-r--r--  1 clamav clamav 26224310 11 sept. 15:40 main.cvd
-rw-------  1 clamav clamav     1040 25 sept. 09:40 mirrors.dat

On vois très bien que le fichier bytecode.cvd n'est pas présent,

 

Pour remédier à ce problème :

# cd /var/lib/clamav
# wget http://db.de.clamav.net/bytecode.cvd
# chown clamav.clamav bytecode.cvd

On vérifie :

# freshclam -v
Current working dir is /var/lib/clamav
Max retries == 5
ClamAV update process started at Sun Sep 25 09:58:53 2011
Using IPv6 aware code
Querying current.cvd.clamav.net
TTL: 728
Software version from DNS: 0.97.2
main.cvd version from DNS: 53
main.cvd is up to date (version: 53, sigs: 846214, f-level: 53, builder: sven)
daily.cvd version from DNS: 13668
daily.cvd is up to date (version: 13668, sigs: 198744, f-level: 60, builder: jesler)
bytecode.cvd version from DNS: 144
bytecode.cvd is up to date (version: 144, sigs: 41, f-level: 60, builder: edwin)

 

Reste à vérifier lors des prochaines mises à jour (dans mon cas toutes les 12h) que tout se passe bien.