Crash de BD / serveur récurrent

Nouveau WRInaute
Bonsoir,


J'ai depuis quelques semaines des soucis concernant mon site web. En effet, chaque jour à 17h, et pendant environ 30 minutes, mysql plante, et je dois le relancer à la main (il fonctionne entre 3s et 4minutes, puis replante).

Depuis quelques jours désormais, il le fait également à 10h et des poussières.

Les infos :
Mon site web tourne sur Apache sur le serveur A.
La base de données associées tourne sous Mysql sur le serveur B.

Le symptôme :
Site inaccessible, chargement de page pendant plus de 30 secondes, puis ma page personnalisé de "Problème de base de données, blabla".

Le remède :
Un redémarrage de mysql sur le serveur B.

Les tests :
Redémarrage d'apache sur le serveur A - sans effet.
Contrairement à ce que l'on pourrait penser, ce n'est pas l'affluence ni le nombre de connexions simultanées.
Accès SSH serveur A ok.
Accès SSH serveur B ok.

L'indice :
Pas besoin de tout lire, vous allez vite comprendre..

Code:
Jun 23 09:28:01 [mon_serveur] /USR/SBIN/CRON[5285]: (root) CMD (run-parts /usr/local/oco/bin/60sec >/dev/null 2>/dev/null)

Jun 23 09:28:25 [mon_serveur] suhosin[30425]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/libraries/drivers/Database/Mysql.php', line 106)

Jun 23 09:28:25 [mon_serveur] suhosin[1026]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/libraries/drivers/Database/Mysql.php', line 106)

Jun 23 09:28:25 [mon_serveur] suhosin[1239]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/libraries/drivers/Database/Mysql.php', line 106)

Jun 23 09:28:25 [mon_serveur] suhosin[1244]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/libraries/drivers/Database/Mysql.php', line 106)

Jun 23 09:28:25 [mon_serveur] suhosin[1538]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/libraries/drivers/Database/Mysql.php', line 95)

Jun 23 09:28:25 [mon_serveur] suhosin[1276]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/libraries/drivers/Database/Mysql.php', line 106)

Jun 23 09:28:25 [mon_serveur] suhosin[1176]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/libraries/drivers/Database/Mysql.php', line 106)

Jun 23 09:28:25 [mon_serveur] suhosin[1411]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/libraries/drivers/Database/Mysql.php', line 95)

Jun 23 09:28:25 [mon_serveur] suhosin[659]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/libraries/drivers/Database/Mysql.php', line 95)

Jun 23 09:29:01 [mon_serveur] /USR/SBIN/CRON[6508]: (root) CMD (/usr/local/rtm/bin/rtm 56 > /dev/null 2> /dev/null)

Jun 23 09:29:01 [mon_serveur] /USR/SBIN/CRON[6511]: (root) CMD (run-parts /usr/local/oco/bin/60sec >/dev/null 2>/dev/null)

 

 

Jun 23 10:25:01 [mon_serveur] /USR/SBIN/CRON[14922]: (root) CMD (/etc/svn_update.sh >> /var/log/scripts)

Jun 23 10:25:01 [mon_serveur] /USR/SBIN/CRON[14925]: (root) CMD (run-parts /usr/local/oco/bin/300sec >/dev/null 2>/dev/null)

Jun 23 10:25:01 [mon_serveur] /USR/SBIN/CRON[14926]: (root) CMD (/usr/local/rtm/bin/rtm 56 > /dev/null 2> /dev/null)

Jun 23 10:25:01 [mon_serveur] /USR/SBIN/CRON[14930]: (root) CMD (run-parts /usr/local/oco/bin/60sec >/dev/null 2>/dev/null)

Jun 23 10:25:40 [mon_serveur] suhosin[14812]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 882)

Jun 23 10:25:40 [mon_serveur] suhosin[14739]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 882)

[...] [IDEM *50] [...]

Jun 23 10:25:40 [mon_serveur] suhosin[14457]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 882)

Jun 23 10:25:40 [mon_serveur] suhosin[15012]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 882)

Jun 23 10:25:40 [mon_serveur] suhosin[14733]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/libraries/drivers/Database/Mysql.php', line 95)

Jun 23 10:26:01 [mon_serveur] /USR/SBIN/CRON[17529]: (root) CMD (run-parts /usr/local/oco/bin/120sec >/dev/null 2>/dev/null)

Jun 23 10:26:01 [mon_serveur] /USR/SBIN/CRON[17530]: (root) CMD (/usr/local/rtm/bin/rtm 56 > /dev/null 2> /dev/null)

Jun 23 10:26:01 [mon_serveur] /USR/SBIN/CRON[17533]: (root) CMD (run-parts /usr/local/oco/bin/60sec >/dev/null 2>/dev/null)



 

 

Jun 23 11:31:58 [mon_serveur] suhosin[27901]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 880)

Jun 23 11:31:58 [mon_serveur] suhosin[32156]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 880)

Jun 23 11:31:58 [mon_serveur] suhosin[1092]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 881)

Jun 23 11:31:58 [mon_serveur] suhosin[842]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 881)

Jun 23 11:31:58 [mon_serveur] suhosin[836]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 881)

[...] 

Jun 23 11:31:58 [mon_serveur] suhosin[1303]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 880)

Jun 23 11:31:59 [mon_serveur] suhosin[31772]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 880)

Jun 23 11:31:59 [mon_serveur] suhosin[982]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 880)

Jun 23 11:31:59 [mon_serveur] suhosin[1201]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 880)

Jun 23 11:31:59 [mon_serveur] suhosin[1195]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 881)

Jun 23 11:31:59 [mon_serveur] suhosin[835]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 880)

Jun 23 11:31:59 [mon_serveur] suhosin[1090]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 880)

Jun 23 11:31:59 [mon_serveur] suhosin[1514]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 880)

Jun 23 11:31:59 [mon_serveur] suhosin[976]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 880)

Jun 23 11:31:59 [mon_serveur] suhosin[984]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 881)

Jun 23 11:31:59 [mon_serveur] suhosin[1306]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 881)

Jun 23 11:31:59 [mon_serveur] suhosin[28026]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 880)

[...] [IDEM *200] [...]

Jun 23 11:31:59 [mon_serveur] suhosin[977]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 882)

Jun 23 11:31:59 [mon_serveur] suhosin[31767]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 881)

Jun 23 11:31:59 [mon_serveur] suhosin[1215]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 881)

Jun 23 11:31:59 [mon_serveur] suhosin[1530]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 880)

Jun 23 11:31:59 [mon_serveur] suhosin[970]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 881)

Jun 23 11:31:59 [mon_serveur] suhosin[1077]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 881)

Jun 23 11:31:59 [mon_serveur] suhosin[1091]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 881)

Jun 23 11:31:59 [mon_serveur] suhosin[844]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 882)

Jun 23 11:31:59 [mon_serveur] suhosin[1032]: ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/var/www/[mon_site_web]/system/core/[mon_framework].php', line 881)

Les lignes concernées (880, 881, 882) sont un simple envoi de mail, en php.

Alors, j'ai regardé sur le net, j'ai pas trouvé grand chose, sauf ce topic ici (https://www.webrankinfo.com/forum/probleme-recurrent-crash-t116966.html) ; mais sans solution pour mon cas de figure.

C'est tout à fait possible que ce soit un script utilisé par une personne tierce afin d'emmerder le plus possible ma société.
Une idée ?

Vous avez deux heures. A vos claviers ! ;)


Merci mile fois !
 
WRInaute passionné
1. tu devrais tracer les paramètres envoyés à la fonction mail... si tu trouves un dénominateur commun (IP, mail, texte ou sujet, voire même entête), tu pourras le filtrer.
Si tu ne descend pas l'IP ou le User-Agent dans le mail, tu devrais le faire. Cela te permettra de mieux discriminer l'attaquant.

2. ce que tu peux faire, c'est détourner la fonction mail : au lieu de l'envoyer à la fonction mail, tu devrais envoyer le message dans une file d'attente.
Par exemple écrire dans un répertoire le message dans un fichier.
Ensuite tu as un daemon qui va faire un "pull" permanent du répertoire pour traiter la file d'attente (au format fichier) et envoyer au serveur mail sans surcharger le serveur et sans bloquer ton site/framework.
=> J'ai fait ça chez France Tel' pour traiter non pas des mails mais des flux de commande. Au final, la file d'attente est plus ou moins chargée et il n'y a aucun point de contention.

lolo
 
WRInaute passionné
Si ton framework est du Zend, cette erreur peut être normale.
Tu pourrais déjà commencer par virer suhosin.
(commente par un point virgule les lignes du /etc/php5/conf.d/suhosin.ini (si tu es sous Debian car ça tu dis pas)).

heap overflow veut dire un "tu dépasses une valeur de mémoire".

Sinon je vois aussi que dans la même seconde, tu fais du monitoring (OCO/RTM) + un SVN update, peut-être un début de piste...

Bref on a pas trop d'infos, sinon ça pourrait être un blacklistage de ton serveur par mysql (si tu as un script avec un vieux pass SQL qui traine et qui tente de s'y co, mysql peut peut-être le dégager).
 
Discussions similaires
Haut