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

fix: handle big syscall data (truncated) properly #274

Merged
merged 1 commit into from
Jan 23, 2025
Merged

Conversation

hengyoush
Copy link
Owner

@hengyoush hengyoush commented Jan 23, 2025

When we fail to read the http body, it might be due to the response being too large, causing syscall data to be missing when transferred to user space.

Here, we attempt to find a boundary. If found, that's ideal and we return immediately. Otherwise, we try to locate a Fake Data Mark (FDM). When user space detects missing data from the kernel (possibly due to exceeding MAX_MSG_SIZE or situations like readv/writev where a buffer array is read/written at once), it supplements with fake data in user space.

At the beginning of this fake data, an FDM is set, which is a special string. Following the FDM, the length of the supplemental fake data (minus the length of the FDM) is written.

…sage

fix: handle big syscall data (truncated) properly

When we fail to read the body, it might be due to the response being too large, causing syscall data
to be missing when transferred to user space. Here, we attempt to find a boundary. If found, that's
ideal and we return immediately. Otherwise, we try to locate a Fake Data Mark (FDM). When user space
detects missing data from the kernel (possibly due to exceeding MAX_MSG_SIZE or situations like
readv/writev where a buffer array is read/written at once), it supplements with fake data in user
space. At the beginning of this fake data, an FDM is set, which is a special string. Following the
FDM, the length of the supplemental fake data (minus the length of the FDM) is written.
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 23, 2025
Copy link

vercel bot commented Jan 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kyanos ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 23, 2025 6:33pm

@hengyoush hengyoush merged commit 42267e4 into main Jan 23, 2025
16 checks passed
@hengyoush hengyoush deleted the fix-big-data2 branch January 23, 2025 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant