[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87sf2j4om3.fsf@intel.com>
Date: Fri, 26 Jan 2024 16:16:36 -0800
From: Vinicius Costa Gomes <vinicius.gomes@...el.com>
To: Amir Goldstein <amir73il@...il.com>
Cc: brauner@...nel.org, hu1.chen@...el.com, miklos@...redi.hu,
malini.bhandaru@...el.com, tim.c.chen@...el.com, mikko.ylinen@...el.com,
lizhen.you@...el.com, linux-unionfs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC v2 2/4] cred: Add a light version of override/revert_creds()
Amir Goldstein <amir73il@...il.com> writes:
> On Fri, Jan 26, 2024 at 1:57 AM Vinicius Costa Gomes
> <vinicius.gomes@...el.com> wrote:
>>
>> Add a light version of override/revert_creds(), this should only be
>> used when the credentials in question will outlive the critical
>> section and the critical section doesn't change the ->usage of the
>> credentials.
>>
>> To make their usage less error prone, introduce cleanup guards asto be
>> used like this:
>>
>> guard(cred)(credentials_to_override_and_restore);
>>
>> or this:
>>
>> scoped_guard(cred, credentials_to_override_and_restore) {
>> /* with credentials overridden */
>> }
>>
>> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@...el.com>
>
> You may add:
> Reviewed-by: Amir Goldstein <amir73il@...il.com>
>
> I would also add:
> Suggested-by: Christian Brauner <brauner@...nel.org>
>
Forgot about that one.
Cheers,
--
Vinicius
Powered by blists - more mailing lists