public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH] secmark: fix config problem when CONFIG_NF_CONNTRACK_SECMARK is not set
@ 2010-10-19 22:17 Eric Paris
  2010-10-19 22:34 ` James Morris
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Paris @ 2010-10-19 22:17 UTC (permalink / raw)
  To: jmorris; +Cc: linux-next, linux-kernel, paul.moore, kaber, sfr

When CONFIG_NF_CONNTRACK_SECMARK is not set we accidentally attempt to use
the secmark fielf of struct nf_conn.  Problem is when that config isn't set
the field doesn't exist.  whoops.  Wrap the incorrect usage in the config.

Signed-off-by: Eric Paris <eparis@redhat•com>
---

 net/netfilter/nf_conntrack_netlink.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index b3c6285..146476c 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -582,9 +582,11 @@ ctnetlink_conntrack_event(unsigned int events, struct nf_ct_event *item)
 		    && ctnetlink_dump_helpinfo(skb, ct) < 0)
 			goto nla_put_failure;
 
+#ifdef CONFIG_NF_CONNTRACK_SECMARK
 		if ((events & (1 << IPCT_SECMARK) || ct->secmark)
 		    && ctnetlink_dump_secctx(skb, ct) < 0)
 			goto nla_put_failure;
+#endif
 
 		if (events & (1 << IPCT_RELATED) &&
 		    ctnetlink_dump_master(skb, ct) < 0)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] secmark: fix config problem when CONFIG_NF_CONNTRACK_SECMARK is not set
  2010-10-19 22:17 [PATCH] secmark: fix config problem when CONFIG_NF_CONNTRACK_SECMARK is not set Eric Paris
@ 2010-10-19 22:34 ` James Morris
  0 siblings, 0 replies; 2+ messages in thread
From: James Morris @ 2010-10-19 22:34 UTC (permalink / raw)
  To: Eric Paris; +Cc: linux-next, linux-kernel, paul.moore, kaber, sfr

On Tue, 19 Oct 2010, Eric Paris wrote:

> When CONFIG_NF_CONNTRACK_SECMARK is not set we accidentally attempt to use
> the secmark fielf of struct nf_conn.  Problem is when that config isn't set
> the field doesn't exist.  whoops.  Wrap the incorrect usage in the config.
> 
> Signed-off-by: Eric Paris <eparis@redhat•com>

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6#next

-- 
James Morris
<jmorris@namei•org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-19 22:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-19 22:17 [PATCH] secmark: fix config problem when CONFIG_NF_CONNTRACK_SECMARK is not set Eric Paris
2010-10-19 22:34 ` James Morris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox