Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1401810 > unrolled thread

Re: [PATCH v7 3/3] SMAF: add fake secure module

Started byEmil Velikov <emil.l.velikov@gmail.com>
First post2016-05-17 01:20 +0200
Last post2016-05-17 17:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v7 3/3] SMAF: add fake secure module Emil Velikov <emil.l.velikov@gmail.com> - 2016-05-17 01:20 +0200
    Re: [PATCH v7 3/3] SMAF: add fake secure module Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2016-05-17 17:20 +0200

#1401810 — Re: [PATCH v7 3/3] SMAF: add fake secure module

FromEmil Velikov <emil.l.velikov@gmail.com>
Date2016-05-17 01:20 +0200
SubjectRe: [PATCH v7 3/3] SMAF: add fake secure module
Message-ID<rzzXP-52x-1@gated-at.bofh.it>
Hi Benjamin,

On 9 May 2016 at 16:07, Benjamin Gaignard <benjamin.gaignard@linaro.org> wrote:
> This module is allow testing secure calls of SMAF.
>
"Add fake secure module" does sound like something not (m)any people
want to hear ;-)
Have you considered calling it 'dummy', 'test' or similar ?


> --- /dev/null
> +++ b/drivers/smaf/smaf-fakesecure.c
> @@ -0,0 +1,85 @@
> +/*
> + * smaf-fakesecure.c
> + *
> + * Copyright (C) Linaro SA 2015
> + * Author: Benjamin Gaignard <benjamin.gaignard@linaro.org> for Linaro.
> + * License terms:  GNU General Public License (GPL), version 2
> + */
> +#include <linux/module.h>
> +#include <linux/slab.h>
> +#include <linux/smaf-secure.h>
> +
> +#define MAGIC 0xDEADBEEF
> +
> +struct fake_private {
> +       int magic;
> +};
> +
> +static void *smaf_fakesecure_create(void)
> +{
> +       struct fake_private *priv;
> +
> +       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
Missing ENOMEM handling ?

> +       priv->magic = MAGIC;
> +
> +       return priv;
> +}
> +
> +static int smaf_fakesecure_destroy(void *ctx)
> +{
> +       struct fake_private *priv = (struct fake_private *)ctx;
You might want to flesh this cast into a (inline) helper and use it throughout ?


... and that is all. Hope these were useful, or at the very least not
utterly wrong, suggestions :-)


Regards,
Emil

P.S. From a quick look userspace has some subtle bugs/odd practises.
Let me know if you're interested in my input.

[toc] | [next] | [standalone]


#1402407

FromBenjamin Gaignard <benjamin.gaignard@linaro.org>
Date2016-05-17 17:20 +0200
Message-ID<rzOWR-6ct-3@gated-at.bofh.it>
In reply to#1401810
2016-05-17 1:10 GMT+02:00 Emil Velikov <emil.l.velikov@gmail.com>:
> Hi Benjamin,
>
> On 9 May 2016 at 16:07, Benjamin Gaignard <benjamin.gaignard@linaro.org> wrote:
>> This module is allow testing secure calls of SMAF.
>>
> "Add fake secure module" does sound like something not (m)any people
> want to hear ;-)
> Have you considered calling it 'dummy', 'test' or similar ?

"test" is better name, I will change to that

>
>
>> --- /dev/null
>> +++ b/drivers/smaf/smaf-fakesecure.c
>> @@ -0,0 +1,85 @@
>> +/*
>> + * smaf-fakesecure.c
>> + *
>> + * Copyright (C) Linaro SA 2015
>> + * Author: Benjamin Gaignard <benjamin.gaignard@linaro.org> for Linaro.
>> + * License terms:  GNU General Public License (GPL), version 2
>> + */
>> +#include <linux/module.h>
>> +#include <linux/slab.h>
>> +#include <linux/smaf-secure.h>
>> +
>> +#define MAGIC 0xDEADBEEF
>> +
>> +struct fake_private {
>> +       int magic;
>> +};
>> +
>> +static void *smaf_fakesecure_create(void)
>> +{
>> +       struct fake_private *priv;
>> +
>> +       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> Missing ENOMEM handling ?
>
>> +       priv->magic = MAGIC;
>> +
>> +       return priv;
>> +}
>> +
>> +static int smaf_fakesecure_destroy(void *ctx)
>> +{
>> +       struct fake_private *priv = (struct fake_private *)ctx;
> You might want to flesh this cast into a (inline) helper and use it throughout ?
>
>
> ... and that is all. Hope these were useful, or at the very least not
> utterly wrong, suggestions :-)
>
>
> Regards,
> Emil
>
> P.S. From a quick look userspace has some subtle bugs/odd practises.
> Let me know if you're interested in my input.

Your advices are welcome for userspace too

Thanks
Benjamin



-- 
Benjamin Gaignard

Graphic Working Group

Linaro.org │ Open source software for ARM SoCs

Follow Linaro: Facebook | Twitter | Blog

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web