]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/quagga/0008-bgpd-security-fix-infinite-loop-on-certain-invalid-O.patch
quagga: add upstream security fixes
[coffee/buildroot.git] / package / quagga / 0008-bgpd-security-fix-infinite-loop-on-certain-invalid-O.patch
1 From ce07207c50a3d1f05d6dd49b5294282e59749787 Mon Sep 17 00:00:00 2001
2 From: Paul Jakma <paul@jakma.org>
3 Date: Sat, 6 Jan 2018 21:20:51 +0000
4 Subject: [PATCH] bgpd/security: fix infinite loop on certain invalid OPEN
5  messages
6
7 Security issue: Quagga-2018-1975
8 See: https://www.quagga.net/security/Quagga-2018-1975.txt
9
10 * bgpd/bgp_packet.c: (bgp_capability_msg_parse) capability parser can infinite
11   loop due to checks that issue 'continue' without bumping the input
12   pointer.
13
14 Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
15 ---
16  bgpd/bgp_packet.c | 4 ++--
17  1 file changed, 2 insertions(+), 2 deletions(-)
18
19 diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
20 index b3d601fc..f9338d8d 100644
21 --- a/bgpd/bgp_packet.c
22 +++ b/bgpd/bgp_packet.c
23 @@ -2328,7 +2328,8 @@ bgp_capability_msg_parse (struct peer *peer, u_char *pnt, bgp_size_t length)
24  
25    end = pnt + length;
26  
27 -  while (pnt < end)
28 +  /* XXX: Streamify this */
29 +  for (; pnt < end; pnt += hdr->length + 3)
30      {      
31        /* We need at least action, capability code and capability length. */
32        if (pnt + 3 > end)
33 @@ -2416,7 +2417,6 @@ bgp_capability_msg_parse (struct peer *peer, u_char *pnt, bgp_size_t length)
34            zlog_warn ("%s unrecognized capability code: %d - ignored",
35                       peer->host, hdr->code);
36          }
37 -      pnt += hdr->length + 3;
38      }
39    return 0;
40  }
41 -- 
42 2.11.0
43