File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,6 +59,9 @@ static int __init evm_set_fixmode(char *str)
5959{
6060 if (strncmp (str , "fix" , 3 ) == 0 )
6161 evm_fixmode = 1 ;
62+ else
63+ pr_err ("invalid \"%s\" mode" , str );
64+
6265 return 0 ;
6366}
6467__setup ("evm=" , evm_set_fixmode );
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ static int __init default_appraise_setup(char *str)
3333 ima_appraise = IMA_APPRAISE_FIX ;
3434 else if (strncmp (str , "enforce" , 7 ) == 0 )
3535 ima_appraise = IMA_APPRAISE_ENFORCE ;
36+ else
37+ pr_err ("invalid \"%s\" appraise option" , str );
3638#endif
3739 return 1 ;
3840}
Original file line number Diff line number Diff line change @@ -50,18 +50,23 @@ static int __init hash_setup(char *str)
5050 return 1 ;
5151
5252 if (strcmp (template_desc -> name , IMA_TEMPLATE_IMA_NAME ) == 0 ) {
53- if (strncmp (str , "sha1" , 4 ) == 0 )
53+ if (strncmp (str , "sha1" , 4 ) == 0 ) {
5454 ima_hash_algo = HASH_ALGO_SHA1 ;
55- else if (strncmp (str , "md5" , 3 ) == 0 )
55+ } else if (strncmp (str , "md5" , 3 ) == 0 ) {
5656 ima_hash_algo = HASH_ALGO_MD5 ;
57- else
57+ } else {
58+ pr_err ("invalid hash algorithm \"%s\" for template \"%s\"" ,
59+ str , IMA_TEMPLATE_IMA_NAME );
5860 return 1 ;
61+ }
5962 goto out ;
6063 }
6164
6265 i = match_string (hash_algo_name , HASH_ALGO__LAST , str );
63- if (i < 0 )
66+ if (i < 0 ) {
67+ pr_err ("invalid hash algorithm \"%s\"" , str );
6468 return 1 ;
69+ }
6570
6671 ima_hash_algo = i ;
6772out :
Original file line number Diff line number Diff line change @@ -241,6 +241,8 @@ static int __init policy_setup(char *str)
241241 ima_use_secure_boot = true;
242242 else if (strcmp (p , "fail_securely" ) == 0 )
243243 ima_fail_unverifiable_sigs = true;
244+ else
245+ pr_err ("policy \"%s\" not found" , p );
244246 }
245247
246248 return 1 ;
You can’t perform that action at this time.
0 commit comments