Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport the security patch of CVE-2024-31949 #16607

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions bgpd/bgp_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -2710,6 +2710,7 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
zlog_info("%s Capability length error", peer->host);
bgp_notify_send(peer, BGP_NOTIFY_CEASE,
BGP_NOTIFY_SUBCODE_UNSPECIFIC);
pnt += length;
return BGP_Stop;
}
action = *pnt;
Expand All @@ -2722,7 +2723,7 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
peer->host, action);
bgp_notify_send(peer, BGP_NOTIFY_CEASE,
BGP_NOTIFY_SUBCODE_UNSPECIFIC);
return BGP_Stop;
goto done;
}

if (bgp_debug_neighbor_events(peer))
Expand All @@ -2743,6 +2744,7 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
zlog_info("%s Capability length error", peer->host);
bgp_notify_send(peer, BGP_NOTIFY_CEASE,
BGP_NOTIFY_SUBCODE_UNSPECIFIC);
pnt += length;
return BGP_Stop;
}

Expand All @@ -2758,7 +2760,7 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
/* Ignore capability when override-capability is set. */
if (CHECK_FLAG(peer->flags,
PEER_FLAG_OVERRIDE_CAPABILITY))
continue;
goto done;

/* Convert AFI, SAFI to internal values. */
if (bgp_map_afi_safi_iana2int(pkt_afi, pkt_safi, &afi,
Expand Down Expand Up @@ -2805,6 +2807,8 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
"%s unrecognized capability code: %d - ignored",
peer->host, hdr->code);
}
done:
pnt += hdr->length + 3;
}

/* No FSM action necessary */
Expand Down
Loading