Thread (2 messages) flat view 2 messages, 2 authors, 2010-03-07

Re: [RFC v2 00/10] snet: Security for NETwork syscalls

From: Samir Bellabes <hidden>
Date: 2010-03-06 18:48:06
Also in: lkml, netfilter-devel

Tetsuo Handa [off-list ref] writes:
Regarding [RFC v2 09/10] snet: introduce snet_ticket
+enum snet_verdict snet_ticket_check(struct snet_info *info)
+{
+       struct snet_ticket *st = NULL;
+       unsigned int h = 0, verdict = SNET_VERDICT_NONE;
+       struct list_head *l = NULL;
+       struct snet_task_security *tsec = NULL;
+
+       if (snet_ticket_mode == SNET_TICKET_OFF)
+               goto out;
+
+       tsec = (struct snet_task_security*) current_security();
+
+       h = jhash_2words(info->syscall, info->protocol, 0) % HSIZE;
+       l = &tsec->hash[h];
+
+       read_lock_bh(&tsec->lock);

Credentials are allocated for copy-on-write basis.
Sharing "tsec" among multiple "struct task_struct" is what you intended?
No, there is no shared "tsec".
snet_ticket_check() is called from the process context. So "tsec" is
a pointer to the "void *security" pointer from its own "struct
task_struct".

every task_struct have a "tsec" allocated to its "void *security"
pointer. 

I will take a second look on how to access the credentials COW.
Regards.
Tetsuo, thank you again for reviewing.
sam
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help