Re: [PATCH v4] common: avb_verify: prevent opening incorrect session

2023-02-17 Thread Tom Rini
On Fri, Jan 27, 2023 at 10:02:14PM +0200, Ivan Khoronzhuk wrote:

> The arg->session is not valid if arg->ret != NULL, so can't be
> assigned, correct this.
> 
> Signed-off-by: Ivan Khoronzhuk 
> Reviewed-by: Jens Wiklander 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v4] common: avb_verify: prevent opening incorrect session

2023-02-03 Thread Jens Wiklander
On Fri, Jan 27, 2023 at 9:02 PM Ivan Khoronzhuk
 wrote:
>
> The arg->session is not valid if arg->ret != NULL, so can't be
> assigned, correct this.
>
> Signed-off-by: Ivan Khoronzhuk 
> ---
>  common/avb_verify.c | 9 +
>  1 file changed, 5 insertions(+), 4 deletions(-)

Reviewed-by: Jens Wiklander 

Thanks,
Jens

>
> diff --git a/common/avb_verify.c b/common/avb_verify.c
> index 0520a71455..48ba8db51e 100644
> --- a/common/avb_verify.c
> +++ b/common/avb_verify.c
> @@ -619,10 +619,11 @@ static int get_open_session(struct AvbOpsData *ops_data)
> memset(, 0, sizeof(arg));
> tee_optee_ta_uuid_to_octets(arg.uuid, );
> rc = tee_open_session(tee, , 0, NULL);
> -   if (!rc) {
> -   ops_data->tee = tee;
> -   ops_data->session = arg.session;
> -   }
> +   if (rc || arg.ret)
> +   continue;
> +
> +   ops_data->tee = tee;
> +   ops_data->session = arg.session;
> }
>
> return 0;
> --
> 2.34.1
>


Re: [PATCH v4] common: avb_verify: prevent opening incorrect session

2023-02-02 Thread Ivan Khoronzhuk

Any comments to this patch?

--
Regards,
Ivan Khoronzhuk


[PATCH v4] common: avb_verify: prevent opening incorrect session

2023-01-27 Thread Ivan Khoronzhuk
The arg->session is not valid if arg->ret != NULL, so can't be
assigned, correct this.

Signed-off-by: Ivan Khoronzhuk 
---
 common/avb_verify.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/common/avb_verify.c b/common/avb_verify.c
index 0520a71455..48ba8db51e 100644
--- a/common/avb_verify.c
+++ b/common/avb_verify.c
@@ -619,10 +619,11 @@ static int get_open_session(struct AvbOpsData *ops_data)
memset(, 0, sizeof(arg));
tee_optee_ta_uuid_to_octets(arg.uuid, );
rc = tee_open_session(tee, , 0, NULL);
-   if (!rc) {
-   ops_data->tee = tee;
-   ops_data->session = arg.session;
-   }
+   if (rc || arg.ret)
+   continue;
+
+   ops_data->tee = tee;
+   ops_data->session = arg.session;
}
 
return 0;
-- 
2.34.1