Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

cred: add prepare credential guard

A lot of code uses the following pattern:

* prepare new credentials
* modify them for their use-case
* drop them

Support that easier with the new guard infrastructure.

Link: https://patch.msgid.link/20251103-work-creds-guards-prepare_creds-v1-1-b447b82f2c9b@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>

+5
+5
include/linux/cred.h
··· 280 280 put_cred_many(cred, 1); 281 281 } 282 282 283 + DEFINE_CLASS(prepare_creds, 284 + struct cred *, 285 + if (_T) put_cred(_T), 286 + prepare_creds(), void) 287 + 283 288 DEFINE_FREE(put_cred, struct cred *, if (!IS_ERR_OR_NULL(_T)) put_cred(_T)) 284 289 285 290 /**