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

feat:Prevent segmentation fault in probe_read & probe_write #368

Merged
merged 12 commits into from
Dec 24, 2024

Conversation

Sy0307
Copy link
Contributor

@Sy0307 Sy0307 commented Dec 21, 2024

Description

We avoid core dump when accessing an illegal address (such as NULL). Now we will get different error code for such situation.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Copy link

codecov bot commented Dec 21, 2024

Codecov Report

Attention: Patch coverage is 84.21053% with 27 lines in your changes missing coverage. Please review.

Project coverage is 53.39%. Comparing base (50a1e15) to head (e69e427).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
runtime/src/bpf_helper.cpp 75.00% 26 Missing ⚠️
runtime/unit-test/test_probe.cpp 98.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #368      +/-   ##
==========================================
+ Coverage   52.80%   53.39%   +0.59%     
==========================================
  Files          99      100       +1     
  Lines        9426     9592     +166     
  Branches      956      984      +28     
==========================================
+ Hits         4977     5122     +145     
- Misses       4449     4470      +21     
Flag Coverage Δ
attach tests (uprobe & syscall trace) 97.96% <ø> (ø)
coverage-example-fedora-false-bashreadline-false 13.11% <0.00%> (-0.17%) ⬇️
coverage-example-fedora-false-bashreadline-true 13.11% <0.00%> (-0.17%) ⬇️
coverage-example-fedora-false-funclatency-false 10.71% <0.00%> (-0.14%) ⬇️
coverage-example-fedora-false-funclatency-true 10.71% <0.00%> (-0.14%) ⬇️
coverage-example-fedora-false-malloc-true 12.00% <0.00%> (-0.16%) ⬇️
coverage-example-fedora-false-minimal-false 9.69% <0.00%> (-0.13%) ⬇️
coverage-example-fedora-false-minimal-true 9.69% <0.00%> (-0.13%) ⬇️
coverage-example-fedora-false-mountsnoop-true 13.79% <0.00%> (-0.18%) ⬇️
coverage-example-fedora-false-opensnoop-libbpf-tools-true 14.80% <0.00%> (-0.20%) ⬇️
coverage-example-fedora-false-opensnoop-true 13.79% <0.00%> (-0.18%) ⬇️
coverage-example-fedora-false-sigsnoop-true 22.56% <0.00%> (-0.31%) ⬇️
coverage-example-fedora-false-sslsniff-false 14.57% <0.00%> (-0.19%) ⬇️
coverage-example-fedora-false-sslsniff-true 14.57% <0.00%> (-0.19%) ⬇️
coverage-example-fedora-false-statsnoop-true 14.80% <0.00%> (-0.20%) ⬇️
coverage-example-fedora-false-syscount-false 9.42% <0.00%> (+1.30%) ⬆️
coverage-example-fedora-false-syscount-true 11.00% <0.00%> (-0.15%) ⬇️
coverage-example-fedora-false-tailcall_minimal-true 9.78% <0.00%> (-0.13%) ⬇️
coverage-example-fedora-false-usdt_minimal-false 10.67% <0.00%> (-0.14%) ⬇️
coverage-example-fedora-false-usdt_minimal-true 10.67% <0.00%> (-0.14%) ⬇️
coverage-example-fedora-true-bashreadline-false 12.74% <0.00%> (-0.16%) ⬇️
coverage-example-fedora-true-bashreadline-true 12.74% <0.00%> (-0.16%) ⬇️
coverage-example-fedora-true-funclatency-false 10.41% <0.00%> (-0.14%) ⬇️
coverage-example-fedora-true-funclatency-true 10.41% <0.00%> (-0.14%) ⬇️
coverage-example-fedora-true-malloc-true 11.66% <0.00%> (-0.15%) ⬇️
coverage-example-fedora-true-minimal-false 9.42% <0.00%> (-0.12%) ⬇️
coverage-example-fedora-true-minimal-true 9.42% <0.00%> (-0.12%) ⬇️
coverage-example-fedora-true-mountsnoop-true 13.40% <0.00%> (-0.17%) ⬇️
coverage-example-fedora-true-opensnoop-libbpf-tools-true 14.38% <0.00%> (-0.19%) ⬇️
coverage-example-fedora-true-opensnoop-true 13.40% <0.00%> (-0.17%) ⬇️
coverage-example-fedora-true-sigsnoop-true 21.92% <0.00%> (-0.29%) ⬇️
coverage-example-fedora-true-sslsniff-false 14.16% <0.00%> (-0.18%) ⬇️
coverage-example-fedora-true-sslsniff-true 14.16% <0.00%> (-0.18%) ⬇️
coverage-example-fedora-true-statsnoop-true 14.38% <0.00%> (-0.19%) ⬇️
coverage-example-fedora-true-syscount-false 7.79% <0.00%> (-0.10%) ⬇️
coverage-example-fedora-true-syscount-true 10.69% <0.00%> (-0.14%) ⬇️
coverage-example-fedora-true-tailcall_minimal-true 9.51% <0.00%> (-0.12%) ⬇️
coverage-example-fedora-true-usdt_minimal-false 10.37% <0.00%> (-0.13%) ⬇️
coverage-example-fedora-true-usdt_minimal-true 10.37% <0.00%> (-0.13%) ⬇️
coverage-example-ubuntu-false-bashreadline-false 28.61% <ø> (ø)
coverage-example-ubuntu-false-bashreadline-true 28.61% <ø> (ø)
coverage-example-ubuntu-false-funclatency-false 23.42% <ø> (ø)
coverage-example-ubuntu-false-funclatency-true 23.42% <ø> (ø)
coverage-example-ubuntu-false-malloc-true 26.24% <ø> (ø)
coverage-example-ubuntu-false-minimal-false 21.19% <ø> (ø)
coverage-example-ubuntu-false-minimal-true 21.19% <ø> (ø)
coverage-example-ubuntu-false-mountsnoop-true 30.17% <ø> (ø)
coverage-example-ubuntu-false-opensnoop-libbpf-tools-true 32.31% <ø> (ø)
coverage-example-ubuntu-false-opensnoop-true 30.17% <ø> (ø)
coverage-example-ubuntu-false-sigsnoop-true 39.12% <0.00%> (-0.92%) ⬇️
coverage-example-ubuntu-false-sslsniff-false 31.81% <ø> (ø)
coverage-example-ubuntu-false-sslsniff-true 31.81% <ø> (ø)
coverage-example-ubuntu-false-statsnoop-true 32.31% <ø> (ø)
coverage-example-ubuntu-false-syscount-false 16.94% <0.00%> (-0.42%) ⬇️
coverage-example-ubuntu-false-syscount-true 24.06% <ø> (ø)
coverage-example-ubuntu-false-tailcall_minimal-true 21.39% <ø> (ø)
coverage-example-ubuntu-false-usdt_minimal-false 23.33% <ø> (ø)
coverage-example-ubuntu-false-usdt_minimal-true 23.33% <ø> (ø)
coverage-example-ubuntu-true-bashreadline-false 28.61% <ø> (ø)
coverage-example-ubuntu-true-bashreadline-true 28.61% <ø> (ø)
coverage-example-ubuntu-true-funclatency-false 23.42% <ø> (ø)
coverage-example-ubuntu-true-funclatency-true 23.42% <ø> (ø)
coverage-example-ubuntu-true-malloc-true 26.24% <ø> (ø)
coverage-example-ubuntu-true-minimal-false 21.19% <ø> (ø)
coverage-example-ubuntu-true-minimal-true 21.19% <ø> (ø)
coverage-example-ubuntu-true-mountsnoop-true 30.17% <ø> (ø)
coverage-example-ubuntu-true-opensnoop-libbpf-tools-true 32.31% <ø> (ø)
coverage-example-ubuntu-true-opensnoop-true 30.17% <ø> (ø)
coverage-example-ubuntu-true-sigsnoop-true 39.12% <0.00%> (-0.92%) ⬇️
coverage-example-ubuntu-true-sslsniff-false 31.81% <ø> (ø)
coverage-example-ubuntu-true-sslsniff-true 31.81% <ø> (ø)
coverage-example-ubuntu-true-statsnoop-true 32.31% <ø> (ø)
coverage-example-ubuntu-true-syscount-false 17.55% <ø> (ø)
coverage-example-ubuntu-true-syscount-true 24.06% <ø> (ø)
coverage-example-ubuntu-true-tailcall_minimal-true 21.39% <ø> (ø)
coverage-example-ubuntu-true-usdt_minimal-false 23.33% <ø> (ø)
coverage-example-ubuntu-true-usdt_minimal-true 23.33% <ø> (ø)
runtime tests 48.15% <85.20%> (+0.97%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

runtime/src/bpf_helper.cpp Outdated Show resolved Hide resolved
runtime/src/bpf_helper.cpp Outdated Show resolved Hide resolved
@Sy0307 Sy0307 requested a review from Officeyutong December 22, 2024 14:20
.github/workflows/test-runtime.yml Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@Sy0307 Sy0307 requested a review from Officeyutong December 23, 2024 09:29
cmake/StandardSettings.cmake Show resolved Hide resolved
runtime/src/bpf_helper.cpp Outdated Show resolved Hide resolved
@Officeyutong
Copy link
Contributor

@yunwei37

@yunwei37 yunwei37 merged commit 3f6724b into eunomia-bpf:master Dec 24, 2024
94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants