Fix the last two CFI callback prototype mismatches #14207
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
There was the series from me a year ago which fixed most of the callback vs implementation prototype mismatches. It was based on running the CFI-enabled kernel (in permissive mode -- warning instead of panic) and performing a full ZTS cycle, and then fixing all of the problems caught by CFI.
Description
Now, Clang 16-dev has the new warning flag,
-Wcast-function-type-strict
, which detect such mismatches at compile-time. It allows to find the remaining issues missed by the first series.There are only two of them left: one for the
secpolicy_vnode_setattr()
callback and one fortaskq_dispatch()
. The fix is easy, since they are not used anywhere else.How Has This Been Tested?
Compile-time tested on Clang 16-dev with the abovementioned warning enabled. Runtime -- daily FS routines, as my Linux rootfs is on a ZFS dataset/pool.
Types of changes
Checklist:
Signed-off-by
.