Skip to content

Commit f1cd6cb

Browse files
Tushar Sugandhisnitm
authored andcommitted
dm ima: add a warning in dm_init if duplicate ima events are not measured
The end-users of DM devices/targets may remove and re-create the same device multiple times. IMA does not measure such duplicate events if the configuration CONFIG_IMA_DISABLE_HTABLE is set to 'n'. To avoid confusion, the end-users need some indication on the client if that configuration option is disabled. Add a one-time warning during dm_init() if CONFIG_IMA_DISABLE_HTABLE is set to 'n', to notify the end-users that duplicate events will not be measured in the ima log. Also cleanup some whitespace in dm_init(). Signed-off-by: Tushar Sugandhi <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent 9c2adfa commit f1cd6cb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/md/dm.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,18 +262,21 @@ static void (*_exits[])(void) = {
262262
static int __init dm_init(void)
263263
{
264264
const int count = ARRAY_SIZE(_inits);
265-
266265
int r, i;
267266

267+
#if (IS_ENABLED(CONFIG_IMA) && !IS_ENABLED(CONFIG_IMA_DISABLE_HTABLE))
268+
DMWARN("CONFIG_IMA_DISABLE_HTABLE is disabled."
269+
" Duplicate IMA measurements will not be recorded in the IMA log.");
270+
#endif
271+
268272
for (i = 0; i < count; i++) {
269273
r = _inits[i]();
270274
if (r)
271275
goto bad;
272276
}
273277

274278
return 0;
275-
276-
bad:
279+
bad:
277280
while (i--)
278281
_exits[i]();
279282

0 commit comments

Comments
 (0)