OSDN Git Service

asn1: additional sanity checking during BER decoding (CVE-2008-1673)
authorChris Wright <chrisw@sous-sol.org>
Wed, 4 Jun 2008 16:16:33 +0000 (09:16 -0700)
committerWilly Tarreau <w@1wt.eu>
Thu, 5 Jun 2008 22:11:50 +0000 (00:11 +0200)
commit53d12affc55d827d895fba7b902fb03ec2098a29
tree15564e4de1fff7979b7145bc666a0c31bcc88e3f
parente5e375dae22e18119dcd45229550aff4f4a77bf6
asn1: additional sanity checking during BER decoding (CVE-2008-1673)

[backport of 2.6 commit ddb2c43594f22843e9f3153da151deaba1a834c5]

- Don't trust a length which is greater than the working buffer.
  An invalid length could cause overflow when calculating buffer size
  for decoding oid.

- An oid length of zero is invalid and allows for an off-by-one error when
  decoding oid because the first subid actually encodes first 2 subids.

- A primitive encoding may not have an indefinite length.

Thanks to Wei Wang from McAfee for report.

Cc: Steven French <sfrench@us.ibm.com>
Cc: stable@kernel.org
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[w@1wt.eu: backported to 2.4 : no cifs ; snmp in ip_nat_snmp_basic.c]
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/ipv4/netfilter/ip_nat_snmp_basic.c