提交 25845b51 编写于 作者: J Jing Min Zhao 提交者: David S. Miller

[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: NJing Min Zhao <zhaojingmin@vivecode.com>
Signed-off-by: NPatrick McHardy <kaber@trash.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2cd052e4
...@@ -518,7 +518,7 @@ int decode_seq(bitstr_t * bs, field_t * f, char *base, int level) ...@@ -518,7 +518,7 @@ int decode_seq(bitstr_t * bs, field_t * f, char *base, int level)
CHECK_BOUND(bs, 2); CHECK_BOUND(bs, 2);
len = get_len(bs); len = get_len(bs);
CHECK_BOUND(bs, len); CHECK_BOUND(bs, len);
if (!base) { if (!base || !(son->attr & DECODE)) {
PRINT("%*.s%s\n", (level + 1) * TAB_SIZE, PRINT("%*.s%s\n", (level + 1) * TAB_SIZE,
" ", son->name); " ", son->name);
bs->cur += len; bs->cur += len;
...@@ -704,6 +704,8 @@ int decode_choice(bitstr_t * bs, field_t * f, char *base, int level) ...@@ -704,6 +704,8 @@ int decode_choice(bitstr_t * bs, field_t * f, char *base, int level)
} else { } else {
ext = 0; ext = 0;
type = get_bits(bs, f->sz); type = get_bits(bs, f->sz);
if (type >= f->lb)
return H323_ERROR_RANGE;
} }
/* Write Type */ /* Write Type */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册