From patchwork Thu Jan 19 09:21:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 644052 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp108485pvb; Thu, 19 Jan 2023 01:21:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXuagaYY5cDgGz5Q92Ip5YvSJuhy5wJ6WZlypLSFoMNz5osaLh+Hp2/KhHt48v3kV6J6Oaqm X-Received: by 2002:aca:c2c6:0:b0:363:a5fd:9cc7 with SMTP id s189-20020acac2c6000000b00363a5fd9cc7mr4145917oif.13.1674120115105; Thu, 19 Jan 2023 01:21:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674120115; cv=none; d=google.com; s=arc-20160816; b=kQQ4eX2oCve7zgHuFA5TEGR5+2/nTfpNDPQc3sNwJfkp+q9UcPbeOS0NjhvOUDYPMp sB4rwKvUymZiyxYpmxQIHlXedZ+yJLuKa/54dieNDh09csr1m1oOAkTqTNzb2nABcZJf LL0Cfwoz9XOyISmV7OeJF8Y8WqpxGqC45JqF2lYF+zSt6wlbnNy6km1zoDLv1IrLFY4N i6ww7JH9wgriEBf2Q+Yc1XopE46GbbIlAoBPxC2jqe9mBtZmNOpP4tT+CdGrT/LWXnDT jxeoD/G8ue6pBsjfTm0CnbZQoGWTKIgwvL05jZFYkAirfgit18AkC8ntzHLe8+XCh1x7 kHpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=uIGmCryU11KSzdvioOOcrN4jFXZuFjterAMo7TwemZ4=; b=pqaw0V9nH6ZGx+Vw4DGU4v9dWwu2mtWW/JqvVN+Oi5PMHcgilQN1AK75hGhYM5MQc7 DMHm7cIoJ5Q+u8xk90Odj4a0PkiGI7cQCZNrmpg/vcCG8udBpb9sUGBk/kcktGwh0yqt brZZnR5mbLAPk4yVDiX+jwk3l+DKbtgLtz6UYj4jOSktdCufoYAwRGliG0b6rgKefxui URDQNAIfQRge3IfydhF4dYfGFRlbzhdvTdU8hfCiYPB0kdz/+eowbQALnr+cD+RqqLgx wcNPcg9Ixbw1WnusgMhtiXBCY7Bg+u2eUwvZUBrM7y/J0wd3vHOFq6fYXEKEogz7UI59 W6BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LbJyrlLe; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id f9-20020a056830264900b00677c8c865a3si36361996otu.209.2023.01.19.01.21.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 01:21:55 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LbJyrlLe; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A5EDF85602; Thu, 19 Jan 2023 10:21:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="LbJyrlLe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8FAA88561D; Thu, 19 Jan 2023 10:21:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 440A482FE7 for ; Thu, 19 Jan 2023 10:21:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x52e.google.com with SMTP id y11so1983537edd.6 for ; Thu, 19 Jan 2023 01:21:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uIGmCryU11KSzdvioOOcrN4jFXZuFjterAMo7TwemZ4=; b=LbJyrlLeS8W6/t7fNzi9wrhLJy5of+tYaqSyxzf9cnH3G5+mwv58Hb+Ig2JHaWEF+v wsatxuFuO0yBh2NvJ/63CCGYht70jpfgF3onMo3aGabJrvXtoygmk1vShZdv3P2EL3HL eBtPHxfcitQ3uLJJlR+bLJxUxbXLJsW9P/A6TS04aJNm2pk4KFkEiblbCtazyA8np1ks wiiQ11jIXXMnIpKn4gWVoI4665sp2KrJI6voCH2J3iVwpqXpHbqscESky5ayfAJYcfis P3i6vpK6pSsJXizEhrrDF2IfWxpokpBKBMRbSdp3U7azatKwg7/31tmgA9jy7RhhJhrp CS/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uIGmCryU11KSzdvioOOcrN4jFXZuFjterAMo7TwemZ4=; b=X7RKVt5qemObQhAQ4xuBBgpnH6bhwLH+fcINHbGmlGY/sLQybBOH4Y1S4dTUp6Htqu VYqK5vCYru4dPI9r95cQuVn2P+TdMIx07jHquKgh1xk5f1ITCLsh02aNMnfOTC2moejA PtI9SIgr7TLeKESNDEGn8mCmxosoV4HTnyYG54eqIxqbJOWHsMq/Y4z7mCih+N84u+68 UImlFXHV2hVmKKi2MUKQDh60OrIlX5DDvUWgs7Axz7reMBzsuWtFkBt0/NNFEOUkcqIK B6E8xIt01wTc/ooEUIQZrSOQfjCmQSEySSTOn4vKkMDU2aZVa4PnAuAzq8JiTyT25AKn kp9g== X-Gm-Message-State: AFqh2krlFGrsZIunwbw26t600XX63px9q8IyAzPG31wA8EfIacjTKJ/3 j7mgJ2hAVCAlf7tadHusYgQwmZ6MSJx3cIOV X-Received: by 2002:a05:6402:43ce:b0:461:2288:6808 with SMTP id p14-20020a05640243ce00b0046122886808mr10903757edc.21.1674120106875; Thu, 19 Jan 2023 01:21:46 -0800 (PST) Received: from localhost.localdomain ([2a02:85f:fc9d:e4b5:9bc7:584e:9ff2:5cce]) by smtp.gmail.com with ESMTPSA id fd7-20020a056402388700b00483dd234ac6sm15040822edb.96.2023.01.19.01.21.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 01:21:46 -0800 (PST) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Jens Wiklander , Etienne Carriere , Patrick Delaunay , Patrice Chotard Subject: [PATCH] tee: optee: fix uuid comparisons on service discovery Date: Thu, 19 Jan 2023 11:21:37 +0200 Message-Id: <20230119092137.268465-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean When comparing UUIDs for discovered services we only compare up to the ptr size instead of the entire UUID Fixes: 94ccfb78a4d61 ("drivers: tee: optee: discover OP-TEE services") Signed-off-by: Ilias Apalodimas Reviewed-by: Jens Wiklander Reviewed-by: Etienne Carriere --- drivers/tee/optee/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.38.1 diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index 88e23d252bcd..9a9b697e91f5 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -73,7 +73,7 @@ static struct optee_service *find_service_driver(const struct tee_optee_ta_uuid for (idx = 0; idx < service_cnt; idx++, service++) { tee_optee_ta_uuid_to_octets(loc_uuid, &service->uuid); - if (!memcmp(uuid, loc_uuid, sizeof(uuid))) + if (!memcmp(uuid, loc_uuid, sizeof(*uuid))) return service; }