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.

lsm: output available LSMs when debugging

This will display all of the LSMs built into the kernel, regardless
of if they are enabled or not.

Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: John Johansen <john.johhansen@canonical.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>

+18 -1
+18 -1
security/lsm_init.c
··· 363 363 { 364 364 struct lsm_info *lsm; 365 365 366 + /* NOTE: lsm_pr_dbg() doesn't work here as lsm_debug is not yet set */ 367 + 366 368 lsm_early_for_each_raw(lsm) { 367 369 lsm_enabled_set(lsm, true); 368 370 lsm_order_append(lsm, "early"); ··· 387 385 struct lsm_info **lsm; 388 386 389 387 if (lsm_debug) { 390 - lsm_pr("built-in LSM list: %s\n", lsm_order_builtin); 388 + struct lsm_info *i; 389 + 390 + cnt = 0; 391 + lsm_pr("available LSMs: "); 392 + lsm_early_for_each_raw(i) 393 + lsm_pr_cont("%s%s(E)", (cnt++ ? "," : ""), i->id->name); 394 + lsm_for_each_raw(i) 395 + lsm_pr_cont("%s%s", (cnt++ ? "," : ""), i->id->name); 396 + lsm_pr_cont("\n"); 397 + 398 + lsm_pr("built-in LSM config: %s\n", lsm_order_builtin); 399 + 391 400 lsm_pr("legacy LSM parameter: %s\n", lsm_order_legacy); 392 401 lsm_pr("boot LSM parameter: %s\n", lsm_order_cmdline); 402 + 403 + /* see the note about lsm_pr_dbg() in early_security_init() */ 404 + lsm_early_for_each_raw(i) 405 + lsm_pr("enabled LSM early:%s\n", i->id->name); 393 406 } 394 407 395 408 if (lsm_order_cmdline) {