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:
f19
2023-02-05 07:14:59 +08:00
committed by GitHub
parent cd33a6dd07
commit 0c322a33bc
5 changed files with 67 additions and 10 deletions

View File

@@ -39,6 +39,7 @@ static bool is_uid_exist(uid_t uid, void *data)
static void do_update_uid(struct work_struct *work)
{
KWORKER_INSTALL_KEYRING();
struct file *fp = filp_open(SYSTEM_PACKAGES_LIST_PATH, O_RDONLY, 0);
if (IS_ERR(fp)) {
pr_err("do_update_uid, open " SYSTEM_PACKAGES_LIST_PATH