kernel: fix filp_open on older kernel's kworker (#205)
On older kernel, kworker missing keyring from init process , and this keyring is related to FBE , which causes filp_open return ENOKEY or other errors.To fix this,just install init's keyring to per kworkers.This works on Kernel 4.4 and 4.9.
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
#include "linux/version.h"
|
||||
#include "linux/init.h"
|
||||
#include "linux/fs.h"
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#include "linux/key.h"
|
||||
#include "linux/errno.h"
|
||||
struct key *init_session_keyring = NULL;
|
||||
#endif
|
||||
ssize_t kernel_read_compat(struct file *p, void *buf, size_t count, loff_t *pos){
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
|
||||
return kernel_read(p, buf, count, pos);
|
||||
|
||||
Reference in New Issue
Block a user