From patchwork Tue Mar 12 16:27:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayoub Zaki X-Patchwork-Id: 1911200 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=Mqmhz+T/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::537; helo=mail-ed1-x537.google.com; envelope-from=swupdate+bncbdbktzhrzujrbe4fykxqmgqebpa5cyq@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-ed1-x537.google.com (mail-ed1-x537.google.com [IPv6:2a00:1450:4864:20::537]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TvJwW4K2pz1yWy for ; Wed, 13 Mar 2024 03:28:10 +1100 (AEDT) Received: by mail-ed1-x537.google.com with SMTP id 4fb4d7f45d1cf-5681b29771fsf4250577a12.1 for ; Tue, 12 Mar 2024 09:28:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710260884; cv=pass; d=google.com; s=arc-20160816; b=SOqJt6HrmFfNS8h9pm5UPxhlyRFpsjhHC1sfi4rP6J/oe06uRD2OA1E14h7FcH1KJo qcxN1qOvrO5Lg2InmzaKL/1jm6n2S3PotjjRKxH/VjaH+PrSouXmA0I6DRu/8aVWB02M cSDgxTvzH7hxsmrDH3yg0E2lH978SMco0aP/ZNmckuKnl4/eI8b0sEEJH8e3lfCL1N7g AkGBZAmcn8YZ7ZpKauM9FKN6MPuMdIuGDmckKbotwuOxdDlK6Rx6YowOKnWH6DzhDvdR KrAoOXdeRN/eQfXf6NpoPVERFoI5cxjJ1KFcaJtcvQ1FCSctf+SF0i8SjOZ7DMCRqHut 27Qg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=tXDJ3Hz0GWFRgYkMfhzE5vp0cJr6HFY94htA+ws1TUA=; fh=4yfsMnqES74s29ifEsxat/Wz3ZYGY0NeOyGI0Kb7OoI=; b=oiHmNSY9mbRThwpd2RMyeh6cuwnvHcYOMc4m6MBAadlsvC7Of9fy6JBILQzGJ39IMB vDE0m+kzVaBGCqtE0LKilfm9mASb2lQbRDf4AjgjppED1RNpLQLhVV1VOJfXwP5we74A F3vgCmWvIkkX7txl9dyqKSnHzL3/01muJptNQ4YlAhtAP9/+ihZaeGldjzAOe+4yd/v+ 0e/vVQHQKGkt2n580bYWa326qjnA1N9MWrwmnzOrFXAydhIeCMF5AkijwKCUetFw7bQx XgBL5Utiyy/s8QOnI/4b5ONzVOYa1jdwx7sH7XMX/XyM7MtCSuYWF7fP8QjOjD62HR5e Sszg==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@embetrix.com header.s=rsa1 header.b="bvh/RNWU"; dkim=neutral (no key) header.i=@embetrix.com header.s=ed1; spf=neutral (google.com: 2a02:2350:5:524::1 is neither permitted nor denied by best guess record for domain of ayoub.zaki@embetrix.com) smtp.mailfrom=ayoub.zaki@embetrix.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1710260884; x=1710865684; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=tXDJ3Hz0GWFRgYkMfhzE5vp0cJr6HFY94htA+ws1TUA=; b=Mqmhz+T/B5xiSxWWlsYXMNWACAly1/tWAuR71VX0Bx5jt9YKAYIaYhdIrvOwECVJvq xhxF6naSQ7mgQQub+iWL+k+Viv1Y6D78VvUwoWUD4BSp9dvbWh5WdqR53oPnjQiyuWtc FejtLBAG8mkm3jXIL2/lnOcUCC2huugdoWSK7eaKlZMV0ZMGNJiTGWeR33SvlIIGs6eR +6NflUejzLJ1KbcTwL8f1xyFI7IEMketVlDa914WbiwpbZjXvRL4WWL6JtHlaGX6H4ol b3BXueQcrHQaM24OUn3lE5ZYe/AG2PeGYhGV0cftNkBa6PTSFcH45NYFGUVw1n7lKFAw oZkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710260884; x=1710865684; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=tXDJ3Hz0GWFRgYkMfhzE5vp0cJr6HFY94htA+ws1TUA=; b=iSQXxKkvf+/FRD2fYPcHDII1jjLFUlYydHeSEwAfsBVraOy4gEFbABISpBBurIdEwo WOgZOXvCViTxj5hg9G9Kzlc7FeN/ebIt4ptWYkelbMg7V8zywa+UmqVWbBIZmJgimpVx 0VmGpbhC/41CzTZfj5bOeO5GpXjPqoa+TlCOdLTTcs73mp1BBw7REXmYttDRKsfTlD9w m0/Pi0j4NSUxv91Rk3J2Yi8Vuw87OgpwOC/Tt+se/vWS7jFBrfqGiBRcIkFAQEEr8XZ4 eI8iRJfG52kUNnN6AiyylKN9+4hFPoLmSFpqk5wzPO21rLKRFjv6bU6kP758gaZ3fczf ff+Q== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCVRLEmM5gsgclT1q97UmoTP1eee/9ivpUnw5uuZDrenQmnVms7MwCORmEX/wl04POItErvHICA9f/qzSYpy5EIKASIdOVxOhh4wI3bPQA== X-Gm-Message-State: AOJu0YzPBnZelF5p9bUlxNDXmSzW5fNSY/iFn3gQ1POjXumaTO0jS0Sb fcBkbCUYsn8LMXWlKEPv7xONtWsRo19A8GZuhfO8CXd9p8UdyXNr X-Google-Smtp-Source: AGHT+IE7VQrDl1V6kPkbgX1LivQSe3KuebNniwO9X6OTKtGDQIZuw+U+wW7xXp3XEFfYYcGlzvYVhg== X-Received: by 2002:a50:8d5d:0:b0:566:117c:cfca with SMTP id t29-20020a508d5d000000b00566117ccfcamr6817926edt.4.1710260883691; Tue, 12 Mar 2024 09:28:03 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6402:388e:b0:567:f967:fe57 with SMTP id fd14-20020a056402388e00b00567f967fe57ls1486230edb.1.-pod-prod-08-eu; Tue, 12 Mar 2024 09:28:01 -0700 (PDT) X-Received: by 2002:a17:906:4a48:b0:a45:f29a:18b4 with SMTP id a8-20020a1709064a4800b00a45f29a18b4mr6162269ejv.65.1710260881341; Tue, 12 Mar 2024 09:28:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710260881; cv=none; d=google.com; s=arc-20160816; b=dRkRbbDbM0VGfDpV2dVymeyfbiPz68PX2tkf7f/umaCY37GvzWL250PpSHN6I3kYWg 1Z8w5Qa5EQMzO6V11v0lFGjoOdhtwWrmhl2xQYKEdSqvNun3ugu3p9q24LgdcUoeTAXZ UOvGz/t9CgCIY2+gausy92vH9khb18lgG6n3btsWI8VMbweG0/1UkDECpLOoZO1RITeK YBf9cE/R+Jz5O5I2OBrKKs9cWdSyxipFPFPW4vhS9oCVaQ014QVNR854IgQr08ozJKGA s0Zl91aIu0CTOHbAY3fwvsfQV0Hu+eEmeiP0ZjpNNzumDjWYjc1sqOp+mj9PNDzH96+y TyVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature:dkim-signature; bh=mjPolLweBfv/x+CJpMQmVmktXN3RMSZ7CvytQQMZJNM=; fh=+OJORHqdqTgck03oywGhM24wqLll/i7F/sjzFdEpJxw=; b=V9xQ0NgcfH8U8r5YTV4WY/P4tbHYzuP6jcopesNLAeGGecSL2pIHMPUN7fF8zv96On UwfOZD6/iiVZxS/JCHhDmADlZL6U7EO4XpSPHeygmn+ItpqHhCcDycquNulc7gBKTOf5 qAam4dnXssZ/hmJti9CxF1tiarsOCrefY3ZjP2IVW4RVJuegUb5YnB6hQYq9ZZByyLnO fjmkCr667GpG5XMmCXA48A6MbCpHK9xnnWXd9tZP/7UdqfVBXDIDBEW0M2Wt98WDqPTn MlIHaigMq3x1MeMaMGSH2os2uZmtjCsnn+p+Ilm/yR32lCf3Ws/KDOVhANDWpmg94SlD 7EnA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@embetrix.com header.s=rsa1 header.b="bvh/RNWU"; dkim=neutral (no key) header.i=@embetrix.com header.s=ed1; spf=neutral (google.com: 2a02:2350:5:524::1 is neither permitted nor denied by best guess record for domain of ayoub.zaki@embetrix.com) smtp.mailfrom=ayoub.zaki@embetrix.com Received: from mailrelay5-3.pub.mailoutpod3-cph3.one.com (mailrelay5-3.pub.mailoutpod3-cph3.one.com. [2a02:2350:5:524::1]) by gmr-mx.google.com with ESMTPS id kx25-20020a170907775900b00a3e5ad28aeasi553945ejc.2.2024.03.12.09.28.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 09:28:01 -0700 (PDT) Received-SPF: neutral (google.com: 2a02:2350:5:524::1 is neither permitted nor denied by best guess record for domain of ayoub.zaki@embetrix.com) client-ip=2a02:2350:5:524::1; X-HalOne-ID: 7d2eb9fe-e08d-11ee-9e22-9fce02cdf4bb Received: from xps13.fritz.box (dynamic-002-212-008-046.2.212.pool.telefonica.de [2.212.8.46]) by mailrelay5.pub.mailoutpod3-cph3.one.com (Halon) with ESMTPSA id 7d2eb9fe-e08d-11ee-9e22-9fce02cdf4bb; Tue, 12 Mar 2024 16:28:00 +0000 (UTC) From: Ayoub Zaki To: swupdate@googlegroups.com Cc: Ayoub Zaki Subject: [swupdate] [meta-swupdate][PATCH] Backport Fix for IVT check BUG into release 2023.12.1 Date: Tue, 12 Mar 2024 17:27:58 +0100 Message-Id: <20240312162758.374602-1-ayoub.zaki@embetrix.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Original-Sender: ayoub.zaki@embetrix.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@embetrix.com header.s=rsa1 header.b="bvh/RNWU"; dkim=neutral (no key) header.i=@embetrix.com header.s=ed1; spf=neutral (google.com: 2a02:2350:5:524::1 is neither permitted nor denied by best guess record for domain of ayoub.zaki@embetrix.com) smtp.mailfrom=ayoub.zaki@embetrix.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Patch Cherry-picked from: https://github.com/sbabic/swupdate/commit/fee1c3febbb45bdc691c1fde79f537cdfc74ffc5 On the console the reported swupdate version will be: $ swupdate --version SWUpdate v2023.12.1-dirty Signed-off-by: Ayoub Zaki --- .../0001-BUG-regression-checking-IVT.patch | 34 +++++++++++++++++++ .../swupdate/swupdate_2023.12.1.bb | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 recipes-support/swupdate/swupdate/0001-BUG-regression-checking-IVT.patch diff --git a/recipes-support/swupdate/swupdate/0001-BUG-regression-checking-IVT.patch b/recipes-support/swupdate/swupdate/0001-BUG-regression-checking-IVT.patch new file mode 100644 index 0000000..b3e0bde --- /dev/null +++ b/recipes-support/swupdate/swupdate/0001-BUG-regression-checking-IVT.patch @@ -0,0 +1,34 @@ +From fee1c3febbb45bdc691c1fde79f537cdfc74ffc5 Mon Sep 17 00:00:00 2001 +From: Stefano Babic +Date: Mon, 19 Feb 2024 19:05:29 +0100 +Subject: [PATCH] BUG: regression checking IVT + +e48a866542 creates a regression bug. A valid IVT pointer is always +passed because it is generally a zeroed array of chars, so passing null +length string is a valid case and not an error, and in that case the IVT +from the file should be taken. + +Signed-off-by: Stefano Babic +Signed-off-by: Ayoub Zaki +--- + core/cpio_utils.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/core/cpio_utils.c b/core/cpio_utils.c +index e5de2a7..7948dc2 100644 +--- a/core/cpio_utils.c ++++ b/core/cpio_utils.c +@@ -514,8 +514,8 @@ static int __swupdate_copy(int fdin, unsigned char *inbuf, void *out, size_t nby + + if (encrypted) { + aes_key = get_aes_key(); +- if (imgivt) { +- if (!strlen(imgivt) || !is_hex_str(imgivt) || ascii_to_bin(ivtbuf, sizeof(ivtbuf), imgivt)) { ++ if (imgivt && strlen(imgivt)) { ++ if (!is_hex_str(imgivt) || ascii_to_bin(ivtbuf, sizeof(ivtbuf), imgivt)) { + ERROR("Invalid image ivt"); + return -EINVAL; + } +-- +2.34.1 + diff --git a/recipes-support/swupdate/swupdate_2023.12.1.bb b/recipes-support/swupdate/swupdate_2023.12.1.bb index 4eee687..bc9b641 100644 --- a/recipes-support/swupdate/swupdate_2023.12.1.bb +++ b/recipes-support/swupdate/swupdate_2023.12.1.bb @@ -1,3 +1,5 @@ require swupdate.inc +SRC_URI += "file://0001-BUG-regression-checking-IVT.patch" + SRCREV = "66952eff1a30701686723ff2fab0576b389620db"