aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/nghttp2/nghttp2/CVE-2020-11080-1.patch
blob: ca181bb4b2cb494d791a68ed092833c0ad8de54b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From f8da73bd042f810f34d19f9eae02b46d870af394 Mon Sep 17 00:00:00 2001
From: James M Snell <jasnell@gmail.com>
Date: Sun, 19 Apr 2020 09:12:24 -0700
Subject: [PATCH] Earlier check for settings flood

CVE: CVE-2020-11080
Upstream-Status: Backport [https://github.com/nghttp2/nghttp2/commit/f8da73bd042f810f34d19f9eae02b46d870af394.patch]
Comment: No hunk refreshed
Affects-version: < v1.41.0
Signed-off-by: Rahul Taya <Rahul.Taya@kpit.com>
---
 lib/nghttp2_session.c | 6 ++++++
 1 file changed, 6 insertions(+)

Index: nghttp2-1.40.0/lib/nghttp2_session.c
===================================================================
--- nghttp2-1.40.0.orig/lib/nghttp2_session.c
+++ nghttp2-1.40.0/lib/nghttp2_session.c
@@ -5678,6 +5678,12 @@ ssize_t nghttp2_session_mem_recv(nghttp2
           break;
         }
 
+        /* Check the settings flood counter early to be safe */
+        if (session->obq_flood_counter_ >= session->max_outbound_ack &&
+            !(iframe->frame.hd.flags & NGHTTP2_FLAG_ACK)) {
+          return NGHTTP2_ERR_FLOODED;
+        }
+
         iframe->state = NGHTTP2_IB_READ_SETTINGS;
 
         if (iframe->payloadleft) {