Skip to content

[QNN-EP] Fix use-after-free of logger object#27804

Merged
edgchen1 merged 1 commit intomicrosoft:mainfrom
CodeLinaro:qnn_logger_uaf
Mar 31, 2026
Merged

[QNN-EP] Fix use-after-free of logger object#27804
edgchen1 merged 1 commit intomicrosoft:mainfrom
CodeLinaro:qnn_logger_uaf

Conversation

@qc-tbhardwa
Copy link
Copy Markdown
Contributor

Description

Update logger object in QnnBackendManager::SetupBackend.

Motivation and Context

While generating weight sharing context binary, Inference Session is created once for each graph. Inference session creates logger object and passes it to QnnBackendManager. QnnBackendManager stores this pointer in logger_ pointer and holds it long after Inference Session destroys Logger. On next Inference Session, another Logger object is created but QnnBackendManager do not use this as backend_setup_completed_ is already set, using this causes UAF.

@tirupath-qti
Copy link
Copy Markdown
Contributor

@edgchen1
This is a critical bug fix. Could you please help to review and trigger CI on this..

@edgchen1
Copy link
Copy Markdown
Contributor

/azp run Windows ARM64 QNN CI Pipeline,Linux QNN CI Pipeline

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@edgchen1
Copy link
Copy Markdown
Contributor

/azp run Windows ARM64 QNN CI Pipeline,Linux QNN CI Pipeline

While generating weight sharing context binary, Inference Session is
created once for each graph. Inference session creates logger object and
passes it to QnnBackendManager. QnnBackendManager stores this pointer in
logger_ pointer and holds it long after Inference Session is destroys
Logger. On next Inference Session, another Logger object is created but
QnnBackendManager do not use this as backend_setup_completed_ is already
set.
@qc-tbhardwa
Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Qualcomm"

@edgchen1
Copy link
Copy Markdown
Contributor

/azp run Windows ARM64 QNN CI Pipeline,Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows GPU Doc Gen CI Pipeline

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 4 pipeline(s).

@edgchen1 edgchen1 enabled auto-merge (squash) March 31, 2026 19:44
@edgchen1 edgchen1 merged commit 0f43e16 into microsoft:main Mar 31, 2026
100 of 103 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