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


Groups > linux.kernel > #1401810

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

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Emil Velikov <emil.l.velikov@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v7 3/3] SMAF: add fake secure module
Date Tue, 17 May 2016 01:20:01 +0200
Message-ID <rzzXP-52x-1@gated-at.bofh.it> (permalink)
References <rwUYN-87h-17@gated-at.bofh.it> <rwUYN-87h-15@gated-at.bofh.it>
X-Original-To Benjamin Gaignard <benjamin.gaignard@linaro.org>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=2xL7LJGABzRsTTuLpYp1R72d8mtfw3caQp4AVdd1JRo=; b=aUaVizFdPLRYTO317aZ3i33s9N8lkDhrJbwpJazJmNSq55vYAHRnhhzWcjhP1ReTdY veOMUrA/8h/sG3BhhHC0HPAYPcBEtIed/GUi5eCFJu555//rPSDBNUpz1WBNP7YCNmGE YICJQjbFFp3zABIO32qN7JEua2mVAs7SGOh3Gbsf50Tsior/B6e1jA+1XhEnql9I+34j QAbGK/OOT+ULvbv5Wk64aJgKMs8qxRxyFSEPqjIP8Pp3LBk1dT6JNHviuCvPBrV9ywzU pYZToGAL1Vcl0mqhNVK3HJWT8KBkej6twdqQgMcBbDuzREucfqUf4iYbhL1CEobIs77z hy6g==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=2xL7LJGABzRsTTuLpYp1R72d8mtfw3caQp4AVdd1JRo=; b=A0OMw7mwo62pNFtaskEuJcKnK6BV2ldQebqh2J+Bd1Qam9Lec0oBwWmSR4VXfLcJ3Q VY9ooi0DAZB39cvcqKhJwGuP5ZxZD4pg9Ffq4ZaeCux1gXWPrx/IIDOBC5H8BQ9pmrpu 692r/DcUbrX1v9TzwapyDOxkKei6urHvq93XyWfVm+3xBvVLpuUWJWrcnhzn7enq06gp Byhm8PuXfcWVTh3pgNTFw6njZaaYRAwfN/MYkKVxCtqagDf4ghCTwvhWtEyzQ+7XGqoC DVvie54wLtb5OC2nbQRRk2uMTAQ1y//Md4pmOjWxB/0aHiGGOAS7lNL/r5KtJoSus33w +oTA==
X-Gm-Message-State AOPr4FXEf0ww7Af2EZ7d197Dtdxh4dF1CVzTtF3fzja9zpmijVX3eUVR7ERBKLsNqkq7BrIJPS8SkCCexr/+XA==
MIME-Version 1.0
X-Received by 10.194.174.71 with SMTP id bq7mr15591263wjc.64.1463440224422; Mon, 16 May 2016 16:10:24 -0700 (PDT)
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 57
Organization linux.* mail to news gateway
X-Original-Cc linux-media@vger.kernel.org, "Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>, ML dri-devel <dri-devel@lists.freedesktop.org>, zoltan.kuscsik@linaro.org, Sumit Semwal <sumit.semwal@linaro.org>, cc.ma@mediatek.com, pascal.brand@linaro.org, joakim.bech@linaro.org, dan.caprita@windriver.com
X-Original-Date Tue, 17 May 2016 00:10:24 +0100
X-Original-Message-ID <CACvgo50i0Y=TJNCvX+c2m8u8ai2p30EbaU1u3xBmQYBZGWH5UA@mail.gmail.com>
X-Original-References <1462806459-8124-1-git-send-email-benjamin.gaignard@linaro.org> <1462806459-8124-4-git-send-email-benjamin.gaignard@linaro.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1401810

Show key headers only | View raw


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.

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

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

csiph-web