LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-27-2016, 05:11 AM   #1
horizn
Member
 
Registered: Jan 2015
Location: UK and Poland
Distribution: Slackware + Debian + Ubuntu
Posts: 170

Rep: Reputation: Disabled
Lack of FANOTIFY support in kernel in 14.2?


HI,
I am trying to configure ClamAV Scan On Access option, but unfortunately default kernel seems to be not configured for FANOTIFY:

Code:
root@:/usr/local/bin# cat /boot/config | grep FANOTIFY
CONFIG_FANOTIFY=y
# CONFIG_FANOTIFY_ACCESS_PERMISSIONS is not set
root@:/usr/local/bin# cat /boot/config-generic-4.4.14 | grep FANOTIFY
CONFIG_FANOTIFY=y
# CONFIG_FANOTIFY_ACCESS_PERMISSIONS is not set
root@:/usr/local/bin# cat /boot/config-huge-4.4.14 | grep FANOTIFY
CONFIG_FANOTIFY=y
# CONFIG_FANOTIFY_ACCESS_PERMISSIONS is not set
is there any option to workaround it without kernel recompilation?

Even if I start Clamav as root:

Code:
Wed Jul 27 11:18:34 2016 -> ScanOnAccess: preventing access attempts on malicious files.
Wed Jul 27 11:18:34 2016 -> ScanOnAccess: Max file size limited to 10485760 bytes
Wed Jul 27 11:18:34 2016 -> ScanOnAccess: Protecting directory '/home/xyz' (and all sub-directories)
Wed Jul 27 11:18:34 2016 -> ERROR: ScanOnAccess: Could not watch path '/home/xyz', Invalid argument
Wed Jul 27 11:18:34 2016 -> ERROR: ScanOnAccess: When using the OnAccessPrevention option, please ensure your kernel
                        was compiled with CONFIG_FANOTIFY_ACCESS_PERMISSIONS set to Y
Wed Jul 27 11:18:34 2016 -> Waiting for all threads to finish
Wed Jul 27 11:18:34 2016 -> Stopping on-access scan
Wed Jul 27 11:18:34 2016 -> ScanOnAccess: onas_ddd_exit(), signal 10
Wed Jul 27 11:18:35 2016 -> Shutting down the main socket.
Wed Jul 27 11:18:35 2016 -> Pid file removed.
Wed Jul 27 11:18:35 2016 -> --- Stopped at Wed Jul 27 11:18:35 2016
Wed Jul 27 11:18:35 2016 -> Closing the main socket.
Wed Jul 27 11:18:35 2016 -> Socket file removed.

Last edited by horizn; 07-27-2016 at 05:20 AM.
 
Old 07-27-2016, 05:36 AM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,097

Rep: Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174
Slackware 14.2 kernel supports "Filesystem wide access notification" (FANOTIFY), it's the "fanotify permissions checking" support that's not compiled in.

http://blog.clamav.net/2016/03/confi...in-clamav.html

Code:
If this is seen:

  CONFIG_FANOTIFY=y
  # CONFIG_FANOTIFY_ACCESS_PERMISSIONS is not set

Then on-access scanning will be constrained to notify-only mode
and will be unable to prevent access to malicious files, since
fanotify lacks the ability to block events on the system.
so, if notifying isn't enough for you and you want to prevent access you have to rebuild your kernel.

IMHO, this specific clamav function is useful mainly if you are monitoring samba shares via clamd, cannot think of other use cases: protecting unix home directories from viruses doesn't make much sense...

Last edited by ponce; 07-27-2016 at 05:54 AM.
 
Old 07-27-2016, 07:01 AM   #3
horizn
Member
 
Registered: Jan 2015
Location: UK and Poland
Distribution: Slackware + Debian + Ubuntu
Posts: 170

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ponce View Post
Slackware 14.2 kernel supports "Filesystem wide access notification" (FANOTIFY), it's the "fanotify permissions checking" support that's not compiled in.

http://blog.clamav.net/2016/03/confi...in-clamav.html

Code:
If this is seen:

  CONFIG_FANOTIFY=y
  # CONFIG_FANOTIFY_ACCESS_PERMISSIONS is not set

Then on-access scanning will be constrained to notify-only mode
and will be unable to prevent access to malicious files, since
fanotify lacks the ability to block events on the system.
so, if notifying isn't enough for you and you want to prevent access you have to rebuild your kernel.

IMHO, this specific clamav function is useful mainly if you are monitoring samba shares via clamd, cannot think of other use cases: protecting unix home directories from viruses doesn't make much sense...
it make sense, if you have FTP account (with well known credentials) where customers can upload (only) files. Of course I can prevent uploading malicious file extensions, but sometimes is too less.
 
Old 07-27-2016, 12:49 PM   #4
MarcT
Member
 
Registered: Jan 2009
Location: UK
Distribution: Slackware 14.2
Posts: 125

Rep: Reputation: 51
Sounds like you'll need to recompile the kernel then. It's not too tough.

You should already have the kernel source in the package "kernel-source-4.4.14-noarch-1.txz". Personally I'd unpack a copy of this in a build directory in a non-root user's home directory. Don't build your kernel in /usr/src/linux.

For example, as a user:
mkdir build
cd build
xz -dc kernel-source-4.4.14-noarch-1.txz | tar xvf -

Use one of the existing "config" files from /boot as a template, rename it to .config (note the leading dot) at the top of the kernel source tree.
Edit .config to enable what you need.
Read the README (which should be in the kernel's top level directory, same as your new .config file).


Then do:

make oldconfig (this should run through without any prompts. Since you're rebuilding the same version of kernel there won't be any new/unanswered options).
time make
time make modules (if it's a modular kernel, as defined by the config file you used).

...then you'll have to install your new kernel & modules.

That's the subject of another post - see if you can get it re-compiled first.

Good luck!

Last edited by MarcT; 07-27-2016 at 12:51 PM.
 
Old 07-27-2016, 02:29 PM   #5
horizn
Member
 
Registered: Jan 2015
Location: UK and Poland
Distribution: Slackware + Debian + Ubuntu
Posts: 170

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by MarcT View Post
Sounds like you'll need to recompile the kernel then. It's not too tough.

You should already have the kernel source in the package "kernel-source-4.4.14-noarch-1.txz". Personally I'd unpack a copy of this in a build directory in a non-root user's home directory. Don't build your kernel in /usr/src/linux.

For example, as a user:
mkdir build
cd build
xz -dc kernel-source-4.4.14-noarch-1.txz | tar xvf -

Use one of the existing "config" files from /boot as a template, rename it to .config (note the leading dot) at the top of the kernel source tree.
Edit .config to enable what you need.
Read the README (which should be in the kernel's top level directory, same as your new .config file).


Then do:

make oldconfig (this should run through without any prompts. Since you're rebuilding the same version of kernel there won't be any new/unanswered options).
time make
time make modules (if it's a modular kernel, as defined by the config file you used).

...then you'll have to install your new kernel & modules.

That's the subject of another post - see if you can get it re-compiled first.

Good luck!
I've done it in past (kernel 2.6 era)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
AV Software that don't need fanotify and has support for proftpd? horizn Linux - Server 2 04-28-2015 03:37 AM
Ubuntu 7.10 Drivers [ or the lack off ] support ... K22 Linux - Software 3 03-27-2008 01:25 AM
Mp3 Support, or better said, the lack of it... winter_hanami Linux - Newbie 7 12-29-2007 05:40 AM
ATI [lack of] support jbeiter Linux - Hardware 0 11-09-2004 08:38 AM
Lack of support? flober Linux - Newbie 1 12-12-2001 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration