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

x-pack/auditbeat/tracing: fix invalid span in array punning #28580

Merged
merged 1 commit into from
Nov 9, 2021

Conversation

efd6
Copy link
Contributor

@efd6 efd6 commented Oct 21, 2021

What does this PR do?

Previously the copy for the raw case converted the unsafe pointer to a concrete
array of 2048 bytes due to an unnecessary pointer dereference. This invalidly
spans beyond the end of the struct allocation. This is identified either with a
build using the race detector or with -gcflags=all=-d=checkptr.

Why is it important?

This removes invalid unsafe behaviour.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

N/A

How to test this PR locally

Standard testing.

Related issues

Use cases

N/A

Screenshots

N/A

Logs

N/A

@efd6 efd6 added bug Team:Security-External Integrations 8.0-candidate backport-skip Skip notification from the automated backport with mergify labels Oct 21, 2021
@efd6 efd6 requested a review from a team as a code owner October 21, 2021 06:55
@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Oct 21, 2021
@mergify
Copy link
Contributor

mergify bot commented Oct 21, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b slicefix upstream/slicefix
git merge upstream/master
git push upstream slicefix

@elasticmachine
Copy link
Collaborator

elasticmachine commented Oct 21, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-11-09T20:21:22.899+0000

  • Duration: 69 min 13 sec

  • Commit: 44924ee

Test stats 🧪

Test Results
Failed 0
Passed 340
Skipped 145
Total 485

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

@andrewkroh andrewkroh added backport-v7.16.0 Automated backport with mergify and removed backport-skip Skip notification from the automated backport with mergify labels Nov 1, 2021
Previously the copy for the raw case converted the unsafe pointer to a concrete
array of 2048 bytes due to an unnecessary pointer dereference. This invalidly
spans beyond the end of the struct allocation. This is identified either with a
build using the race detector or with -gcflags=all=-d=checkptr.
Rather than using unsafe punning use the unsafe.Slice function. Also clean up
some pointer arithmetic syntax.
@efd6 efd6 merged commit 699fcdd into elastic:master Nov 9, 2021
@efd6 efd6 deleted the slicefix branch November 9, 2021 21:31
mergify bot pushed a commit that referenced this pull request Nov 9, 2021
Previously the copy for the raw case converted the unsafe pointer to a concrete
array of 2048 bytes due to an unnecessary pointer dereference. This invalidly
spans beyond the end of the struct allocation. This is identified either with a
build using the race detector or with -gcflags=all=-d=checkptr.
Rather than using unsafe punning use the unsafe.Slice function. Also clean up
some pointer arithmetic syntax.

(cherry picked from commit 699fcdd)
@efd6 efd6 added the backport-v8.0.0 Automated backport with mergify label Nov 9, 2021
mergify bot pushed a commit that referenced this pull request Nov 9, 2021
Previously the copy for the raw case converted the unsafe pointer to a concrete
array of 2048 bytes due to an unnecessary pointer dereference. This invalidly
spans beyond the end of the struct allocation. This is identified either with a
build using the race detector or with -gcflags=all=-d=checkptr.
Rather than using unsafe punning use the unsafe.Slice function. Also clean up
some pointer arithmetic syntax.

(cherry picked from commit 699fcdd)
@efd6
Copy link
Contributor Author

efd6 commented Nov 9, 2021

@Mergifyio backport 8.0

@mergify
Copy link
Contributor

mergify bot commented Nov 9, 2021

backport 8.0

✅ Backports have been created

efd6 added a commit that referenced this pull request Nov 9, 2021
…28897)

Previously the copy for the raw case converted the unsafe pointer to a concrete
array of 2048 bytes due to an unnecessary pointer dereference. This invalidly
spans beyond the end of the struct allocation. This is identified either with a
build using the race detector or with -gcflags=all=-d=checkptr.
Rather than using unsafe punning use the unsafe.Slice function. Also clean up
some pointer arithmetic syntax.

(cherry picked from commit 699fcdd)

Co-authored-by: Dan Kortschak <90160302+efd6@users.noreply.github.com>
efd6 added a commit that referenced this pull request Nov 10, 2021
…28898)

Previously the copy for the raw case converted the unsafe pointer to a concrete
array of 2048 bytes due to an unnecessary pointer dereference. This invalidly
spans beyond the end of the struct allocation. This is identified either with a
build using the race detector or with -gcflags=all=-d=checkptr.
Rather than using unsafe punning use the unsafe.Slice function. Also clean up
some pointer arithmetic syntax.

(cherry picked from commit 699fcdd)

Co-authored-by: Dan Kortschak <90160302+efd6@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.0-candidate backport-v7.16.0 Automated backport with mergify backport-v8.0.0 Automated backport with mergify bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants