From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@davemloft.net>
Cc: security@kernel.org,
Netfilter Development Mailinglist
<netfilter-devel@lists.netfilter.org>,
stable@kernel.org
Subject: [NETFILTER]: nf_conntrack_h323: add checking of out-of-range on choices' index values
Date: Thu, 05 Jul 2007 20:42:14 +0200 [thread overview]
Message-ID: <468D3B86.5020308@trash.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 141 bytes --]
Fix a remotely triggerable crash in the netfilter H.323 connection
tracking helper. Patch applies to stable 2.6.20/2.6.21 and current
-git.
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1610 bytes --]
[NETFILTER]: nf_conntrack_h323: add checking of out-of-range on choices' index values
Choices' index values may be out of range while still encoded in the fixed
length bit-field. This bug may cause access to undefined types (NULL
pointers) and thus crashes (Reported by Zhongling Wen).
This patch also adds checking of decode flag when decoding SEQUENCEs.
Signed-off-by: Jing Min Zhao <zhaojingmin@vivecode.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
commit 5e8b2229d2d2bdbc4c05e4b3176d5054efe6b146
tree f99e5a063dac012f3caea6e78d3f73d64d1e576a
parent 190045d53b9a8341e8600d6eb468b6081e903afb
author Patrick McHardy <kaber@trash.net> Thu, 05 Jul 2007 20:30:59 +0200
committer Patrick McHardy <kaber@trash.net> Thu, 05 Jul 2007 20:30:59 +0200
net/netfilter/nf_conntrack_h323_asn1.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/net/netfilter/nf_conntrack_h323_asn1.c b/net/netfilter/nf_conntrack_h323_asn1.c
index f6fad71..6b7eaa0 100644
--- a/net/netfilter/nf_conntrack_h323_asn1.c
+++ b/net/netfilter/nf_conntrack_h323_asn1.c
@@ -518,7 +518,7 @@ int decode_seq(bitstr_t * bs, field_t * f, char *base, int level)
CHECK_BOUND(bs, 2);
len = get_len(bs);
CHECK_BOUND(bs, len);
- if (!base) {
+ if (!base || !(son->attr & DECODE)) {
PRINT("%*.s%s\n", (level + 1) * TAB_SIZE,
" ", son->name);
bs->cur += len;
@@ -704,6 +704,8 @@ int decode_choice(bitstr_t * bs, field_t * f, char *base, int level)
} else {
ext = 0;
type = get_bits(bs, f->sz);
+ if (type >= f->lb)
+ return H323_ERROR_RANGE;
}
/* Write Type */
next reply other threads:[~2007-07-05 18:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-05 18:42 Patrick McHardy [this message]
2007-07-06 0:05 ` [NETFILTER]: nf_conntrack_h323: add checking of out-of-range on choices' index values David Miller
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=468D3B86.5020308@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=netfilter-devel@lists.netfilter.org \
--cc=security@kernel.org \
--cc=stable@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.