From: Justin McCann <jneilm@yahoo.com>
To: netfilter-devel@vger.kernel.org
Subject: Get UID from netlink/conntrack
Date: Wed, 6 Feb 2008 12:30:07 -0800 (PST) [thread overview]
Message-ID: <438194.92391.qm@web30402.mail.mud.yahoo.com> (raw)
I'd like to use libnetfilter_conntrack to track connections per UID and/or by PID, but AFAICT the nfnetlink conntrack messages don't include the user id, process id, or inode (useful for cross-referencing). I noticed that the nfnetlink_log messages have the uid, but I don't think I want to invoke the filtering & logging subsystem just to track connection changes.
If I were to add the UID and/or pid or inode to the conntrack messages, what's the right way to go about doing that? I realize I'd have to patch the kernel, libnetfilter_conntrack, and conntrack-tools, but I'd like to do that in a way that won't break the messaging protocol for other applications if possible.
On the kernel side, I think this requires:
- make an additional enum ctattr_type (CTA_UID)
- include that attribute in the IPCNTL_MSG_CT_{NEW,UPDATE,DELETE} messages
- add a ctnetlink_dump_uid() function, using NFA_PUT with the result of sock_i_uid(skb->sock)
- add the call to ctnetlink_dump_uid() in ctnetlink_fill_info()
With the appropriate mods in libnetfilter_conntrack, and maybe an option to the conntrack command line tool to output that info if requested.
Is this the right way to go about it, and if so would that break anything in terms of backwards compatibility (e.g. programs using older versions of the libraries)? Any other reason not to do it?
Thanks,
Justin McCann
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
next reply other threads:[~2008-02-06 20:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-06 20:30 Justin McCann [this message]
2008-02-06 21:02 ` Get UID from netlink/conntrack Jan Engelhardt
-- strict thread matches above, loose matches on Subject: below --
2008-02-07 2:04 Justin McCann
2008-02-07 2:14 ` Jan Engelhardt
2008-02-07 3:28 Justin McCann
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=438194.92391.qm@web30402.mail.mud.yahoo.com \
--to=jneilm@yahoo.com \
--cc=netfilter-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.