lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 20 May 2009 22:58:26 +0900
From:	hooanon05@...oo.co.jp
To:	Marcin Krol <mrkafk@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: inotify limits - thousands (tens of thousands?) of watches 


Marcin Krol:
> I'm not a kernel programmer, but I want to develop a program that would 
> watch modifications in *all* user directories on a busy server using 
> inotify.
	:::
> 1. is it safe? that is, will it not lock the kernel up, or cause 
> excessive memory consumption?
> 
> 2. is it economic in terms of CPU time and RAM? I have no idea how to 
> even measure such a thing happening in the kernel..

The maximum number of inotify instances per user is limited to
/proc/sys/fs/inotify/max_user_instances which is 128 by default.
And also the number of watches per user is limited by
/proc/sys/fs/inotify/max_user_watches (8192 by defaut).
Theoretically you may be able to monitor 8192 directories, but it
consumes memory.

If periodical rsync is out of question for you, how about kprobe?
While I don't think it is a beautiful solution, to set a hook to
vfs_mkdir, vfs_unlink, etc and to compare the target super_block may
work for you.
See Documentation/kprobe.txt in detail.


J. R. Okajima
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ