[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E5DF2FF.7000803@windriver.com>
Date: Wed, 31 Aug 2011 16:38:23 +0800
From: Rongqing Li <rongqing.li@...driver.com>
To: <rongqing.li@...driver.com>
CC: <netdev@...r.kernel.org>, <selinux@...ho.nsa.gov>,
<linux-security-module@...r.kernel.org>
Subject: Re: [PATCH 0/2] Dump the sock's security context
On 08/31/2011 04:36 PM, rongqing.li@...driver.com wrote:
> -------
> Any review would be much appreciated.
>
> Comments:
> --------
> Add a netlink attribute INET_DIAG_SECCTX
>
> Add a new netlink attribute INET_DIAG_SECCTX to dump the security
> context of TCP sockets.
>
> The element sk_security of struct sock represents the socket
> security context ID, which is inherited from the parent process
> when the socket is created.
>
> but when SELinux type_transition rule is applied to socket, or
> application sets /proc/xxx/attr/createsock, the socket security
> context would be different from the creating process. For these
> conditions, the "netstat -Z" would return wrong value, since
> "netstat -Z" only returns the process security context as socket
> process security.
>
>
> The application to verify the netlink new attribute.
> ------
> See attached file
>
> test:
> --------
> 1. Enable SELinux when compile and startup .
> root@...u-host:/root> ./printsocketsec
> inode:7141 system_u:system_r:rpcbind_t:s0
> inode:7136 system_u:system_r:rpcbind_t:s0
> inode:7604 system_u:system_r:initrc_t:s0
> inode:7227 system_u:system_r:rpcd_t:s0
> inode:7471 system_u:system_r:sshd_t:s0-s0:c0.c1023
> inode:7469 system_u:system_r:sshd_t:s0-s0:c0.c1023
> inode:7552 system_u:system_r:sendmail_t:s0
> inode:7348 system_u:system_r:initrc_t:s0
> inode:7553 system_u:system_r:sendmail_t:s0
> root@...u-host:/root>
>
> 2. Disable SELinux when startup.
> root@...u-host:/root> ./printsocketsec
> inode:3221
> inode:2942
> inode:2861
> inode:3256
> inode:3156
> inode:3220
> inode:3060
> root@...u-host:/root>
>
> 3. Disable SELinux when compile and startup
> root@...u-host:/root> ./printsocketsec
> inode:3221
> inode:2942
> inode:2861
> inode:3256
> inode:3156
> inode:3220
> inode:3060
> root@...u-host:/root>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Best Reagrds,
Roy | RongQing Li
View attachment "printsocketsec.c" of type "text/x-csrc" (2877 bytes)
Powered by blists - more mailing lists