Re: [zohar-integrity:next-integrity-testing 1/1] security/integrity/ima/ima_policy.c:684:25: sparse: sparse: incompatible types in comparison expression (different address spaces):

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2021-09-16 at 20:05 +0800, liqiong wrote:
> Hi Mini,
> 
> I got this sparse warnings, should i fix it ?
> 
> It seems the follow patch can fix, but i don't think should do
> this check (ima_rules_tmp == NULL).
> 
> 
> -static struct list_head *ima_rules = &ima_default_rules;
> +static struct list_head __rcu *ima_rules = (struct list_head __rcu *)(&ima_default_rules);
> 
> ima_rules_tmp = rcu_dereference(ima_rules);
> +if (ima_rules_tmp == NULL)
> +	return ;

Agreed,  the "__rcu" annotation is missing.  Probably both ima_rules
and ima_rules_tmp should be annotated with "__rcu".   Agreed,
ima_rules_tmp will either point to the default or custom policy rules. 
No need for the check.

Please post a new version of the patch, with "Reported-by: kernel test
robot <lkp@xxxxxxxxx>  (Fix sparse: incompatible types in comparison
expression)".

thanks,

Mimi




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux