[pve-devel] [PATCH firewall] fix #2178: endless loop on ipv6 extension headers

Mira Limbeck m.limbeck at proxmox.com
Wed Apr 17 15:40:29 CEST 2019


increment header and decrement payload size by extension header size.
the length field of the extension header does not contain the size of the
extension header itself.

Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
---
 src/pvefw-logger.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pvefw-logger.c b/src/pvefw-logger.c
index f77f56f..5fbf62e 100644
--- a/src/pvefw-logger.c
+++ b/src/pvefw-logger.c
@@ -628,8 +628,8 @@ print_nexthdr(struct log_entry *le, char *hdr, int payload_len, u_int8_t proto)
         /* next header: */
         if (check_ip6ext(le, exthdr, payload_len) < 0)
             return -1;
-        hdr += exthdr->ip6e_len;
-        payload_len -= exthdr->ip6e_len;
+        hdr += exthdr->ip6e_len + sizeof(*exthdr);
+        payload_len -= exthdr->ip6e_len + sizeof(*exthdr);
     }
 }
 
-- 
2.11.0





More information about the pve-devel mailing list