diff mbox

[Xen-devel,v2,10/15] xen/xsm: flask: flask_copying_string is taking a XEN_GUEST_HANDLE as first param

Message ID 1395065165-15915-11-git-send-email-julien.grall@linaro.org
State Accepted, archived
Headers show

Commit Message

Julien Grall March 17, 2014, 2:06 p.m. UTC
Rather than x86, on ARM XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are
not compatible. This will result to a compilation failure on ARM when XSM
will be enabled.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/xsm/flask/flask_op.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Beulich March 17, 2014, 3:39 p.m. UTC | #1
>>> On 17.03.14 at 15:06, Julien Grall <julien.grall@linaro.org> wrote:
> Rather than x86, on ARM XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are
> not compatible. This will result to a compilation failure on ARM when XSM
> will be enabled.
> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> ---
>  xen/xsm/flask/flask_op.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/xsm/flask/flask_op.c b/xen/xsm/flask/flask_op.c
> index 9dd9081..85a615b 100644
> --- a/xen/xsm/flask/flask_op.c
> +++ b/xen/xsm/flask/flask_op.c
> @@ -76,7 +76,7 @@ static int domain_has_security(struct domain *d, u32 perms)
>                          perms, NULL);
>  }
>  
> -static int flask_copyin_string(XEN_GUEST_HANDLE_PARAM(char) u_buf, char **buf,
> +static int flask_copyin_string(XEN_GUEST_HANDLE(char) u_buf, char **buf,

Wasn't the original intention for them to be converted when passed
to functions, rather than getting passed verbatim?

Jan
Julien Grall March 17, 2014, 3:46 p.m. UTC | #2
Hi Jan,

On 03/17/2014 03:39 PM, Jan Beulich wrote:
>>>> On 17.03.14 at 15:06, Julien Grall <julien.grall@linaro.org> wrote:
>> Rather than x86, on ARM XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are
>> not compatible. This will result to a compilation failure on ARM when XSM
>> will be enabled.
>>
>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
>> Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> Acked-by: Ian Campbell <ian.campbell@citrix.com>
>> ---
>>  xen/xsm/flask/flask_op.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/xsm/flask/flask_op.c b/xen/xsm/flask/flask_op.c
>> index 9dd9081..85a615b 100644
>> --- a/xen/xsm/flask/flask_op.c
>> +++ b/xen/xsm/flask/flask_op.c
>> @@ -76,7 +76,7 @@ static int domain_has_security(struct domain *d, u32 perms)
>>                          perms, NULL);
>>  }
>>  
>> -static int flask_copyin_string(XEN_GUEST_HANDLE_PARAM(char) u_buf, char **buf,
>> +static int flask_copyin_string(XEN_GUEST_HANDLE(char) u_buf, char **buf,
> 
> Wasn't the original intention for them to be converted when passed
> to functions, rather than getting passed verbatim?

I didn't find any place where the conversation is made. If we are going
to this solution, can you give me pointer on how to do the conversation?

Regards,
Jan Beulich March 17, 2014, 4:33 p.m. UTC | #3
>>> On 17.03.14 at 16:46, Julien Grall <julien.grall@linaro.org> wrote:
> Hi Jan,
> 
> On 03/17/2014 03:39 PM, Jan Beulich wrote:
>>>>> On 17.03.14 at 15:06, Julien Grall <julien.grall@linaro.org> wrote:
>>> Rather than x86, on ARM XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are
>>> not compatible. This will result to a compilation failure on ARM when XSM
>>> will be enabled.
>>>
>>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
>>> Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>>> Acked-by: Ian Campbell <ian.campbell@citrix.com>
>>> ---
>>>  xen/xsm/flask/flask_op.c |    2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/xen/xsm/flask/flask_op.c b/xen/xsm/flask/flask_op.c
>>> index 9dd9081..85a615b 100644
>>> --- a/xen/xsm/flask/flask_op.c
>>> +++ b/xen/xsm/flask/flask_op.c
>>> @@ -76,7 +76,7 @@ static int domain_has_security(struct domain *d, u32 perms)
>>>                          perms, NULL);
>>>  }
>>>  
>>> -static int flask_copyin_string(XEN_GUEST_HANDLE_PARAM(char) u_buf, char 
> **buf,
>>> +static int flask_copyin_string(XEN_GUEST_HANDLE(char) u_buf, char **buf,
>> 
>> Wasn't the original intention for them to be converted when passed
>> to functions, rather than getting passed verbatim?
> 
> I didn't find any place where the conversation is made. If we are going
> to this solution, can you give me pointer on how to do the conversation?

To clarify this is actually why I had moved Stefano from Cc to To.

Jan
Stefano Stabellini March 17, 2014, 5 p.m. UTC | #4
On Mon, 17 Mar 2014, Jan Beulich wrote:
> >>> On 17.03.14 at 15:06, Julien Grall <julien.grall@linaro.org> wrote:
> > Rather than x86, on ARM XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are
> > not compatible. This will result to a compilation failure on ARM when XSM
> > will be enabled.
> > 
> > Signed-off-by: Julien Grall <julien.grall@linaro.org>
> > Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> > Acked-by: Ian Campbell <ian.campbell@citrix.com>
> > ---
> >  xen/xsm/flask/flask_op.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/xen/xsm/flask/flask_op.c b/xen/xsm/flask/flask_op.c
> > index 9dd9081..85a615b 100644
> > --- a/xen/xsm/flask/flask_op.c
> > +++ b/xen/xsm/flask/flask_op.c
> > @@ -76,7 +76,7 @@ static int domain_has_security(struct domain *d, u32 perms)
> >                          perms, NULL);
> >  }
> >  
> > -static int flask_copyin_string(XEN_GUEST_HANDLE_PARAM(char) u_buf, char **buf,
> > +static int flask_copyin_string(XEN_GUEST_HANDLE(char) u_buf, char **buf,
> 
> Wasn't the original intention for them to be converted when passed
> to functions, rather than getting passed verbatim?
 
The change is correct: flask_copyin_string is always called passing
struct field pointers as first argument. It is never called passing
hypercall arguments directly.
diff mbox

Patch

diff --git a/xen/xsm/flask/flask_op.c b/xen/xsm/flask/flask_op.c
index 9dd9081..85a615b 100644
--- a/xen/xsm/flask/flask_op.c
+++ b/xen/xsm/flask/flask_op.c
@@ -76,7 +76,7 @@  static int domain_has_security(struct domain *d, u32 perms)
                         perms, NULL);
 }
 
-static int flask_copyin_string(XEN_GUEST_HANDLE_PARAM(char) u_buf, char **buf,
+static int flask_copyin_string(XEN_GUEST_HANDLE(char) u_buf, char **buf,
                                size_t size, size_t max_size)
 {
     char *tmp;