lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHUa44G4O0JgqN=BwvshRXzUeEE1oXD1o8Yn-5X6p5qY8vkDQA@mail.gmail.com>
Date: Thu, 12 Sep 2024 07:50:08 +0200
From: Jens Wiklander <jens.wiklander@...aro.org>
To: Rijo Thomas <Rijo-john.Thomas@....com>, Devaraj Rangasamy <Devaraj.Rangasamy@....com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, op-tee@...ts.trustedfirmware.org, 
	linux-kernel@...r.kernel.org, Sumit Garg <sumit.garg@...aro.org>
Subject: Re: [PATCH v1 1/1] tee: amdtee: Use %pUl printk() format specifier to
 print GUIDs

On Wed, Sep 11, 2024 at 10:41 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> Replace the custom approach with the %pUl printk() format specifier.
> No functional change intended.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  drivers/tee/amdtee/core.c | 17 ++++-------------
>  1 file changed, 4 insertions(+), 13 deletions(-)

Thanks, the patch looks like a nice simplificatrion.

Rijo, Devaraj, does this work for you?

Cheers,
Jens

>
> diff --git a/drivers/tee/amdtee/core.c b/drivers/tee/amdtee/core.c
> index e487231d25dc..d3201eff1b74 100644
> --- a/drivers/tee/amdtee/core.c
> +++ b/drivers/tee/amdtee/core.c
> @@ -14,6 +14,7 @@
>  #include <linux/mm.h>
>  #include <linux/uaccess.h>
>  #include <linux/firmware.h>
> +#include <linux/uuid.h>
>  #include "amdtee_private.h"
>  #include <linux/psp-tee.h>
>
> @@ -172,21 +173,11 @@ static int copy_ta_binary(struct tee_context *ctx, void *ptr, void **ta,
>  {
>         const struct firmware *fw;
>         char fw_name[TA_PATH_MAX];
> -       struct {
> -               u32 lo;
> -               u16 mid;
> -               u16 hi_ver;
> -               u8 seq_n[8];
> -       } *uuid = ptr;
>         int n, rc = 0;
> +       guid_t uuid;
>
> -       n = snprintf(fw_name, TA_PATH_MAX,
> -                    "%s/%08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x.bin",
> -                    TA_LOAD_PATH, uuid->lo, uuid->mid, uuid->hi_ver,
> -                    uuid->seq_n[0], uuid->seq_n[1],
> -                    uuid->seq_n[2], uuid->seq_n[3],
> -                    uuid->seq_n[4], uuid->seq_n[5],
> -                    uuid->seq_n[6], uuid->seq_n[7]);
> +       import_guid(&uuid, ptr);
> +       n = snprintf(fw_name, TA_PATH_MAX, "%s/%pUl.bin", TA_LOAD_PATH, &uuid);
>         if (n < 0 || n >= TA_PATH_MAX) {
>                 pr_err("failed to get firmware name\n");
>                 return -EINVAL;
> --
> 2.43.0.rc1.1336.g36b5255a03ac
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ