Kernel 4.2.4/Nvidia 358.09 with all 4.2.4 grsecurity patches
Posted: Sat Oct 24, 2015 2:17 pm
Hello,
Nvidia has added a new module to their driver nvidia-modeset.
I have tried many things trying to get the above version of nvidia to work with grsecurity and the RANDSTRUCT_PLUGIN without success.
Here is the error I get without any patching using gcc 4.9.3 (the nvidia driver compiles with a non-grsecurity kernel):
/tmp/selfgz1837/NVIDIA-Linux-x86_64-358.09-no-compat32-custom/kernel/nvidia-modeset/nvidia-modeset-linux.c:296:5: error: invalid initializer
nvkms_suspend,
^
/tmp/selfgz1837/NVIDIA-Linux-x86_64-358.09-no-compat32-custom/kernel/nvidia-modeset/nvidia-modeset-linux.c:296:5: error: (near initialization for 'nvkms_rm_callbacks.<anonymous>')
make[3]: *** [/tmp/selfgz1837/NVIDIA-Linux-x86_64-358.09-no-compat32-custom/kernel/nvidia-modeset/nvidia-modeset-linux.o] Error 1
-------------------------------------------------------------------------
A prior post here indicated that 3rd party plugins had to be modified but no suggestions of how to go about that were given. I have tried to model it after other kernel changes made by the grsecurity patch and __no_const but everything I do gives initializer errors like it can't recognize that I have supplied an __attribute__. Here is my last attempt:
#ifdef RANDSTRUCT_PLUGIN
struct nnnn {
#else
typedef struct {
#endif
/*
* Suspend & resume callbacks. Note that these are called once per GPU.
*/
void (*suspend)(NvU32 gpu_id);
void (*resume)(NvU32 gpu_id);
#ifdef RANDSTRUCT_PLUGIN
};
typedef struct nnnn __no_randomize_layout nvidia_modeset_callbacks_t;
#else
} nvidia_modeset_callbacks_t;
#endif
------------------------------------------------------
Any help would be appreciated. I would like to turn CONFIG_GRKERNSEC_RANDSTRUCT back on.
Nvidia has added a new module to their driver nvidia-modeset.
I have tried many things trying to get the above version of nvidia to work with grsecurity and the RANDSTRUCT_PLUGIN without success.
Here is the error I get without any patching using gcc 4.9.3 (the nvidia driver compiles with a non-grsecurity kernel):
/tmp/selfgz1837/NVIDIA-Linux-x86_64-358.09-no-compat32-custom/kernel/nvidia-modeset/nvidia-modeset-linux.c:296:5: error: invalid initializer
nvkms_suspend,
^
/tmp/selfgz1837/NVIDIA-Linux-x86_64-358.09-no-compat32-custom/kernel/nvidia-modeset/nvidia-modeset-linux.c:296:5: error: (near initialization for 'nvkms_rm_callbacks.<anonymous>')
make[3]: *** [/tmp/selfgz1837/NVIDIA-Linux-x86_64-358.09-no-compat32-custom/kernel/nvidia-modeset/nvidia-modeset-linux.o] Error 1
-------------------------------------------------------------------------
A prior post here indicated that 3rd party plugins had to be modified but no suggestions of how to go about that were given. I have tried to model it after other kernel changes made by the grsecurity patch and __no_const but everything I do gives initializer errors like it can't recognize that I have supplied an __attribute__. Here is my last attempt:
#ifdef RANDSTRUCT_PLUGIN
struct nnnn {
#else
typedef struct {
#endif
/*
* Suspend & resume callbacks. Note that these are called once per GPU.
*/
void (*suspend)(NvU32 gpu_id);
void (*resume)(NvU32 gpu_id);
#ifdef RANDSTRUCT_PLUGIN
};
typedef struct nnnn __no_randomize_layout nvidia_modeset_callbacks_t;
#else
} nvidia_modeset_callbacks_t;
#endif
------------------------------------------------------
Any help would be appreciated. I would like to turn CONFIG_GRKERNSEC_RANDSTRUCT back on.