All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Cc: Patrick McHardy <kaber@trash.net>,
	Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>
Subject: [PATCH] fix nf_conntrack_netlink expectation dumping/event notification
Date: Fri, 13 Jan 2006 02:41:10 +0100	[thread overview]
Message-ID: <43C70536.7000608@netfilter.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 692 bytes --]

Hi Yasuyuki,

Currently we get an oops with nf_conntrack_netlink + nf_conntrack_ftp
because l3num is set to 0xFFFF for the expectation mask. At first sight,
this is correct because l3num is u_int16_t, but the size of the layer-3
array of protocol handlers is AF_MAX (32).

I could add some checking to verify that l3num is less than 32 in
nf_conntrack_find_l3proto, but such checking is only required for
nf_conntrack_ftp and further application helpers. AFAICS, this is the
cleanest way to fix this problem. Any other suggestion?

Cheers,
Pablo

-- 
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris

[-- Attachment #2: x1 --]
[-- Type: text/plain, Size: 849 bytes --]

Set l3num to 0x1F (32) in expectation masks since the size of the layer 3 
procotol handler array is AF_MAX. This fixes a panic at expectation dumping
and event notification.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Index: netfilter-2.6.14.git/net/netfilter/nf_conntrack_ftp.c
===================================================================
--- netfilter-2.6.14.git.orig/net/netfilter/nf_conntrack_ftp.c	2006-01-08 21:24:44.000000000 +0100
+++ netfilter-2.6.14.git/net/netfilter/nf_conntrack_ftp.c	2006-01-08 21:33:52.000000000 +0100
@@ -574,7 +574,7 @@ static int help(struct sk_buff **pskb,
 	exp->tuple.dst.protonum = IPPROTO_TCP;
 
 	exp->mask = (struct nf_conntrack_tuple)
-		    { .src = { .l3num = 0xFFFF,
+		    { .src = { .l3num = 0x001F,
 			       .u = { .tcp = { 0 }},
 			     },
 		      .dst = { .protonum = 0xFF,

             reply	other threads:[~2006-01-13  1:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-13  1:41 Pablo Neira Ayuso [this message]
2006-01-13  8:58 ` [PATCH] fix nf_conntrack_netlink expectation dumping/event notification Patrick McHardy
2006-01-13  9:02   ` Yasuyuki KOZAKAI
     [not found]   ` <200601130902.k0D92fVM026246@toshiba.co.jp>
2006-01-13  9:04     ` Patrick McHardy
2006-01-13  9:38       ` Yasuyuki KOZAKAI
     [not found]       ` <200601130938.k0D9c6Yo007986@toshiba.co.jp>
2006-01-13  9:45         ` Patrick McHardy
2006-01-13 10:12           ` YOSHIFUJI Hideaki / 吉藤英明
2006-01-13 10:44             ` Patrick McHardy
     [not found]       ` <200601130938.k0D9c6ud007984@toshiba.co.jp>
2006-01-13 11:17         ` Pablo Neira Ayuso
2006-01-15 13:07           ` Yasuyuki KOZAKAI
2006-01-20  4:57             ` expectation mask handling in nfctnetlink (Was Re: [PATCH] fix nf_conntrack_netlink expectation dumping/event notification) Yasuyuki KOZAKAI
2006-02-01  2:09               ` Pablo Neira Ayuso
2006-02-01 11:04                 ` Patrick McHardy
     [not found]                   ` <200602011335.k11DZHwj018072@toshiba.co.jp>
2006-02-02  0:45                     ` [RFC] [PATCH] Fix expectation mask dumping (Was Re: expectation mask handling in nfctnetlink) Pablo Neira Ayuso
2006-02-02 10:30                       ` [RFC] [PATCH] Fix expectation mask dumping Yasuyuki KOZAKAI
2006-02-05 23:54                       ` [PATCH] Fix expectation mask dumping, take #2 Pablo Neira Ayuso
2006-02-06  2:15                         ` Yasuyuki KOZAKAI
2006-02-08 11:26                         ` Yasuyuki KOZAKAI
     [not found]                         ` <200602081126.k18BQWLj029476@toshiba.co.jp>
2006-02-08 12:25                           ` Pablo Neira Ayuso
2006-02-01 13:16                 ` expectation mask handling in nfctnetlink Yasuyuki KOZAKAI
2006-02-01 13:35             ` Yasuyuki KOZAKAI

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=43C70536.7000608@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=yasuyuki.kozakai@toshiba.co.jp \
    /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.