From patchwork Mon Jun 17 07:29:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dominique Martinet X-Patchwork-Id: 1948522 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=jS92ipWy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::73f; helo=mail-qk1-x73f.google.com; envelope-from=swupdate+bncbcwivbv7sugrbtglx6zqmgqemgo3agq@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-qk1-x73f.google.com (mail-qk1-x73f.google.com [IPv6:2607:f8b0:4864:20::73f]) (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 4W2hND4qBbz20Z6 for ; Mon, 17 Jun 2024 17:29:26 +1000 (AEST) Received: by mail-qk1-x73f.google.com with SMTP id af79cd13be357-795be0bcf48sf138737985a.3 for ; Mon, 17 Jun 2024 00:29:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718609358; cv=pass; d=google.com; s=arc-20160816; b=Xf2a5qvORppY59DwhVjA7a7jgicB8ZzQ6Y+Rg+IQVLwG47ZDRh5ba1ICqjyEhAXqmH 1pR4mx7kouJ47p+j+q7MOecHGItXRwkMb/yUjmpQcL0Bl3729yfajVPZdhGMBRKe3cTm i8BpvzhdrmhPoJJH20t8GOnefeCwx3v4hxKjjk2YnDUXYw+HO2/gBGGztLCpQz3qoyu2 90ZsZthtD3xNJ6URWmLULn014vHUYd4+gmuTgPKCNSAqeEOrUaRBk63ODgJBq1coMcEq Twno8uP5UxpQpuXy7coW8+S3G8b25KzmxBVEayV0REJpgsr+w+w4n76h0Tz4YPKF44g9 MsyQ== 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=+MhJSCUJjsui4DOBajyEEMAg0gOqWnTLNVXOSd2zNaE=; fh=G8QfLjjYI1yHHqSE6EEn3j39ogd01EkvYmbwWqM8Nwo=; b=MXWiVtulm8JLwKOFe24xYnCC2bTPyx1E/zUgbtt+6EFzu3GznOGey1Wp1dtBMGIfUC /t3bBEj5bgF5wjuTReZnMabmYnXFlIcUip1X83pKvpRyIWc759Ccz2SGjI0fmdJXBMFk oDZtnjzQqmUOL74AOW/fLZ70p2ZI+XvnF6n9JibjsqfW8eyqOAOQuSmuZr8MO+gP39lg kquxWYoICF2PzQKEWQKy3vrqpNCvaCtJlO/lpioOXeNCWsKutLHer/BSgb57TigIFC3K VT2eEvTM6e+wHYhnJNn+KvqghjxGWXQgk0WLWoHyD/kBlc2zsVj2r7XH3N1X0QLTsUVL AIkA==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@atmark-techno.com header.s=gw2_bookworm header.b=bX+IbLFZ; dkim=pass header.i=@atmark-techno.com header.s=google header.b=cRvmMa1S; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=atmark-techno.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1718609358; x=1719214158; 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=+MhJSCUJjsui4DOBajyEEMAg0gOqWnTLNVXOSd2zNaE=; b=jS92ipWyDOE5oVGqfww9/gOxOozIbbCrBKxiyvrqrTvd1/ebyIJu4N+v7mBy4ObDR2 AnC8UHe+BAtSmamiqnhyxLGqzK07s4Bbivktg1rxvzmjY+SSbnNJQmMQWp+yWAADYAFV 0IqyqN++h84H09VStKUugAqAWi5fYOud/Ud+6uERGlw9+hheHCsUn89CaQ1VMhBwHS71 tU0uwK/9Gdpu+gxZeDl9ygYb/n5Hiw5jgyQiKiqYhCXG49hi7KfEcKT+J16G6KEGp7RS MDclA5MY5ijjqu7Vi2+sbLaw+FCEsJLP3bfXyydNaPhfuLq87xjZUb9+gwwREhdlK9sq vYzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718609358; x=1719214158; 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=+MhJSCUJjsui4DOBajyEEMAg0gOqWnTLNVXOSd2zNaE=; b=XbY4ORdwQfAwsPKh5g7pLAJf0ATbtuVzvze7NnQyG/kaR1pW1AhPa0hVi8Smzl875V Jjo06MEIcjBqlGJAxQsieW72SCFqWNRT4HrYic6ZMOQn1HkiTLdmDPEKba1QYW2E74Dl +qxm3OjP7MN36o7mKEApol9VH4yyMB+0Cc/irdMgBuUSk+l2SEBVuV2oqwscygpIZORd QCn61x3lLVgUnRv/wOud3bh0PSzyKsxmU5Y4mVX9OcvPDD8g8tr8ZMFZ1bGlQuW3vy7M TiZ6hEwG/kTk/hDXX/z7DBbOyocuJabj+515RPcBbaMvm7DlSZI3l84FiaNgkb8Sau4z Dtpw== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCXC9TKfeOojwJ8UdjLCOxYr92vty0Q98LJ+ioTdj0tcBNQtPlmYPJWF7dlw3s65f1nm4Oil6OEW4vUankybwT1NRXeSlofa4mChlb4S3Q== X-Gm-Message-State: AOJu0YyblVwE9O+EQj11F/ZXJgUcRhXaMFGLvdhxKGqQyWpqNdpDLbXL 0NtGPoJSTuVwm6H9poYffKtORehXC57P7f6wcmsE39ScAiT4ZwPt X-Google-Smtp-Source: AGHT+IFFmwmvGaso+YdAw8hkAkE8ACRZbhPab1OL/+QTQCAXA78lZzQHLPp+cfcdMdMrwdNRc2dNzQ== X-Received: by 2002:a05:622a:1108:b0:441:595d:c9eb with SMTP id d75a77b69052e-44216b47194mr98905501cf.5.1718609357589; Mon, 17 Jun 2024 00:29:17 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:ac8:1201:0:b0:43f:f68f:3e61 with SMTP id d75a77b69052e-4417ac22a94ls46484281cf.1.-pod-prod-06-us; Mon, 17 Jun 2024 00:29:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU/I91ilD3W991F4akXPGeCviK9vaYaUo/q6bebDO361k5L1ZxW3cmh2FZGf0SBnDsCfVBClPlwsnGfEO7ON3wG1wIQkYBgBElG X-Received: by 2002:a05:620a:2410:b0:795:5a7d:44de with SMTP id af79cd13be357-798d2413425mr1120586585a.25.1718609356077; Mon, 17 Jun 2024 00:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718609356; cv=none; d=google.com; s=arc-20160816; b=bmHIyE7s+iBZdda6jnV1cAjgfJXh0DWzSFf/+mSnhPgUx2LuiWYdjTYNwlSh+2SNQk KAMkv8Q7VpX+X+ffWDiAbzZWqmu+4Wgqzx9Lpo7PFmEiGt5Xqegh2DM4QnM2uvmzk9pm ZoEEzfKGx4GKZuB+26lxY8aigURfrBjbSMyXpS8TKhK8s/0VwFOgb15OaWuWNMHHTYlE +50iWPshNi68hbauSz/IOj/SiODgvwEBW0CtcFqMipgawfuPwevuMCYULKQGorDowQgC kJiNeqTRut2YE+iRZMQ7v6wKsxacALuClXa88gaaX+HrmldnSLH0QCCw58sw2hhI1Hsq l8QA== 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=aK50O7tW4iqiPYHApn24ymwR5Qx5edyr3NbuE2xGDF8=; fh=/sq+FPHvxIpv9Wvv5O8vCTDEXMmQ72P6fgNtDxylWgY=; b=W4ultg63LIzYtq1sTAXG6mf1+X+zlIX2hfCE4YxTabxSVQqU5vh1BxM4Tamfg3pPsR nP6sOrxiTSbsq9eosUe0iNKQSvBk9S/zDAy9gDqkli2PX4q9xtRYDhCCkP1xjoUTzr6H Tnlh/RS8EsspOP4a9PKIj/M4uErOR/xQulgiZBdgYvo6BuaUBJSe4ahCVbkqRdy5EQd1 F2LsC2YTNuEolggJZgDG6ll+xerDh521pY9RCiIf4b4QyAEIVdnK5XTxHXpAnjB+RGHc ozySZq+2y2hBwh5fmFuuachesEUUaqAYChONd4HpYjmT98RYrgukCZpi1vc9FLkMyM7T zJbg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@atmark-techno.com header.s=gw2_bookworm header.b=bX+IbLFZ; dkim=pass header.i=@atmark-techno.com header.s=google header.b=cRvmMa1S; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=atmark-techno.com Received: from gw2.atmark-techno.com (gw2.atmark-techno.com. [35.74.137.57]) by gmr-mx.google.com with ESMTPS id af79cd13be357-798aac9d597si40673785a.2.2024.06.17.00.29.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 00:29:16 -0700 (PDT) Received-SPF: pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) client-ip=35.74.137.57; Received: from gw2.atmark-techno.com (localhost [127.0.0.1]) by gw2.atmark-techno.com (Postfix) with ESMTP id A43F7A74 for ; Mon, 17 Jun 2024 16:29:13 +0900 (JST) Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by gw2.atmark-techno.com (Postfix) with ESMTPS id D980092D for ; Mon, 17 Jun 2024 16:29:12 +0900 (JST) Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-7024261bb31so3902836b3a.1 for ; Mon, 17 Jun 2024 00:29:12 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWlwsuyUSrZIQqraqDTaAqsV5xUhpnPNxE6zH1LNTgb28bNcQMcXpcI/efi8+eaFrZmw7mQkJufewb3DvEr0FL54/VW92Ov3BTF X-Received: by 2002:a05:6a20:1592:b0:1b8:5c3c:7951 with SMTP id adf61e73a8af0-1bae7e10c50mr10113937637.3.1718609351850; Mon, 17 Jun 2024 00:29:11 -0700 (PDT) X-Received: by 2002:a05:6a20:1592:b0:1b8:5c3c:7951 with SMTP id adf61e73a8af0-1bae7e10c50mr10113923637.3.1718609351488; Mon, 17 Jun 2024 00:29:11 -0700 (PDT) Received: from pc-0182.atmarktech (162.198.187.35.bc.googleusercontent.com. [35.187.198.162]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705cc96d2a7sm6858678b3a.78.2024.06.17.00.29.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2024 00:29:10 -0700 (PDT) Received: from [::1] (helo=pc-0182.atmark.tech) by pc-0182.atmarktech with esmtp (Exim 4.96) (envelope-from ) id 1sJ6nd-009Y52-16; Mon, 17 Jun 2024 16:29:09 +0900 From: Dominique Martinet To: stefano.babic@swupdate.org, swupdate@googlegroups.com Cc: Dominique Martinet Subject: [swupdate] [PATCH 0/4] misc fixes from chunked stream rework Date: Mon, 17 Jun 2024 16:29:01 +0900 Message-Id: <20240617072905.2275940-1-dominique.martinet@atmark-techno.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Original-Sender: dominique.martinet@atmark-techno.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@atmark-techno.com header.s=gw2_bookworm header.b=bX+IbLFZ; dkim=pass header.i=@atmark-techno.com header.s=google header.b=cRvmMa1S; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=atmark-techno.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: , These were the patches I sent as RFC patch a couple of weeks ago that are probably good to take and will be useful regardless of what we end up doing, it makes sense to split them out: - fix a memory leak on set_find_path - fix a potential data corruption on partial read before EOF - cleanup for callers that could be using copyimage - cleanup for steps assignment in __swupdate_copy (Since I changed the order of the patches you won't be able to apply my proof of concept chunks, if that is still something you'd want to test after these patches get merged you can use this branch: https://github.com/atmark-techno/swupdate/tree/chunked_stream ) Dominique Martinet (4): parser: set_find_path: properly return to-free string array cpio_utils: fill_buffer: fix return value on EOF after short read copyfile cleanup: use copyimage when we can cpio_utils: cleanup state chaining code core/cpio_utils.c | 35 ++++++++++---------------- core/parsing_library.c | 5 ++-- corelib/lua_interface.c | 38 ++++++----------------------- corelib/parsing_library_libconfig.c | 2 +- corelib/parsing_library_libjson.c | 2 +- handlers/delta_handler.c | 13 +--------- handlers/rdiff_handler.c | 13 +--------- include/parselib.h | 2 +- parser/parser.c | 2 +- 9 files changed, 29 insertions(+), 83 deletions(-)