From patchwork Thu Nov 10 13:31:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 623333 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp119310pvb; Thu, 10 Nov 2022 05:31:49 -0800 (PST) X-Google-Smtp-Source: AMsMyM4MxYxPS/O8VGhMcDuJjVDMPeCayx27wPjzH3PoM6FBDzYLGPxq8QrsR752O3bPnY6s/1Ge X-Received: by 2002:a17:907:5cb:b0:791:96ec:f436 with SMTP id wg11-20020a17090705cb00b0079196ecf436mr62034718ejb.100.1668087108193; Thu, 10 Nov 2022 05:31:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668087108; cv=none; d=google.com; s=arc-20160816; b=NnF+LW4DChBrE5ZE4I0S8uB6Kw42w8NomWEl0XAss62D86ExRz/7o128UENzJiIQ4M ZtJiC4r39oc9InoEDTr3DIJ0uwP0gVGzkJHp9ve03NxvtkmokX9lYEd4TpMF+qN5cVyp qUS0FLHvaBbdi1tCMBaTnDqV+xjhq0v2mhQ+3ZUQHLAOrAdHpmCFflp51ov8jCFJ10Cp dBsF9GdPELvmH5qkuScnU338aYovgE1bHsG1ASx/RaKISDH1l9jqFspOSky4K0eP2vIZ KmDhSeh86NoM0PHNUK0DEDh+/KGT7QwovLazsmFwabux00pQPwNhOnLBSuGn+8ZyFyHx 00tA== 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=/hgtAe9S9H3HTc9yufog+2fD+4rv52h/bFwM3Tk/ATM=; b=Ra/hiCcJtKJNkMkBQZ8uurgWxaHfqqMloIfPGZNKluCd40GUIDTPwLIvXhNm+DLRkI DYsqgjMAkrPW/zjwOpBtyUz61fhYbmvTSP7E09hOg+2xnwKVqKIyL/h8WWxxJBdMOr+9 q+39m/vit7nI7EpQRoQYPGRoLaH3Ss+/YW4Mbr/oMRvLTCWWLeaxFVDVRu7CsmR0CgcE shI9/SQq4ILKGPEI/XrEVl5uH+NjRxkfPhwQhs+y6WvvedMD+5wJ7B3xp+Ot1vzHOpFM 38joEFFA7y1TdcxQJYj09liMziGiLYZgh7KHocBtCFWsQe4BK+hBW1YPC0Lc3d4D2cUz r5DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zzs8GGea; 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 c59-20020a509fc1000000b00462df2b0639si15939399edf.335.2022.11.10.05.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 05:31:48 -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=Zzs8GGea; 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 1F20585161; Thu, 10 Nov 2022 14:31:44 +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="Zzs8GGea"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C60398516C; Thu, 10 Nov 2022 14:31:42 +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-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (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 4254285152 for ; Thu, 10 Nov 2022 14:31:40 +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-wm1-x32d.google.com with SMTP id v124-20020a1cac82000000b003cf7a4ea2caso3400089wme.5 for ; Thu, 10 Nov 2022 05:31:40 -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=/hgtAe9S9H3HTc9yufog+2fD+4rv52h/bFwM3Tk/ATM=; b=Zzs8GGeaUTvG4jnQ8IKGZoMlxQkrC6OdVpIWyYDq/Nzng2FxGUSseGcnxNYoVCnhAS GDn9Jm6PmSGKzipySUk1YzMInZGELOFh0cxfox91WtOh57ExhIm5wS3tjEhyNX9/luEE xuQ/pS27bCi/P2gA3Swz35Fi86dd29zExuw5e/bNDRbe/fRl92oQHxt5ouvBTQqLeYxJ 0Suh/hVNQpjkw6etodvp6qsKEkIfD4f/PxnnjL3DFiCggw5YVZ8BzCbwS6pSNTTI2fNV UUORQf+OCHrBt6S/arBVOZUAcdS0IVY0hba0X4M4j6Ir1zXQveKhzyvYbOYS6lHommYe u7cw== 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=/hgtAe9S9H3HTc9yufog+2fD+4rv52h/bFwM3Tk/ATM=; b=P32+OxsDwIW+JZkA33tntzh6Qt9EYS3caoheIuWGOzKUNq4L3/WBvjGA7FFFlKSM0I ctVBKO8s2V6xiD9tmu+j4eWthlf5xsa60Nl9ZpNyR+/hdlqOD54xudFNNDgRbVYTJut0 BIUN0KLvYUzYWIX32TDv29pE1vwh+ryG1+VQgk68li2Pn9yCR1KdN15ZLrCnqIZg+GwC VUL2ZinDeQKbBZCvBuMil8iDOkjz99QjsnFg7xIvCe0GW04OPKqEdBbIA9OO/wB0iCfi JtMAceZUxa9KMKu9O8ON2kMNCO6mjHI99Fh3P7ZK+Ghw2kL/txffFGlxEUTpw/AAODTS yxHg== X-Gm-Message-State: ACrzQf1Xfek3oELAq3nFdfYV5+Qn/KAvWxKJ3GsOi8MYmdoN/xYnmyqV tKUrsL8py9Is8SqjWhpSjyUq1N1hjMoD0PPU X-Received: by 2002:a05:600c:4b95:b0:3cf:a13f:43bc with SMTP id e21-20020a05600c4b9500b003cfa13f43bcmr18296768wmp.128.1668087099830; Thu, 10 Nov 2022 05:31:39 -0800 (PST) Received: from localhost.localdomain ([2a02:85f:fc35:4b7e:b46:e9a0:216f:aab5]) by smtp.gmail.com with ESMTPSA id m3-20020a05600c3b0300b003b4ff30e566sm7386149wms.3.2022.11.10.05.31.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 05:31:39 -0800 (PST) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: heinrich.schuchardt@canonical.com, Ilias Apalodimas , Heinrich Schuchardt Subject: [PATCH] efi_loader: add comments on efi_file_from_path() regarding alignment Date: Thu, 10 Nov 2022 15:31:30 +0200 Message-Id: <20221110133131.237955-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 UEFI specification requires pointers that are passed to protocol member functions to be aligned. There's a u16_strdup in that function which doesn't make sense otherwise Add a comment so no one removes it accidentally Signed-off-by: Ilias Apalodimas Reviewed-by: Heinrich Schuchardt Reviewed-by: Heinrich Schuchardt --- lib/efi_loader/efi_file.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c index 8480ed3007c7..5c254ccdd64d 100644 --- a/lib/efi_loader/efi_file.c +++ b/lib/efi_loader/efi_file.c @@ -1135,6 +1135,11 @@ struct efi_file_handle *efi_file_from_path(struct efi_device_path *fp) return NULL; } + /* + * UEFI specification requires pointers that are passed to + * protocol member functions to be aligned. So memcpy it + * unconditionally + */ filename = u16_strdup(fdp->str); if (!filename) return NULL;