From patchwork Wed Mar 20 13:08:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ahelenia_Ziemia=C5=84ska?= X-Patchwork-Id: 1914101 X-Patchwork-Delegate: trini@ti.com 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; secure) header.d=nabijaczleweli.xyz header.i=@nabijaczleweli.xyz header.a=rsa-sha256 header.s=202305 header.b=BGikW9Iu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4V086c3slbz1yWy for ; Thu, 21 Mar 2024 00:08:40 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 36CA087FE8; Wed, 20 Mar 2024 14:08:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nabijaczleweli.xyz 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; secure) header.d=nabijaczleweli.xyz header.i=@nabijaczleweli.xyz header.b="BGikW9Iu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9186787F87; Wed, 20 Mar 2024 14:08:07 +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_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from tarta.nabijaczleweli.xyz (tarta.nabijaczleweli.xyz [139.28.40.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4E62287E47 for ; Wed, 20 Mar 2024 14:08:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nabijaczleweli.xyz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=nabijaczleweli@nabijaczleweli.xyz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202305; t=1710940084; bh=xjJ1Kv4gNVDXXyinB6hN4hVXHilucAljimc7sHy3Wlc=; h=Date:From:To:Subject:From; b=BGikW9Iu/AFZ5j0IaL8T3ujvZacmIr9FIZGoKnxGl20fSFA5r5emQX+8LrQ9hmXTf w8irKQFL2nvV8BY51kM4pOthD3TM7IdYcPqP1w+93YqnXCDKq9dmctxzbIO5V0gkIj XaBQsuOYZzjTTYf2+LuBJvCdKspzEfLl8A96AVvmWVYztY1HlWTTLgbkAO09TUekyZ Ip+eYAdehrkaM4bc6ybBh2CGxUErJ1d3o7sNdYKe/O4VlSC8/Hjf9cjTQj/qmAY5tU 2icS2/wxP57gfqImH2PK+cbFet5uimSRzPgzQVLHWLfrp+NiubxBT2FIrRPeALUHRw XRQEgDdIivJsQ== Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id B95C8FEA; Wed, 20 Mar 2024 14:08:04 +0100 (CET) Date: Wed, 20 Mar 2024 14:08:04 +0100 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= To: Tom Rini , u-boot@lists.denx.de Subject: [PATCH] tools: open FIT image for reading as O_RDONLY instead of O_RDWR Message-ID: MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20231221-2-4202cf-dirty X-Mailman-Approved-At: Wed, 20 Mar 2024 14:08:27 +0100 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.8 at phobos.denx.de X-Virus-Status: Clean The only usage of the fd is for the single read() below; this prevented mkimage -f auto -A arm64 \ -T kernel -C lz4 -d Image-6.6.15.lz4 \ -b mt8173-elm-hana-6.6.15.dtb outf when the inputs were unwriteable. Link: https://bugs.debian.org/1063097 Signed-off-by: Ahelenia ZiemiaƄska Reviewed-by: Dragan Simic --- tools/fit_image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/fit_image.c b/tools/fit_image.c index beef1fa8..0fccfbb4 100644 --- a/tools/fit_image.c +++ b/tools/fit_image.c @@ -137,7 +137,7 @@ static int fdt_property_file(struct image_tool_params *params, int ret; int fd; - fd = open(fname, O_RDWR | O_BINARY); + fd = open(fname, O_RDONLY | O_BINARY); if (fd < 0) { fprintf(stderr, "%s: Can't open %s: %s\n", params->cmdname, fname, strerror(errno));