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

Re: [Xen-devel] [PATCH v4] xsm: add a default policy to .init.data



>>> On 05.07.16 at 19:44, <dgdegra@xxxxxxxxxxxxx> wrote:
> --- a/xen/include/xsm/xsm.h
> +++ b/xen/include/xsm/xsm.h
> @@ -762,6 +762,13 @@ static inline void flask_init(void)
>  }
>  #endif
>  
> +#ifdef CONFIG_XSM_POLICY
> +extern const unsigned char xsm_init_policy[];
> +extern const int xsm_init_policy_size;

unsigned int or size_t please.

> --- a/xen/xsm/flask/Makefile
> +++ b/xen/xsm/flask/Makefile
> @@ -27,6 +27,17 @@ $(FLASK_H_FILES): $(FLASK_H_DEPEND)
>  $(AV_H_FILES): $(AV_H_DEPEND)
>       $(CONFIG_SHELL) policy/mkaccess_vector.sh $(AWK) $(AV_H_DEPEND)
>  
> +obj-$(CONFIG_XSM_POLICY) += policy.o
> +
> +POLICY_SRC := $(XEN_ROOT)/tools/flask/policy/xenpolicy-$(XEN_FULLVERSION)
> +
> +policy.bin: FORCE
> +     $(MAKE) -C $(XEN_ROOT)/tools/flask/policy
> +     cmp -s $(POLICY_SRC) $@ || cp $(POLICY_SRC) $@
> +
> +policy.c: policy.bin gen-policy.py
> +     $(PYTHON) gen-policy.py < $< > $@
> +
>  .PHONY: clean
>  clean::
>       rm -f $(ALL_H_FILES) *.o $(DEPS)

I suppose the clean target then also needs adjustment?

> +static inline void xsm_policy_init(void)
> +{
> +#ifdef CONFIG_XSM_POLICY
> +    if ( policy_size == 0 )
> +    {
> +        policy_buffer = (char*)xsm_init_policy;

Can't xsm_init_policy by of type const char[] then, avoiding the need
for a cast (you certainly shouldn't be casting away constness)? If not,
besides adding the const please also add a blank before the *.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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