Repository navigation
IFDSTaintAnalysis: propagate taint through select and phi - #872
Merged
fabianbs96 merged 3 commits intoNov 7, 2026
Merged
fabianbs96 merged 3 commits into
fabianbs96 merged 3 commits into
Conversation
… through the phi in rec()
fabianbs96
approved these changes
Nov 7, 2026
fabianbs96
left a comment
Member
There was a problem hiding this comment.
Hi @rana1911,
thanks for your contribution.
Looks good to me!
fabianbs96
merged commit Nov 7, 2026
9063321
into
secure-software-engineering:development
14 checks passed
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.
Fixes #871.
IFDSTaintAnalysis::getNormalFlowFunctionhad no case forllvm::SelectInstorllvm::PHINode, so both fell through toidentityFlow()and their results were never tainted. Leaks were missed for?:even at-O0, and for ordinaryif/switch/loop code once mem2reg/SimplifyCFG run.Changes
IFDSTaintAnalysis.cpp: two flow functions before theidentityFlow()fallback, following the existingBinaryOperatorcase. The result is tainted if a value operand of theselect(true/false value, not the condition) or an incoming value of thephiis tainted. Other instructions are unaffected.dummy_source_sink/and 4 tests inIFDSTaintAnalysisTest:TaintTest_Select_01: ternary at-O1(select)TaintTest_Select_01_m2r: same program after mem2reg (phi)TaintTest_Select_02:ifassignment that SimplifyCFG turns into aselectat-O1TaintTest_Select_03:selectof two constants must not be tainted; a direct flow in the same function is still reportedCMakeLists.txt: a new list compiled with the existinggenerate_ll_file(... DEBUG O1)option, as ininst_interaction.TaintTest_Select_02matches theselectby line with column0(any column), because LLVM 18 and 21 attach it to different columns of the same line.Testing
IFDSTaintAnalysisTesttests pass (LLVM 21.1.8, GCC 15.2).IFDSTaintAnalysis.cpp,Select_01,Select_01_m2randSelect_02fail andSelect_03passes.Related: #846 (item 11), the same gap in
IDEExtendedTaintAnalysis. Intrinsics such asllvm.smaxalso drop taint at-O1+; I'll handle that in a separate PR.