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

lib:fix stream_get out of bounds #17529

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guoguojia2021
Copy link
Contributor

Description
If nexthop has ‘srte_color', zapi_nexthop_decode must have 'message' parameter, or stream_get will out of bounds.

Version
show version
FRRouting 10.3-dev-my-manual-build (router1) on Linux(4.15.0-213-generic).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

2024/11/27 09:38:54 BGP: [S48XV-GT1WC][EC 100663311] stream_getw2: Attempt to get out of bounds
2024/11/27 09:38:54 BGP: [RF6RD-ZCBTC][EC 100663311] &(struct stream): 0x562aa0765690, size: 41112, getp: 66, endp: 67
2024/11/27 09:38:54 BGP: Backtrace for 11 stack frames:
2024/11/27 09:38:54 BGP: [bt 0] /lib/libfrr.so.0(zlog_backtrace+0x4a) [0x7fd14ab4dd97]
2024/11/27 09:38:54 BGP: [bt 1] /lib/libfrr.so.0(stream_getw2+0x252) [0x7fd14abeade7]
2024/11/27 09:38:54 BGP: [bt 2] /lib/libfrr.so.0(+0x272b35) [0x7fd14ac40b35]
2024/11/27 09:38:54 BGP: [bt 3] /lib/libfrr.so.0(+0x27bc82) [0x7fd14ac49c82]
2024/11/27 09:38:54 BGP: [bt 4] /lib/libfrr.so.0(+0x27c497) [0x7fd14ac4a497]
2024/11/27 09:38:54 BGP: [bt 5] /lib/libfrr.so.0(event_call+0x137) [0x7fd14ac06d62]
2024/11/27 09:38:54 BGP: [bt 6] /lib/libfrr.so.0(frr_run+0x488) [0x7fd14ab37e6f]
2024/11/27 09:38:54 BGP: [bt 7] /usr/lib/frr/bgpd(main+0x97a) [0x562a9e0f23ac]
2024/11/27 09:38:54 BGP: [bt 8] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7fd14a697d90]
2024/11/27 09:38:54 BGP: [bt 9] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7fd14a697e40]
2024/11/27 09:38:54 BGP: [bt 10] /usr/lib/frr/bgpd(_start+0x25) [0x562a9e0ef265]
2024/11/27 09:38:54 BGP: [SR3FZ-3N08V] failed to decode nexthop update
2024/11/27 09:38:55 BGP: [M59KS-A3ZXZ] bgp_update_receive: rcvd End-of-RIB for IPv4 VPN from 1::1 in vrf default

Signed-off-by: guozhongfeng.gzf <[email protected]>
@frrbot frrbot bot added the libfrr label Nov 28, 2024
@ton31337
Copy link
Member

Please include a backtrace into the commit message.

@ton31337
Copy link
Member

@Mergifyio backport stable/10.2 stable/10.1 stable/10.0 stable/9.1 stable/9.0 stable/8.5 stable/8.4

Copy link

mergify bot commented Nov 28, 2024

backport stable/10.2 stable/10.1 stable/10.0 stable/9.1 stable/9.0 stable/8.5 stable/8.4

🟠 Waiting for conditions to match

  • merged [📌 backport requirement]

Copy link
Contributor

@mjstapp mjstapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, this is a good fix. If you could update your commit to match our standards, that would be great: please add a description of the change that's being made, like "pass the zapi flag values to ensure that TE color is decoded correctly".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants