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

New MISRA C:2012 R10.3 violations due to XSA-438 fix



Hi all,

In light of the recent changes introduced by commit fb0ff49fe9f784bfee0370c2a3c5f20e39d7a1cb, as part of XSA-438 [1], the signature of function pointer 'update_cr3' in 'xen/arch/x86/include/asm/paging.h', line 121, changed its second parameter to a boolean. Consequently, all calls to that function should use a boolean to comply with MISRA C:2012 Rule 10.3 ("The value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category"), but they still use integers.
These were the ones I can find:
xen/arch/x86/include/asm/paging.h:299: return paging_get_hostmode(v)->update_cr3(v, 1, noflush);
xen/arch/x86/mm/hap/hap.c:797:    hap_update_cr3(v, 0, false);
xen/arch/x86/mm/shadow/common.c:2513: v->arch.paging.mode->update_cr3(v, 0, false); xen/arch/x86/mm/shadow/multi.c:2478: v->arch.paging.mode->update_cr3(v, 0, false);

[1] https://lore.kernel.org/xen-devel/E1qitNQ-0001Pu-0K@xxxxxxxxxxxxxxxxxxxxxx/

--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.