Skip to content

Commit cb1513d

Browse files
committed
lsm: integrate report_lsm_order() code into caller
With only one caller of report_lsm_order(), insert the function's code directly into the caller and ger rid of report_lsm_order(). 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>
1 parent 37f788f commit cb1513d

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

security/lsm_init.c

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -291,26 +291,6 @@ static void __init ordered_lsm_parse(const char *order, const char *origin)
291291
kfree(sep);
292292
}
293293

294-
static void __init report_lsm_order(void)
295-
{
296-
struct lsm_info **lsm, *early;
297-
int first = 0;
298-
299-
pr_info("initializing lsm=");
300-
301-
/* Report each enabled LSM name, comma separated. */
302-
lsm_early_for_each_raw(early) {
303-
if (is_enabled(early))
304-
pr_cont("%s%s", first++ == 0 ? "" : ",", early->name);
305-
}
306-
lsm_order_for_each(lsm) {
307-
if (is_enabled(*lsm))
308-
pr_cont("%s%s", first++ == 0 ? "" : ",", (*lsm)->name);
309-
}
310-
311-
pr_cont("\n");
312-
}
313-
314294
/**
315295
* lsm_early_cred - during initialization allocate a composite cred blob
316296
* @cred: the cred that needs a blob
@@ -341,7 +321,9 @@ static void __init lsm_early_task(struct task_struct *task)
341321

342322
static void __init ordered_lsm_init(void)
343323
{
324+
unsigned int first = 0;
344325
struct lsm_info **lsm;
326+
struct lsm_info *early;
345327

346328
if (chosen_lsm_order) {
347329
if (chosen_major_lsm) {
@@ -357,7 +339,16 @@ static void __init ordered_lsm_init(void)
357339
lsm_prepare(*lsm);
358340
}
359341

360-
report_lsm_order();
342+
pr_info("initializing lsm=");
343+
lsm_early_for_each_raw(early) {
344+
if (is_enabled(early))
345+
pr_cont("%s%s", first++ == 0 ? "" : ",", early->name);
346+
}
347+
lsm_order_for_each(lsm) {
348+
if (is_enabled(*lsm))
349+
pr_cont("%s%s", first++ == 0 ? "" : ",", (*lsm)->name);
350+
}
351+
pr_cont("\n");
361352

362353
init_debug("cred blob size = %d\n", blob_sizes.lbs_cred);
363354
init_debug("file blob size = %d\n", blob_sizes.lbs_file);

0 commit comments

Comments
 (0)