Skip to content

add overflow checks for IPC handle size#1579

Open
bratpiorka wants to merge 4 commits into
oneapi-src:mainfrom
bratpiorka:rrudnick_fix_IPC
Open

add overflow checks for IPC handle size#1579
bratpiorka wants to merge 4 commits into
oneapi-src:mainfrom
bratpiorka:rrudnick_fix_IPC

Conversation

@bratpiorka

Copy link
Copy Markdown
Contributor

add overflow checks for IPC handle size with tests

@bratpiorka bratpiorka requested a review from a team as a code owner June 11, 2026 10:43

@lukaszstolarczuk lukaszstolarczuk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

if: ${{matrix.shared_library == 'ON' && matrix.compiler.cxx == 'cl'}}
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_RELEASE_DIR}}/bin/Release/umf.dll
run: |
if (Test-Path "${{env.BUILD_RELEASE_DIR}}/bin/Release/umf.dll") {
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_RELEASE_DIR}}/bin/Release/umf.dll
run: |
if (Test-Path "${{env.BUILD_RELEASE_DIR}}/bin/Release/umf.dll") {
$dll_path = "${{env.BUILD_RELEASE_DIR}}/bin/Release/umf.dll"
if (Test-Path "${{env.BUILD_RELEASE_DIR}}/bin/Release/umf.dll") {
$dll_path = "${{env.BUILD_RELEASE_DIR}}/bin/Release/umf.dll"
} else {
$dll_path = "${{env.BUILD_RELEASE_DIR}}/bin/umf.dll"
Comment thread .github/workflows/reusable_basic.yml Fixed
Comment thread .github/workflows/reusable_basic.yml Fixed
if (Test-Path "${{env.BUILD_RELEASE_DIR}}/bin/Release/umf_proxy.dll") {
$dll_path = "${{env.BUILD_RELEASE_DIR}}/bin/Release/umf_proxy.dll"
} else {
$dll_path = "${{env.BUILD_RELEASE_DIR}}/bin/umf_proxy.dll"
- name: check /DEPENDENTLOADFLAG in umf.dll
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_DIR}}/bin/${{matrix.build_type}}/umf.dll
run: |
if (Test-Path "${{env.BUILD_DIR}}/bin/${{matrix.build_type}}/umf.dll") {
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_DIR}}/bin/${{matrix.build_type}}/umf.dll
run: |
if (Test-Path "${{env.BUILD_DIR}}/bin/${{matrix.build_type}}/umf.dll") {
$dll_path = "${{env.BUILD_DIR}}/bin/${{matrix.build_type}}/umf.dll"
if (Test-Path "${{env.BUILD_DIR}}/bin/${{matrix.build_type}}/umf.dll") {
$dll_path = "${{env.BUILD_DIR}}/bin/${{matrix.build_type}}/umf.dll"
} else {
$dll_path = "${{env.BUILD_DIR}}/bin/umf.dll"
@bratpiorka bratpiorka requested a review from PatKamin June 11, 2026 13:28
if: ${{matrix.shared_library == 'ON' && matrix.compiler.cxx == 'cl'}}
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_RELEASE_DIR}}/src/proxy_lib/Release/umf_proxy.dll
run: |
if (Test-Path "${{env.BUILD_RELEASE_DIR}}/src/proxy_lib/Release/umf_proxy.dll") {
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_RELEASE_DIR}}/src/proxy_lib/Release/umf_proxy.dll
run: |
if (Test-Path "${{env.BUILD_RELEASE_DIR}}/src/proxy_lib/Release/umf_proxy.dll") {
$dll_path = "${{env.BUILD_RELEASE_DIR}}/src/proxy_lib/Release/umf_proxy.dll"
Comment thread test/ipcAPI.cpp
}

umf_result_t ext_get_ipc_handle_size(size_t *size) noexcept {
*size = std::numeric_limits<size_t>::max();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lower value of std::numeric_limits<size_t>::max() - sizeof(ipc_cache_value_t) + 1 should satisfy the tests. Please, check that

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.

4 participants