Skip to content

update(plugins/container): updated container plugin to 0.2.2#759

Merged
poiana merged 3 commits intofalcosecurity:mainfrom
FedeDP:update/container_plugin_022
May 6, 2025
Merged

update(plugins/container): updated container plugin to 0.2.2#759
poiana merged 3 commits intofalcosecurity:mainfrom
FedeDP:update/container_plugin_022

Conversation

@FedeDP
Copy link
Contributor

@FedeDP FedeDP commented May 6, 2025

What type of PR is this?

/kind cleanup

Any specific area of the project related to this PR?

/area plugins

What this PR does / why we need it:

Also, properly use reusable workflow provided by libs to run container e2e tests.
Finally, avoid using ptr.GoString in AskForContainerInfo since the string we use as go string internal data is just stack allocated with .c_str() and will be pretty dead soon (considering Fetcher runs async).

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Keeping this wip until falcosecurity/libs#2390 is merged.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
@github-actions
Copy link

github-actions bot commented May 6, 2025

Rules files suggestions

1 similar comment
@github-actions
Copy link

github-actions bot commented May 6, 2025

Rules files suggestions

…gin e2e tests.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
@FedeDP
Copy link
Contributor Author

FedeDP commented May 6, 2025

Will squash all wip commits, and remove wip once falcosecurity/libs#2390 is merged.

@github-actions
Copy link

github-actions bot commented May 6, 2025

Rules files suggestions

@FedeDP FedeDP force-pushed the update/container_plugin_022 branch 2 times, most recently from 32c6b6a to edc16a9 Compare May 6, 2025 12:57
@github-actions
Copy link

github-actions bot commented May 6, 2025

Rules files suggestions

@FedeDP FedeDP force-pushed the update/container_plugin_022 branch from edc16a9 to 0ff53d0 Compare May 6, 2025 13:15
@github-actions
Copy link

github-actions bot commented May 6, 2025

Rules files suggestions

@FedeDP FedeDP force-pushed the update/container_plugin_022 branch from fa40db8 to 63d8b58 Compare May 6, 2025 13:40
@FedeDP
Copy link
Contributor Author

FedeDP commented May 6, 2025

Reproducing the panic we saw this morning:

goroutine 59 [running]:
net/url.escape({0x7fff4e38da50, 0xc}, 0x2)
	/usr/local/go/src/net/url/url.go:332 +0x32d
net/url.PathEscape(...)
	/usr/local/go/src/net/url/url.go:283
github.com/containers/podman/v5/pkg/bindings.(*Connection).DoRequest(0xc00011e420, {0x7f44cbf600b8, 0xc0004cd9e0}, {0x0, 0x0}, {0x7f44cb96d3bf, 0x3}, {0x7f44cb981825, 0x13}, 0xc00050a570, ...)
	/go/pkg/mod/github.com/containers/podman/v5@v5.4.1/pkg/bindings/connection.go:393 +0x319
github.com/containers/podman/v5/pkg/bindings/containers.Inspect({0x7f44cbf600b8, 0xc0004cd9e0}, {0x7fff4e38da50, 0xc}, 0x0?)
	/go/pkg/mod/github.com/containers/podman/v5@v5.4.1/pkg/bindings/containers/containers.go:119 +0x146
github.com/falcosecurity/plugins/plugins/container/go-worker/pkg/container.(*podmanEngine).get(0xc000120120, {0x7f44cbf60080?, 0x7f44cca63d80?}, {0x7fff4e38da50, 0xc})
	/__w/plugins/plugins/plugins/container/go-worker/pkg/container/podman.go:191 +0xb5
github.com/falcosecurity/plugins/plugins/container/go-worker/pkg/container.(*fetcher).Listen.func1()
	/__w/plugins/plugins/plugins/container/go-worker/pkg/container/fetcher.go:87 +0x191
created by github.com/falcosecurity/plugins/plugins/container/go-worker/pkg/container.(*fetcher).Listen in goroutine 23
	/__w/plugins/plugins/plugins/container/go-worker/pkg/container/fetcher.go:71 +0xf5

I hoped #758 fixed the issue :/ well, at least we now have a way to see it in this CI, that should be helpful.

@github-actions
Copy link

github-actions bot commented May 6, 2025

Rules files suggestions

Since the c string comes from a stack variable `.c_str()`,
and the go string will be used async, `ptr.GoString()` does not
guarantee that the string is kept alive for all its duration,
leading to bogus reads.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
@FedeDP FedeDP force-pushed the update/container_plugin_022 branch from 3806723 to e9685a4 Compare May 6, 2025 14:19
@github-actions
Copy link

github-actions bot commented May 6, 2025

Rules files suggestions

@FedeDP FedeDP changed the title wip: update(plugins/container): updated container plugin to 0.2.2 update(plugins/container): updated container plugin to 0.2.2 May 6, 2025
//export AskForContainerInfo
func AskForContainerInfo(containerId *C.cchar_t) {
containerID := ptr.GoString(unsafe.Pointer(containerId))
containerID := C.GoString(containerId)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a BIG fix.

@poiana poiana added the lgtm label May 6, 2025
@poiana
Copy link
Contributor

poiana commented May 6, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP, leogr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana added the approved label May 6, 2025
@poiana poiana merged commit 9c1c488 into falcosecurity:main May 6, 2025
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants