Skip to content

Address TryGetSymbol hardening follow-ups - #136593

Open
rcj1 wants to merge 5 commits into
mainfrom
users/rcj1/trygetsymbol-followups
Open

rcj1 wants to merge 5 commits into
mainfrom
users/rcj1/trygetsymbol-followups

Conversation

@rcj1

@rcj1 rcj1 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Ensure that partial reads are rejected and that failure to find an android note/musl dependency is treated as a failure independent of the presence or absence of said markers.

rcj1 and others added 2 commits October 20, 2026 23:20
Address the follow-ups on #135734: propagate bias detection failures, bound dynamic-table walks by PT_DYNAMIC, process dependencies in two passes, check address and index arithmetic, and reject successful short reads.

Co-authored-by: Copilot <[email protected]>
Keep bias-detection failure handling, bounded dynamic-table dependency scans, and successful short-read rejection. Restore the existing address, index, and allocation-size handling.

Co-authored-by: Copilot <[email protected]>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@tommcdon tommcdon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Consider trigging runtime-diagnostics as I am not sure it ran.

@rcj1

rcj1 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/azp run runtime-diagnostics

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.

@rcj1

rcj1 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/azp runtime-diagnostics

@azure-pipelines

Copy link
Copy Markdown
Command 'runtime-diagnostics' is not supported by Azure Pipelines.

Supported commands
  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or specific pipelines for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify specific pipelines to run.
    • Example: "run" or "run pipeline_name, pipeline_name, pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

{
Trace("PopulateForSymbolLookup: base %016" PRIx64 "\n", baseAddress);
Elf_Dyn* dynamicAddr = nullptr;
uint64_t dynamicSize = 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know a lot of this is preexisting - but a lot of these arithmetic calculations are unchecked. We should try to guard for this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do this in a follow-up

Comment thread src/coreclr/debug/dbgutil/elfreader.cpp Outdated
if (offset >= stringSize) {
return false;
}
std::string name;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to allocate for the full string table entries? can it instead check where the \0 is and then check the prefix and the suffix?

// Search for dynamic entries
for (;;)
bool terminated = false;
for (; dynamicSize >= sizeof(Elf_Dyn); dynamicAddr++, dynamicSize -= sizeof(Elf_Dyn))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this type of protection is also missing from the macho equivalent.

rcj1 and others added 2 commits November 4, 2026 14:28

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants