they were collected from the comments of Sophos, CA, and McAfee on
malware-list@lists.printk.net back in January 2008. I can't find the
lists archived on the net so I will post the raw messages tomorrow from
my local mail store and send a link.
It may be possible to do in glibc, LD_PRELOAD doesn't exactly work for
suid binaries
The model only makes claims about open and I want to be forthright with
its shortcomings. It sounds rather unreasonable to think that every
time I want to read one bite from a file which is being concurrently
written by another process some virus scanner should have to reread and
validate the entire file. I think as some point we have to accept the
fact that there is no feasible perfect solution (no you can't do write
time checking since circumventing that is as simple as splitting your
bad bits into two writes...)
I'm willing to say that opens after (1) are going to be validated. I am
not certain that all executables opened for write while they are being
executed return ETXTBSY (I do know it happens at least sometimes) so I'm
willing to drop that idea.
I'll definitely go back and look, but I think I use bit lengths for
everything in the communication channel so its only endian issues to
worry about.
As long as the requirement that the first 32 bits be a version it might
make ugly code but any future expansions are easy to deal with. Read
from userspace, get the first 32 bits, cast the read from userspace to
the correct structure. What would you suggest?
Opps, old description. I do just use an inode in securityfs, not a misc
character device. I'm not clear what netlink would buy here. I might
be able to make my async close vetting code a little cleaner, but it
would make other things more complex (like registration and actually
having to track userspace clients)
I'm not sure the security issues that you are refering too, do you mean
do we make LSM checks and regular DAC checks for the userspace client on
the file in question? yes.
The userspace client is forced to respond to all fd's it is handed. If
userspace decided to respond to a request but never close the file the
client will eventually run out of fds and I really should make sure I
have decent error handling for that case. No real damage done aside
from extra references outstanding until the client program dies. Much
the same way as any program that calls open on files it doesn't ever
close....
Its only the one structure (ok and the response)
include/linux/talpa.h
struct talpa_packet_client
struct talpa_packet_kernel
The same things that happens to every other subsystem that uses uint32_t
to describe uid (like audit?) It either gets truncated massive main
ensues...
Honstely? I don't know. Maybe someone with access to the black magic
source code will stand up and say if most of this metadata is important
and if so how.
Not sure what you mean here. On sys_open the original program is
blocking until the userspace client answers allow or deny. Both the
original program fd and the fd that magically appeared in the client
point to the same dentry. Names may move around but its going to be the
same 'name' for both of them. I don't see a race here....
Processes can only get this flag one of 2 ways.
1) register as a client to make access decisions
2) echo 1 into the magic file to enable the flag for themselves
A process can only set this flag on itself and having this flag only
means that your opens and closes will not be scanned. And exculded
program could write a virus and it would not be caught on close, but it
would be caught on the next open.
Perf win, why bothering looking for malware in /proc when it can't
exist? It doesn't take longer it just takes time having to do
userspace -> kernel -> userspace -> kernel -> userspace
just to cat /proc/mounts, all of this could probably be alliviated if we
cached access on non block backed files but then we have to come up with
a way to exclude only nfs/cifs. I'd rather list the FSs that don't need
scanning every time than those that do....
You have to be root and I'll probably add an LSM hook?
In kernel caching is clearly a huge perf win. I couldn't even measure a
change in kernel build time when I didn't run a userspace client. If
anyone can explain a way to get race free in kernel caching and out of
kernel redirection and scanning I'd love it :)
I'll post numbers on perf in the next day or 2.
--