Skip to content

orchagent: Add missing end() check in VNetRouteOrch custom monitor lookup#4347

Merged
prsunny merged 1 commit intosonic-net:masterfrom
uramanath:fix/vnetorch-missing-end-check
Mar 20, 2026
Merged

orchagent: Add missing end() check in VNetRouteOrch custom monitor lookup#4347
prsunny merged 1 commit intosonic-net:masterfrom
uramanath:fix/vnetorch-missing-end-check

Conversation

@uramanath
Copy link
Copy Markdown
Contributor

@uramanath uramanath commented Mar 17, 2026

What I did

Added a missing end() check before dereferencing a find() result in VNetRouteOrch::doRouteTask().

Why I did it

syncd_tunnel_routes_[vnet].find(ipPrefix) is used without checking the iterator against end(). If the route is absent from syncd_tunnel_routes_ while custom_monitor_ep_updated is true (e.g. due to a race between route deletion and monitor update), the unguarded dereference of it_route->second causes undefined behavior and can crash orchagent.

How I verified it

Code inspection. The fix wraps the two getCustomMonitors() calls in an end() check — no change to normal-path behavior when the route exists.

Signed-off-by: Uma Ramanathan uramanathan@upscaleai.com

@uramanath uramanath requested a review from prsunny as a code owner March 17, 2026 05:22
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

…okup

syncd_tunnel_routes_[vnet].find(ipPrefix) result is dereferenced
without checking against end(). If the route is absent from
syncd_tunnel_routes_ while custom_monitor_ep_updated is true, the
unguarded dereference causes undefined behavior.

Add an end() check before accessing the iterator.

Signed-off-by: Uma Ramanathan <uramanathan@upscaleai.com>
@uramanath uramanath force-pushed the fix/vnetorch-missing-end-check branch from d3e6e1b to 9399f2e Compare March 18, 2026 15:22
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny prsunny merged commit d0afdb6 into sonic-net:master Mar 20, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants