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(driver/kmod): always send fds to userspace in poll/ppoll syscall exit #1714

Merged
merged 4 commits into from
Feb 29, 2024

Conversation

mrgian
Copy link
Contributor

@mrgian mrgian commented Feb 28, 2024

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

/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:
This uniforms the kmod driver's behavior to that of bpf and mbpf drivers in poll/ppoll syscall

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

…exit

Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
Copy link

Please double check driver/API_VERSION file. See versioning.

/hold

FedeDP
FedeDP previously approved these changes Feb 28, 2024
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 Feb 28, 2024

LGTM label has been added.

Git tree hash: 1c6fa2e20775c864d01a935515b211fdaec51de2

@FedeDP
Copy link
Contributor

FedeDP commented Feb 28, 2024

More standardization across the drivers is always welcome, thanks!

@FedeDP
Copy link
Contributor

FedeDP commented Feb 28, 2024

Me and @therealbobo were already investigating the failing test:

[ FAILED ] SyscallExit.process_vm_readvX_failure

You should probably modify that test by changing
size_t res = syscall(__NR_process_vm_readv, getpid(), iov, iovcnt, iov, iovcnt, 0);
to
size_t res = syscall(__NR_process_vm_readv, getpid(), iov, iovcnt, iov, iovcnt, 1);
ie: passing a non-empty flag.

This will trigger:

 EINVAL flags is not 0.

EDIT: anway, i'd love to make it fail in a different way since sooner or later the flags != 0 check might go away (ie: when flags will actually be an used parameter).

Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
FedeDP
FedeDP previously approved these changes Feb 28, 2024
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 poiana added the lgtm label Feb 28, 2024
@poiana
Copy link
Contributor

poiana commented Feb 28, 2024

LGTM label has been added.

Git tree hash: df781de9f9b54071370e45459713867d5598f0ba

@mrgian
Copy link
Contributor Author

mrgian commented Feb 28, 2024

Looks like SyscallEnter.spliceE is failing too 🤔

Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
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 poiana added the lgtm label Feb 29, 2024
@poiana
Copy link
Contributor

poiana commented Feb 29, 2024

LGTM label has been added.

Git tree hash: 2d05938cb604d0dcb4c05ffb5163ca1d583853aa

@FedeDP
Copy link
Contributor

FedeDP commented Feb 29, 2024

/milestone next-driver

@poiana poiana added this to the next-driver milestone Feb 29, 2024
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

@poiana
Copy link
Contributor

poiana commented Feb 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@FedeDP
Copy link
Contributor

FedeDP commented Feb 29, 2024

/unhold

@poiana poiana merged commit d753477 into falcosecurity:master Feb 29, 2024
51 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.

4 participants