Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AsyncDataCache::canTryAllocate signature incorrectly used type int32_t for MachinePageCount (uint64_t) parameter being passed #11738

Open
aditi-pandit opened this issue Dec 4, 2024 · 1 comment
Assignees
Labels
bug Something isn't working triage Newly created issue that needs attention.

Comments

@aditi-pandit
Copy link
Collaborator

Bug description

Caught by IBM internal security scan.

AsynDataCache::canTryAllocate used int32_t as parameter type for numPages, https://github.com/facebookincubator/velox/blob/main/velox/common/caching/AsyncDataCache.cpp#L867, when parameter passed in was MachinePageCount (uint64_t) from AsyncDataCache::makeSpace
https://github.com/facebookincubator/velox/blob/main/velox/common/caching/AsyncDataCache.cpp#L779

This could've caused crashes in production.

Have fixed the signature in #11684, but creating an issue to get broader consensus on the issue and fix.

System information

Velox System Info v0.0.2
Commit: c14348e
CMake Version: 3.31.0
System: Darwin-23.6.0
Arch: arm64
C++ Compiler: /Library/Developer/CommandLineTools/usr/bin/c++
C++ Compiler Version: 15.0.0.15000309
C Compiler: /Library/Developer/CommandLineTools/usr/bin/cc
C Compiler Version: 15.0.0.15000309
CMake Prefix Path: /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr;/opt/homebrew;/usr/local;/usr;/;/opt/homebrew;/usr/local;/usr/X11R6;/usr/pkg;/opt;/sw;/opt/local

Relevant logs

No response

@aditi-pandit aditi-pandit added bug Something isn't working triage Newly created issue that needs attention. labels Dec 4, 2024
@aditi-pandit aditi-pandit self-assigned this Dec 4, 2024
@aditi-pandit
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Newly created issue that needs attention.
Projects
None yet
Development

No branches or pull requests

1 participant