lwip: Security fixes; PPPoS null-deref; NAPT ip-forward

* Cherry-pick important fixes to 2.1.2-esp
  - CVE-2020-22283: Attacker could craft a packet that would disclose 8 bytes of some heap memory:
    - icmp6: Don't copy too much data
    - icmp6: Fix copying of chained pbuf in reply
    - icmp6: keep to the RFC and send as much as possible with icmp6 error messages
  - CVE-2020-22284: ZEP - ZigBee Encapsulation Protocol/6LoWPAN is not supported in IDF,
    the netif module (zepif.c) is not included in the build, but users can still inject
    the file into compilation process, implement IO interface and use this.
    - zepif: Copy possibly chained output pbuf properly
    - Add #define for minimum IPv6 MTU length
    - pbuf: Add pbuf_copy_partial_pbuf library function
* PPPoS: Fix null-deref when processing double break packet
  - pppos: fix in_tail null (espressif/esp-lwip@537c69d5)
  - PPP: Add test exhibiting empty packet null-deref (espressif/esp-lwip@202a07da)
* NAPT: Fix PBUF_REF type to clone the pbuf before forwarding
  - IP-FORWARD: If packet-type is PBUF_REF clone it before forwarding
  - Add NAPT unit test to exercise NAT feature for both RAM and REF pbuf types
* version: Update version numbers to match 2.1.2-esp
* Minor fixes listed below: Fix client receive KOD, NAPT fixes, restore
  dhcp_cb, sntp docs, vendor class id (disabled)

* Update submodule: 2195f7416f...76303df238

Detailed description of the changes:
  - test/napt: Add unit test for IP forward with PBUF_REF (espressif/esp-lwip@76303df2)
  - napt: Fix PBUF_REF type to clone the pbuf before forwarding (espressif/esp-lwip@39068263)
  - version: Update version numbers to match 2.1.2-esp (espressif/esp-lwip@2b922919)
  - pppos: fix in_tail null (espressif/esp-lwip@537c69d5)
  - PPP: Add test exhibiting empty packet null-deref (espressif/esp-lwip@202a07da)
  - pbuf: Add pbuf_copy_partial_pbuf library function (espressif/esp-lwip@1c9cd9c1)
  - Add #define for minimum IPv6 MTU length (espressif/esp-lwip@d2dc577b)
  - zepif: Copy possibly chained output pbuf properly (espressif/esp-lwip@64ab7f2a)
  - icmp6: Don't copy too much data (espressif/esp-lwip@4a64731b)
  - icmp6: Fix copying of chained pbuf in reply (espressif/esp-lwip@7c822ff4)
  - icmp6: keep to the RFC and send as much as possible with icmp6 error messages (espressif/esp-lwip@29100ab6)
  - dns: Add API to clear dns cache (espressif/esp-lwip@ee59f77d)
  - CI: Fixed adding gitlab key (espressif/esp-lwip@5a2bdba7)
  - test case: modify test case test_tcp_new_max_num_remove_FIN_WAIT_1 (espressif/esp-lwip@6b090f7d)
  - add function for deinit lwip timers (espressif/esp-lwip@2749568f)
  - dhcp: Fix build issue that set ESP_DHCP_DISABLE_VENDOR_CLASS_IDENTIFIER to true will build fail (espressif/esp-lwip@d827dbf7)
  - Document that sntp_setservername doesn't copy the string (espressif/esp-lwip@54acdb59) #6786
  - lwip/dhcp: add 60 option for vendor class identify (espressif/esp-lwip@ae7edc2a) espressif/esp-lwip#32
  - dhcp: Restore dhcp_cb on restart after dhcp_release_and_stop() (espressif/esp-lwip@55ea9d9c) #7217
  - napt: Fix disbale IPv6 and enable NAPT will build error (espressif/esp-lwip@74cf7f9f)
  - napt: fix checksum of UDP (espressif/esp-lwip@bb63eed1)
  - sntp: Fix client receive KOD packet that make pool MEMP_SYS_TIMEOUT not be freed (espressif/esp-lwip@1c1642fe)
  - test case: add tcp state and reset test cases. (espressif/esp-lwip@67deb805)

Closes https://github.com/espressif/esp-idf/issues/8300
Closes https://github.com/espressif/esp-idf/issues/8451
This commit is contained in:
David Cermak 2022-02-21 13:33:06 +01:00
parent 79cdc465fd
commit e00a689a77
2 changed files with 2 additions and 1 deletions

@ -1 +1 @@
Subproject commit 2195f7416fb3136831babf3e96c027a73075bd4f
Subproject commit 76303df2386902e0d7873be4217f1d9d1b50f982

View File

@ -982,6 +982,7 @@
#define ESP_LWIP_SELECT 1
#define ESP_LWIP_LOCK 1
#define ESP_THREAD_PROTECTION 1
#define ESP_IP_FORWARD 1
#ifdef CONFIG_LWIP_IPV6_AUTOCONFIG
#define ESP_IPV6_AUTOCONFIG CONFIG_LWIP_IPV6_AUTOCONFIG