armadito-av icon indicating copy to clipboard operation
armadito-av copied to clipboard

fanotify warning (Invalid argument)

Open gerbier opened this issue 7 years ago • 8 comments

I have a fresh install from source on linux mageia 6. With the default config file, I have some wanings about fanotify : [281362.042901] armadito[12113]: on-access for linux: adding fanotify mark on mount point /home failed (Invalid argument)

gerbier avatar Aug 10 '17 14:08 gerbier

I have also the same warning on all /tmp files and /var/tmp files.

gerbier avatar Aug 10 '17 14:08 gerbier

Thanks for reporting the issue. I've checked the fanotify_mark man page http://man7.org/linux/man-pages/man2/fanotify_mark.2.html but I don't understand the origin of the problem. The fanotify_mark call fails with an errno == EINVAL, which can come from:

  • invalid mask or flags
  • file descriptor is not a valid fanotify file descriptor

can you check that there are no other errors signaled before this one?

fdechelle avatar Aug 10 '17 14:08 fdechelle

bonjour

je viens de faire un test avec le code d'exemple C de la page man 7 fanotify et j'ai la même erreur. c'est peut-être lié à la distribution ?

gerbier@lxcti1 ~/tmp $ uname -a Linux lxcti1 4.9.35-server-1.mga6 #1 SMP Thu Jun 29 19:50:53 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

gerbier@lxcti1 ~/tmp $ grep -i fanotify /boot/config-4.9.35-server-1.mga6 CONFIG_FANOTIFY=y

CONFIG_FANOTIFY_ACCESS_PERMISSIONS is not set

ps : j'ai eu un contact l'année dernière avec Walid Nouh de teclib, qui m'avait présenté le produit pour un test à Meteo-France

----- Mail original -----

Thanks for reporting the issue. I've checked the fanotify_mark man page http://man7.org/linux/man-pages/man2/fanotify_mark.2.html but I don't understand the origin of the problem. The fanotify_mark call fails with an errno == EINVAL, which can come from:

* invalid mask or flags
* file descriptor is not a valid fanotify file descriptor

can you check that there are no other errors signaled before this one?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .

gerbier avatar Aug 11 '17 07:08 gerbier

bonjour

j'ai essayé le code d'exemple de la page man 7 fanotify sur d'autres distributions : fedora 26, ubuntu 17.04 et il ne renvoie pas cette erreur. J'ai donc ouvert un ticket chez mageia

----- Mail original -----

bonjour

je viens de faire un test avec le code d'exemple C de la page man 7 fanotify et j'ai la même erreur. c'est peut-être lié à la distribution ?

gerbier@lxcti1 ~/tmp $ uname -a Linux lxcti1 4.9.35-server-1.mga6 #1 SMP Thu Jun 29 19:50:53 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

gerbier@lxcti1 ~/tmp $ grep -i fanotify /boot/config-4.9.35-server-1.mga6 CONFIG_FANOTIFY=y

CONFIG_FANOTIFY_ACCESS_PERMISSIONS is not set

ps : j'ai eu un contact l'année dernière avec Walid Nouh de teclib, qui m'avait présenté le produit pour un test à Meteo-France

gerbier avatar Aug 12 '17 07:08 gerbier

Bonjour,

J'étais en congés...

Merci pour vos tests!

C'est clairement CONFIG_FANOTIFY_ACCESS_PERMISSIONS dans la config kernel qui est responsable de l'erreur. Il est possible que pour une version "server" mageia désactive ce flag pour des questions de performances (questionnables).

Au niveau de armadito, il y a 2 choses à faire:

  • mieux signaler l'erreur, mais comment la détecter de façon sûre?
  • implémenter la version du marquage sans FAN_OPEN_PERM: analyse des fichiers mais sans blocage de l'ouverture si le fichier est malsain

Je fais ça dans la semaine.

fdechelle avatar Aug 28 '17 09:08 fdechelle

bonjour

(j'étais aussi en congés)

je viens de vérifier sur ma mageia 6 et vous avez raison :

gerbier@lxcti1 ~ $ grep FANOTIFY /boot/config-4.9.35-server-1.mga6 CONFIG_FANOTIFY=y

CONFIG_FANOTIFY_ACCESS_PERMISSIONS is not set

----- Mail original -----

Bonjour,

J'étais en congés...

Merci pour vos tests!

C'est clairement CONFIG_FANOTIFY_ACCESS_PERMISSIONS dans la config kernel qui est responsable de l'erreur. Il est possible que pour une version "server" mageia désactive ce flag pour des questions de performances (questionnables).

Au niveau de armadito, il y a 2 choses à faire:

* mieux signaler l'erreur, mais comment la détecter de façon
sûre?
* implémenter la version du marquage sans FAN_OPEN_PERM: analyse
des fichiers mais sans blocage de l'ouverture si le fichier est
malsain

Je fais ça dans la semaine.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .

gerbier avatar Aug 29 '17 06:08 gerbier

Hello,

(back to english...)

I've committed on DEV branch changes for fanotify on-access scan for Linux:

  • error messages
  • processing of FAN_OPEN event in case of notify-only monitoring

You can test the notify-only behavior by changing the configuration file armadito.conf. Just replace: enable-permission=1 by: enable-permission=0 in section [on-access-linux]

Hope this helps,

fdechelle avatar Aug 29 '17 13:08 fdechelle

Where can I download the Windows version? Some English sites have screenshots, but I can’t find them anywhere. Forgive me for the off-topic question.

mrkaban avatar Nov 09 '19 13:11 mrkaban