Skip to contentSkip to conversation

security module question

DISCUSSION Justin Banks 4 participants 4 messages Aug 4, 2009 – Aug 6, 2009

lore
Share & tools
lore
#0 lore raw

Hello - I'm trying to implement a security module that will allow or disallow writes on files by byte ranges. Is there a way to use inode_permission() to do this, or is there an alternative route I should take? It doesn't look like inode_permission() will give me the data I need (offset + length of write).

Also, is there a security module that will examine data being written for certain patterns or content?

Please CC: me on responses. I used to be subscribed, but the traffic was just too much.

-justinb

Signature · 3 lines
Justin Banks
BakBone Software
[email protected]
#1 lore raw
Quoted 5 lines · Justin Banks

Hello - I'm trying to implement a security module that will allow or disallow writes on files by byte ranges. Is there a way to use inode_permission() to do this, or is there an alternative route I should take? It doesn't look like inode_permission() will give me the data I need (offset + length of write).

This doesn't seem to fit with the LSM model, where access is mediated at object-level granularity. i.e. can user A read file B ?

Quoted 2 lines

Also, is there a security module that will examine data being written for certain patterns or content?

The fanotify / TALPA file access scanning work being done by Eric Paris might be more appropriate.

See http://lwn.net/Articles/339399/

Quoted 2 lines

Please CC: me on responses. I used to be subscribed, but the traffic was just too much.

You probably want the LSM mailing list (cc'd).

Signature · 2 lines
James Morris
<[email protected]>
#2 lore raw
Quoted 7 lines · James Morris
Quoted 5 lines · Justin Banks

Hello - I'm trying to implement a security module that will allow or disallow writes on files by byte ranges. Is there a way to use inode_permission() to do this, or is there an alternative route I should take? It doesn't look like inode_permission() will give me the data I need (offset + length of write).

There is nothing that can do that. Neither fanotify nor the LSM. Biggest problem is mmap.....

I think there was past kernel module which did this, but I don't remember what they were called. Nothing which tracks this and could be used was ever reasonable for the mainline kernel.

-Eric

#3 lore raw
Quoted 9 lines · Eric Paris
Quoted 7 lines · James Morris
Quoted 5 lines · Justin Banks

Hello - I'm trying to implement a security module that will allow or disallow writes on files by byte ranges. Is there a way to use inode_permission() to do this, or is there an alternative route I should take? It doesn't look like inode_permission() will give me the data I need (offset + length of write).

Quoted 6 lines

There is nothing that can do that. Neither fanotify nor the LSM. Biggest problem is mmap.....

I think there was past kernel module which did this, but I don't remember what they were called. Nothing which tracks this and could be used was ever reasonable for the mainline kernel.

stackable file-system could do it (ala ecryptfs). You'd end up with double page table usage (as they don't stack well), but you'd be able to catch all mmap writes to disk.