[PATCH] netfilter: h323: bug in parsing of ASN1 SEQOF field

Subsystems: netfilter, networking [general], the rest

STALE5615d

3 messages, 3 authors, 2011-04-04 · open the first message on its own page

[PATCH] netfilter: h323: bug in parsing of ASN1 SEQOF field

From: David Sterba <hidden>
Date: 2011-03-22 11:55:46

Static analyzer of clang found a dead store which appears to be a bug in
reading count of items in SEQOF field, only the lower byte of word is
stored. This may lead to corrupted read and communication shutdown.

The bug has been in the module since it's first inclusion into linux
kernel.

Signed-off-by: David Sterba <redacted>
CC: David Miller <davem@davemloft.net>
CC: netdev@vger.kernel.org
CC: stable@kernel.org
---
 net/netfilter/nf_conntrack_h323_asn1.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/netfilter/nf_conntrack_h323_asn1.c b/net/netfilter/nf_conntrack_h323_asn1.c
index 8678823..bcd5ed6 100644
--- a/net/netfilter/nf_conntrack_h323_asn1.c
+++ b/net/netfilter/nf_conntrack_h323_asn1.c
@@ -631,7 +631,7 @@ static int decode_seqof(bitstr_t *bs, const struct field_t *f,
 		CHECK_BOUND(bs, 2);
 		count = *bs->cur++;
 		count <<= 8;
-		count = *bs->cur++;
+		count += *bs->cur++;
 		break;
 	case SEMI:
 		BYTE_ALIGN(bs);
-- 
1.7.4.1.176.g501cc

Re: [PATCH] netfilter: h323: bug in parsing of ASN1 SEQOF field

From: David Miller <davem@davemloft.net>
Date: 2011-03-23 02:33:11

From: David Sterba <redacted>
Date: Tue, 22 Mar 2011 12:55:29 +0100
Static analyzer of clang found a dead store which appears to be a bug in
reading count of items in SEQOF field, only the lower byte of word is
stored. This may lead to corrupted read and communication shutdown.

The bug has been in the module since it's first inclusion into linux
kernel.

Signed-off-by: David Sterba <redacted>
Please send netfilter patches to the listed netfilter maintainer
and appropriate mailing lists.  I've added them to the CC:

Otherwise your patch will not be looked at by the right people.
quoted hunk
CC: David Miller <davem@davemloft.net>
CC: netdev@vger.kernel.org
CC: stable@kernel.org
---
 net/netfilter/nf_conntrack_h323_asn1.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/netfilter/nf_conntrack_h323_asn1.c b/net/netfilter/nf_conntrack_h323_asn1.c
index 8678823..bcd5ed6 100644
--- a/net/netfilter/nf_conntrack_h323_asn1.c
+++ b/net/netfilter/nf_conntrack_h323_asn1.c
@@ -631,7 +631,7 @@ static int decode_seqof(bitstr_t *bs, const struct field_t *f,
 		CHECK_BOUND(bs, 2);
 		count = *bs->cur++;
 		count <<= 8;
-		count = *bs->cur++;
+		count += *bs->cur++;
 		break;
 	case SEMI:
 		BYTE_ALIGN(bs);
-- 
1.7.4.1.176.g501cc

Re: [PATCH] netfilter: h323: bug in parsing of ASN1 SEQOF field

From: Patrick McHardy <hidden>
Date: 2011-04-04 13:24:29

On 23.03.2011 03:33, David Miller wrote:
From: David Sterba <redacted>
Date: Tue, 22 Mar 2011 12:55:29 +0100
quoted
Static analyzer of clang found a dead store which appears to be a bug in
reading count of items in SEQOF field, only the lower byte of word is
stored. This may lead to corrupted read and communication shutdown.

The bug has been in the module since it's first inclusion into linux
kernel.

Signed-off-by: David Sterba <redacted>
Please send netfilter patches to the listed netfilter maintainer
and appropriate mailing lists.  I've added them to the CC:

Otherwise your patch will not be looked at by the right people.
quoted
CC: David Miller <davem@davemloft.net>
CC: netdev@vger.kernel.org
CC: stable@kernel.org
---
 net/netfilter/nf_conntrack_h323_asn1.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/netfilter/nf_conntrack_h323_asn1.c b/net/netfilter/nf_conntrack_h323_asn1.c
index 8678823..bcd5ed6 100644
--- a/net/netfilter/nf_conntrack_h323_asn1.c
+++ b/net/netfilter/nf_conntrack_h323_asn1.c
@@ -631,7 +631,7 @@ static int decode_seqof(bitstr_t *bs, const struct field_t *f,
 		CHECK_BOUND(bs, 2);
 		count = *bs->cur++;
 		count <<= 8;
-		count = *bs->cur++;
+		count += *bs->cur++;
 		break;
This looks correct to me. The problem is without practical consequence
though, the largest amount of sequence-of members we parse is 30.

Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help