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

zebra: fix fpm netlink encode out of bounds read #12659

Merged
merged 1 commit into from
Jan 19, 2023
Merged
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
zebra: fix fpm netlink encode out of bounds read
Don't attempt to encode the pointer address instead pass the pointer
directly so the real contents can be accessed.

(`ri->pref_src` type is `union g_addr *`)

Found by Coverity Scan (CID 1482162)

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
  • Loading branch information
rzalamena committed Jan 18, 2023
commit 18b7958e47b77b3a795ff4022c454c425bbae26d
2 changes: 1 addition & 1 deletion zebra/zebra_fpm_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ static int netlink_route_info_encode(struct netlink_route_info *ri,
done:

if (ri->pref_src) {
nl_attr_put(&req->n, in_buf_len, RTA_PREFSRC, &ri->pref_src,
nl_attr_put(&req->n, in_buf_len, RTA_PREFSRC, ri->pref_src,
bytelen);
}

Expand Down