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

chore(driver): properly use strscpy. #1632

Merged
merged 3 commits into from
Feb 28, 2024
Merged

chore(driver): properly use strscpy. #1632

merged 3 commits into from
Feb 28, 2024

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Jan 22, 2024

What type of PR is this?

/kind cleanup

Any specific area of the project related to this PR?

/area driver-kmod

Does this PR require a change in the driver versions?

/version driver-API-version-patch

What this PR does / why we need it:

This PR adapts kmod code to use strscpy in place of strlcpy in kernels where strscpy is available (ie: since 4.3.0: torvalds/linux@30035e4).
strscpy is safer and has better results; moreover, strlcpy is being sunsetted (https://lore.kernel.org/lkml/202401191311.B6AA79D@keescook/ in kernel 6.8 for the full removal, but the effort to drop it from all drivers did .start quite a while ago).
See https://lwn.net/Articles/659214/ and strscpy code: https://elixir.bootlin.com/linux/latest/source/lib/string.c#L122

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@FedeDP
Copy link
Contributor Author

FedeDP commented Jan 22, 2024

/milestone next-driver

@poiana poiana added the size/S label Jan 22, 2024
@poiana poiana added this to the next-driver milestone Jan 22, 2024
@poiana poiana added size/M and removed size/S labels Jan 22, 2024
@FedeDP
Copy link
Contributor Author

FedeDP commented Jan 23, 2024

This also fixes build against v6.8-rc1: https://github.com/falcosecurity/libs/actions/runs/7622725910/job/20761330947

@FedeDP
Copy link
Contributor Author

FedeDP commented Feb 9, 2024

rc3 still fixed ;)

@FedeDP
Copy link
Contributor Author

FedeDP commented Feb 19, 2024

Still good against linux 6.8-rc5: https://github.com/falcosecurity/libs/actions/runs/7622725910

@FedeDP
Copy link
Contributor Author

FedeDP commented Feb 27, 2024

Testing against rc6: https://github.com/falcosecurity/libs/actions/runs/8064072897 🟢

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

@Andreagit97
Copy link
Member

i think you need to rebase to remove the stale required jobs

@FedeDP
Copy link
Contributor Author

FedeDP commented Feb 27, 2024

You are right! Rebased!

@poiana
Copy link
Contributor

poiana commented Feb 28, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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 18c3325 into master Feb 28, 2024
49 checks passed
@poiana poiana deleted the chore/use_strscpy branch February 28, 2024 08:43
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