Skip to content

Fix Linux flavor check to match RedHat or Centos - #129

Merged
stsoe merged 2 commits into
Xilinx:masterfrom
stsoe:master
Jul 24, 2018
Merged

Fix Linux flavor check to match RedHat or Centos#129
stsoe merged 2 commits into
Xilinx:masterfrom
stsoe:master

Conversation

@stsoe

@stsoe stsoe commented Jul 24, 2018

Copy link
Copy Markdown
Collaborator

Packages were not created on RHEL.

Packages were not created on RHEL.
@gbuildx

gbuildx commented Jul 24, 2018

Copy link
Copy Markdown

Build Failed! :(

@stsoe
stsoe merged commit 6c21f5b into Xilinx:master Jul 24, 2018
@gbuildx

gbuildx commented Jul 24, 2018

Copy link
Copy Markdown

Build Failed! :(

stsoe added a commit to stsoe/XRT that referenced this pull request Aug 5, 2026
Fix CodeQL alerts per Jira tickets
- AIESW-41130
- AIESW-41131
- AIESW-41132
- AIESW-41133
- AIESW-41134
- AIESW-41135

Six CWE-125 heap OOB read vulnerabilities in xclbin_parser.cpp where
attacker-controlled mpo (string offset) fields from SOFT_KERNEL and
AIE_PARTITION sections were used as pointer offsets without bounds
checking.

CodeQL alerts Xilinx#129Xilinx#134 (amd-psirt/xclbin-parser-oob, HIGH severity).
The SOFT_KERNEL issues were never previously addressed. The
aie_partition::mpo_name and cdo_group::mpo_name issues were missed by
the prior fix in b5c8a09 (SWSPLAT-24066), which validated array/struct
offsets but not bare string offsets.

Added validate_string_offset() helper that checks an mpo uint32_t
offset is strictly less than the section buffer size before pointer
arithmetic. Applied at all six flagged sites:
- get_softkernels(): also adds section bounds and sizeof(soft_kernel)
  header checks before any field access
- get_aie_partition(): validates aiep->mpo_name and cdop->mpo_name

Low. Validation only at load time; rejects malformed xclbins that
would previously cause OOB reads.

Built xrt_coreutil successfully. Requires fuzzing with crafted xclbins
and AddressSanitizer validation to fully exercise the new checks.

None

Signed-off-by: Soren Soe <2106410+stsoe@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>
chvamshi-xilinx pushed a commit that referenced this pull request Aug 6, 2026
* CodeQL Fix xclbin parser mpo string offset OOB reads

Fix CodeQL alerts per Jira tickets
- AIESW-41130
- AIESW-41131
- AIESW-41132
- AIESW-41133
- AIESW-41134
- AIESW-41135

Six CWE-125 heap OOB read vulnerabilities in xclbin_parser.cpp where
attacker-controlled mpo (string offset) fields from SOFT_KERNEL and
AIE_PARTITION sections were used as pointer offsets without bounds
checking.

CodeQL alerts #129#134 (amd-psirt/xclbin-parser-oob, HIGH severity).
The SOFT_KERNEL issues were never previously addressed. The
aie_partition::mpo_name and cdo_group::mpo_name issues were missed by
the prior fix in b5c8a09 (SWSPLAT-24066), which validated array/struct
offsets but not bare string offsets.

Added validate_string_offset() helper that checks an mpo uint32_t
offset is strictly less than the section buffer size before pointer
arithmetic. Applied at all six flagged sites:
- get_softkernels(): also adds section bounds and sizeof(soft_kernel)
  header checks before any field access
- get_aie_partition(): validates aiep->mpo_name and cdop->mpo_name

Low. Validation only at load time; rejects malformed xclbins that
would previously cause OOB reads.

Built xrt_coreutil successfully. Requires fuzzing with crafted xclbins
and AddressSanitizer validation to fully exercise the new checks.

None

Signed-off-by: Soren Soe <2106410+stsoe@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>

* Early exit for easier reading

Signed-off-by: Soren Soe <2106410+stsoe@users.noreply.github.com>

---------

Signed-off-by: Soren Soe <2106410+stsoe@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants