Random small fixes in preparation for full kbuild support#1068
Open
minipli-oss wants to merge 10 commits intoNVIDIA:mainfrom
Open
Random small fixes in preparation for full kbuild support#1068minipli-oss wants to merge 10 commits intoNVIDIA:mainfrom
minipli-oss wants to merge 10 commits intoNVIDIA:mainfrom
Conversation
The return type is expected to be 'enum drm_mode_status', fix that. Signed-off-by: Mathias Krause <minipli@grsecurity.net>
nvswitch_task_dispatch() is supposed to be of type nv_q_func_t which expects a void pointer argument. Fix that to make it compatible with strongly type-based CFI implementations like RAP, as found in grsecurity. Signed-off-by: Mathias Krause <minipli@grsecurity.net>
The retun type should be 'void' as all users of tmrCtrlCmdEventCreate() pass a 'void (*)(void *)' function pointer. Signed-off-by: Mathias Krause <minipli@grsecurity.net>
gcc warns about the use of the wrong enum type, fix that!
.../src/nvidia/src/kernel/gpu/mem_mgr/arch/maxwell/virt_mem_allocator_gm107.c:1720:76: warning: implicit conversion from ‘GMMU_APERTURE’ to ‘FB_CACHE_MEMTYPE’ [-Wenum-conversion]
1720 | kmemsysCacheOp_HAL(pGpu, GPU_GET_KERNEL_MEMORY_SYSTEM(pGpu), NULL, aperture, FB_CACHE_INVALIDATE);
| ^~~~~~~~
.../src/nvidia/generated/g_kern_mem_sys_nvoc.h:632:135: note: in definition of macro ‘kmemsysCacheOp_HAL’
632 | #define kmemsysCacheOp_HAL(pGpu, pKernelMemorySystem, arg3, arg4, operation) kmemsysCacheOp_DISPATCH(pGpu, pKernelMemorySystem, arg3, arg4, operation)
| ^~~~
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
In case tmrEventCreate() fails, we will copy the uninitialized value of the stack local variable 'pEvent' and expose it to the caller. Prevent that by initializing it to NULL, as all other users do. Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Targets added to 'clean-files' shouldn't have the '$(obj)/' prefix or won't be found for the 'make clean' target. Fix that to ensure 'nv_compiler.h' will be removed on 'make clean'. Signed-off-by: Mathias Krause <minipli@grsecurity.net>
The drm_connector_helper_funcs.mode_valid() hook is expected to return a
'enum drm_mode_status' since Linux commit 0993f1d0d8a1 ("drm: Make the
connector mode_valid() func return a drm_mode_status enum") merged in
v3.14.
Add a conftest test for it to fix that without breaking older kernels.
The test is slightly evolved as C considers mismatched enum vs. int
return types as compatible but they still violate CFI checks for
advanced implementations like RAP as found in grsecurity.
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
There is no need to initialize 'g_exported_uvm_events' at runtime, initialize at compile time. Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Actual implementations of the NVEvoSubDevRec.scanLockState hook want an 'NVEvoLockAction'-typed 'action' argument. Fix that. Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Test the kernel for having RANDSTRUCT enabled and break the build, if it is as this would otherwise lead to ABI-incompatibilities with the OS-agnostic part that doesn't get compiled with RANDSTRCUT enabled. A visible outcome of this would be calling the wrong callback function via structures that purely consist of function pointers (which RANDSTRUCT randomizes). Signed-off-by: Mathias Krause <minipli@grsecurity.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Various small fixes in preparation for building all sources with Linux's kbuild with the ultimate goal of supporting features like RANDSTRUCT, kCFI and grsecurity kernel features like RAP, KERNEXEC, CONSTIFY,...