[ASAN] Enable SYS_PTRACE in frr, orchagent, and teamd for ASAN Enabled SONiC#27842
Open
croos12 wants to merge 1 commit into
Open
[ASAN] Enable SYS_PTRACE in frr, orchagent, and teamd for ASAN Enabled SONiC#27842croos12 wants to merge 1 commit into
croos12 wants to merge 1 commit into
Conversation
Signed-off-by: Connor Roos <croos@nvidia.com>
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
dgsudharsan
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
When orchagent (and the other swss/bgp/teamd daemons) are built with AddressSanitizer/
LeakSanitizer (
ENABLE_ASAN=y), LeakSanitizer's leak report runs at process exit and needs toptrace the process to walk its memory. The SONiC service containers do not grant the
SYS_PTRACEcapability, so when orchagent receives SIGTERM, LeakSanitizer cannot attach and theprocess crashes instead of producing a clean leak report.
Work item tracking
How I did it
rules/docker-orchagent.mk: add--cap-add=SYS_PTRACEto the swss container_RUN_OPT,guarded by
ifeq ($(ENABLE_ASAN), y)so it only applies in ASAN builds.rules/docker-fpm-frr.mk: same ASAN-guarded--cap-add=SYS_PTRACEaddition for the bgpcontainer.
rules/docker-teamd.mk: same ASAN-guarded--cap-add=SYS_PTRACEaddition for the teamdcontainer.
How to verify it
ENABLE_ASAN=y.SIGTERMto orchagent (e.g. stop the swss service).Repeat for the bgp (frr) and teamd containers.
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Enable SYS_PTRACE in frr, orchagent, and teamd for ASAN Enabled SONiC