]> git.proxmox.com Git - mirror_frr.git/commit
bgpd: fix missing bounds checks for psid attr
authorQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 22 Nov 2019 07:49:45 +0000 (02:49 -0500)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 3 Jan 2020 19:06:31 +0000 (14:06 -0500)
commitf69aeb7696461fc333dc8b12a55f8160a80db1fc
tree40ff8f44f6110e01eb6f5550de0e5201ae633ac6
parentf8034506de01e8f77ff470acec3fdbbd9a05dd2d
bgpd: fix missing bounds checks for psid attr

Guess what - for a bounds check to work, it has to happen *before* you
read the data. We were trusting the attribute field received in a prefix
SID attribute and then checking if it was correct afterwards, but if was
wrong we'd crash before that.

This fixes the problem, and adds additional paranoid bounds checks.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
bgpd/bgp_attr.c
bgpd/bgp_attr.h
tests/bgpd/test_mp_attr.c