HomeFreeBSD

MFC r328350:

Description

MFC r328350:

Merge revision 1.35 from NetBSD:
  fix pointer/offset mistakes in handling of IPv4 options

Reported by:  Maxime Villard <maxv at NetBSD.org>

MFC r328352:

Adopt revision 1.76 and 1.77 from NetBSD:
  Fix a vulnerability in IPsec-IPv6-AH, that allows an attacker to remotely
  crash the kernel with a single packet.

  In this loop we need to increment 'ad' by two, because the length field
  of the option header does not count the size of the option header itself.

  If the length is zero, then 'count' is incremented by zero, and there's
  an infinite loop. Beyond that, this code was written with the assumption
  that since the IPv6 packet already went through the generic IPv6 option
  parser, several fields are guaranteed to be valid; but this assumption
  does not hold because of the missing '+2', and there's as a result a
  triggerable buffer overflow (write zeros after the end of the mbuf,
  potentially to the next mbuf in memory since it's a pool).

  Add the missing '+2', this place will be reinforced in separate commits.

Reported by:  Maxime Villard <maxv at NetBSD.org>

Details

Provenance
aeAuthored on
Parents
rS328620: MFC r328350:
Branches
Unknown
Tags
Unknown