Messages in this thread | | | Subject | Re: How to find origin PID of a sk_buff in iptables match? | From | Markku Savela <> | Date | Fri, 05 Sep 2008 14:21:03 +0300 |
| |
> Also, I noticed that in my match code in OUTPUT chain, the current > task seemed to the originator I want (ping test). However, I'm not > quite sure whether this is always true?
Well, nobody answered.
Anyway, as suspected with TCP connections it seems that current->pid produces 0 very often after the first initial packet (SYN). I take this to mean, that the TCP engine is being executed on some interrupt context?
Now I'm wondering how SELINUX manages to get the secmark right, as the code in iptables seems to eventually need the current task context? Something tricky being made using the SECMARK and CONNSECMARK? It seems to trust, that at least the first packet has the current task context properly set and the remaining packets of the connection don't need current task?
I guess I have to dug deeper in this (emulate what SELINUX does). Or can someone point to a tutorial description on how to reliably associate each outgoing packet with some originating task context?
| |