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(tests, bpf): correct build and test case failures on s390x #1150

Merged
merged 2 commits into from
Jun 13, 2023

Conversation

hbrueckner
Copy link
Contributor

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area API-version

/area build

/area CI

/area driver-kmod

/area driver-bpf

/area driver-modern-bpf

/area libscap-engine-bpf

/area libscap-engine-gvisor

/area libscap-engine-kmod

/area libscap-engine-modern-bpf

/area libscap-engine-nodriver

/area libscap-engine-noop

/area libscap-engine-source-plugin

/area libscap-engine-savefile

/area libscap-engine-udig

/area libscap

/area libpman

/area libsinsp

/area tests

/area proposals

Does this PR require a change in the driver versions?

/version driver-API-version-major

/version driver-API-version-minor

/version driver-API-version-patch

/version driver-SCHEMA-version-major

/version driver-SCHEMA-version-minor

/version driver-SCHEMA-version-patch

What this PR does / why we need it:

Correct a build break on s390x due to a undefined variable. Also correctly read the prctl GET_CHILD_SUBREAPER value to avoid type/endianess issues.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

The prctl GET_CHILD_SUBREAPER function stores the PID as
`(int *) arg2`.
Previously, the arg2 value has been read as `unsigned long`
causing endianess issue on s390x resulting in test case failures.

Change this to read an integer value similar as in modern BPF.

Signed-off-by: Hendrik Brueckner <[email protected]>
@github-actions
Copy link

Please double check driver/API_VERSION file. See versioning.

@FedeDP
Copy link
Contributor

FedeDP commented Jun 13, 2023

Thank you for this PR @hbrueckner ! LGTM!
/milestone next-driver

@poiana poiana added this to the next-driver milestone Jun 13, 2023
Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

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

/approve

@poiana
Copy link
Contributor

poiana commented Jun 13, 2023

LGTM label has been added.

Git tree hash: a3df6ea4d6b7c4264c52227b2c8bae8949b2acb4

Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

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

/approve

@@ -6715,8 +6716,9 @@ FILLER(sys_prctl_x, true)
/*
* arg2_int
*/
bpf_probe_read_user(&arg2_int,sizeof(arg2_int),(void*)arg2);
res = bpf_push_s64_to_ring(data, (int)arg2_int);
reaper_attr = 0;
Copy link
Member

Choose a reason for hiding this comment

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

great catch, thanks!

@poiana
Copy link
Contributor

poiana commented Jun 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, hbrueckner

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

The pull request process is described here

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 merged commit 9cfa68c into falcosecurity:master Jun 13, 2023
@hbrueckner hbrueckner deleted the fixes-s390x branch June 13, 2023 14:58
@FedeDP
Copy link
Contributor

FedeDP commented Jul 28, 2023

/milestone 5.1.0+driver

@poiana poiana modified the milestones: next-driver, 5.1.0+driver Jul 28, 2023
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.

4 participants