Pablo Neira Ayuso cba85b532e netfilter: fix export secctx error handling
In 1ae4de0cdf855305765592647025bde55e85e451, the secctx was exported
via the /proc/net/netfilter/nf_conntrack and ctnetlink interfaces
instead of the secmark.

That patch introduced the use of security_secid_to_secctx() which may
return a non-zero value on error.

In one of my setups, I have NF_CONNTRACK_SECMARK enabled but no
security modules. Thus, security_secid_to_secctx() returns a negative
value that results in the breakage of the /proc and `conntrack -L'
outputs. To fix this, we skip the inclusion of secctx if the
aforementioned function fails.

This patch also fixes the dynamic netlink message size calculation
if security_secid_to_secctx() returns an error, since its logic is
also wrong.

This problem exists in Linux kernel >= 2.6.37.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-01-06 11:25:00 -08:00
..
2010-10-25 13:09:44 -07:00
2010-12-19 21:59:35 -08:00
2011-01-06 11:16:54 -08:00
2010-12-10 12:49:23 +01:00
2010-09-23 14:33:39 -07:00
2010-10-21 15:44:13 +02:00
2010-09-23 14:33:39 -07:00
2011-01-05 16:07:12 -05:00
2010-12-19 21:59:35 -08:00
2010-04-20 16:37:13 -07:00
2010-11-15 13:24:06 -05:00
2011-01-05 13:39:17 -08:00
2010-12-16 13:44:24 -08:00
2010-12-16 13:44:24 -08:00
2010-10-15 15:53:27 +02:00