From: Markku Savela <msa@moth.iki.fi>
To: linux-kernel@vger.kernel.org
Subject: Re: How to find origin PID of a sk_buff in iptables match?
Date: Fri, 05 Sep 2008 14:21:03 +0300 [thread overview]
Message-ID: <877i9qu9cw.fsf@burp.tkv.asdf.org> (raw)
In-Reply-To: <b8ixO-2NS-5@gated-at.bofh.it> (Markku Savela's message of "Thu\, 04 Sep 2008 10\:40\:08 +0200")
> 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?
next parent reply other threads:[~2008-09-05 11:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <b8ixO-2NS-5@gated-at.bofh.it>
2008-09-05 11:21 ` Markku Savela [this message]
2008-09-05 11:49 ` How to find origin PID of a sk_buff in iptables match? Markku Savela
2008-09-04 8:32 Markku Savela
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877i9qu9cw.fsf@burp.tkv.asdf.org \
--to=msa@moth.iki.fi \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox