Re: [PATCH v2 1/2] KEYS: use synchronous task work for changing parent credentials
From: Jann Horn <jannh@google.com>
Date: 2024-09-10 23:05:42
Also in:
keyrings, lkml, selinux
From: Jann Horn <jannh@google.com>
Date: 2024-09-10 23:05:42
Also in:
keyrings, lkml, selinux
On Tue, Sep 10, 2024 at 11:07 PM Paul Moore [off-list ref] wrote:
On Aug 5, 2024 Jann Horn [off-list ref] wrote:quoted
- cred->session_keyring = key_ref_to_ptr(keyring_r); - keyring_r = NULL; - init_task_work(newwork, key_change_session_keyring); + /* the parent mustn't be init and mustn't be a kernel thread */ + if (is_global_init(parent) || (READ_ONCE(parent->flags) & PF_KTHREAD) != 0) + goto put_task;I think we need to explicitly set @ret if we are failing here, yes?
Ah, yes. Thanks.