From patchwork Mon Dec 6 05:44:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 520956 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp4223819imb; Sun, 5 Dec 2021 21:44:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwmLQp9ohglO1l+R5lsF1tFgBTirLd9rgQBL5FY/7enP481klVdolFWVfu3PZDhWKWb3ljz X-Received: by 2002:a50:e0c9:: with SMTP id j9mr51586335edl.336.1638769481718; Sun, 05 Dec 2021 21:44:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1638769481; cv=none; d=google.com; s=arc-20160816; b=dr4uLkKy5t5lrnLVbY8uhFpmEUseD2mKuQatxNF9XannsWUfcWjhHovWwKnAOXZfvL STe2SMy19WDL2wPZ2h3AhHJaydRFaDUfEYokSvGMfy+u3Nm9Rb94Bvim8SvNjBy0RERp udUIo1cstpU4omVeBqH8aJ1KtQE/xZZkZqZ6jsWbN3twaRIKH4i6MQl1UXqcugjvAyzt Blj2hL6FaNIH1kafpNZkNryHFHng9bjXL+mFchwqqgFbZEpfao2bw4TuFv4OCfMnseIN tRN+7Ej3buPq3uwt3WWM4SNNtjcW68+OpHzE7G+J32THEXwSrQA6QX9+Rl0bmxUrHfWE 429Q== 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:user-agent:message-id:date:subject:cc:to:from :dkim-signature; bh=JyOEyWPFUnnxVOL9xIsSh7srJ9jlIKdkUYbsyvYuIis=; b=QavScZTs5/UiAnQkYBbXsGt98WETBJEV1xc773SfEyOZ9epIDSJ9iUqryFu92YmBk1 SZfveM6t+oYHcaqP2uK9MLZOKUjAysY5i31ZHLfElR4L38n6NqgA7ivkPFYP9+aHE5gD 4/YQHHR51uzL8P7Pz3IGwjLz9oNYC9JV4qhOxBNR6CcwpHCSgahFgELyvatvA1qRcQPY hFxOWtMAT3/jEWvxac2daLw23tz2/xuRm7YyWbSEeCD1+MTAMtuknYgoN9y+Z6tjqkp/ e5r+aemgUlKzyI1u5lQbPjFGjeJ9WVqyCFEUxf/2JA14s4lGGtzkyKg5GxA8ZrFJ0Vjh OI0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=avxGsC00; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id nd5si23622131ejc.103.2021.12.05.21.44.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Dec 2021 21:44:41 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=avxGsC00; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 0F45483027; Mon, 6 Dec 2021 06:44: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=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="avxGsC00"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0517483027; Mon, 6 Dec 2021 06:44:38 +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-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) (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 4D4558083E for ; Mon, 6 Dec 2021 06:44:34 +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=masami.hiramatsu@linaro.org Received: by mail-pg1-x533.google.com with SMTP id r5so9398059pgi.6 for ; Sun, 05 Dec 2021 21:44:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=JyOEyWPFUnnxVOL9xIsSh7srJ9jlIKdkUYbsyvYuIis=; b=avxGsC00puA62qsmk7ntbvRXr0VagUZssHcxvd+z3dLV1Fbo+O7zR+eVzJqqwcrUBR WuHFxrGYS77FkZONtXH8LZwD+jo49xp5q8nXTdBLFAGruOTdl4qX7Z1hSaO4UfKRTWxE hWh0ugHYTqxzs0hkKl18YBqG/mu2wn+kMPA5lz6grijyACm0pWiaJ7xGw9J38PdqJDI9 1T3uqbiszbj45DwGGE5OYrSPdWFfiMoeKn7fC4ehvAYVrRTVgVHsjhfYT4nZPo6VKF0J TOEH4yKwGYFdSo9uVVNWt9pmrHEx1IX2QEGZk1vgitqJT4376y7jk50uH/aU9padGF3c cfhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=JyOEyWPFUnnxVOL9xIsSh7srJ9jlIKdkUYbsyvYuIis=; b=hxj1Fq3figYVO+6eWTIBYvVdu2tozBvM/vog7UTWhHYnq6+uJBy/mFqH2BtR3g2864 doT1vlhp+U//dVy3QvRGKyNJRdMbbWWEAlroRcOY7Hriwa128pjOSvMPOTCdzm51ioEh gc5tB2i62WTP6pabalTW+rMsCXLX/et2ytGbpOEQ4pKRkzK6gAz1iq5x7bg0HW6WPPO9 +i5v8n1BgoZrmHbqflUgIR9EG6czQ52VZzSegsbFcl1vZbqVtOz0Wsu6NG5LQEEZyV2T VZ/DoqOO89OFU/i8Qcg4HFyhxqDlX1q+1Zc4ZjUMIdZOTfs1G56+t5XKvae99SyGrAsp yFkg== X-Gm-Message-State: AOAM533Mx4vl+ijkXrK7k+KdZnaozizTwMq6LsQzzaZNw263ZZsK8YBD f3VLsOqD8N9i+ssW2tFOq1eZKw== X-Received: by 2002:a63:4e22:: with SMTP id c34mr17086274pgb.180.1638769472670; Sun, 05 Dec 2021 21:44:32 -0800 (PST) Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id g18sm3882960pfj.142.2021.12.05.21.44.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Dec 2021 21:44:32 -0800 (PST) From: Masami Hiramatsu To: Lukasz Majewski Cc: u-boot@lists.denx.de, ilias.apalodimas@linaro.org, sughosh.ganu@linaro.org, jaswinder.singh@linaro.org Subject: [PATCH 0/5] DFU: Update dfu_alt_info parser etc. Date: Mon, 6 Dec 2021 14:44:30 +0900 Message-Id: <163876946986.38238.10896882043017582609.stgit@localhost> X-Mailer: git-send-email 2.25.1 User-Agent: StGit/0.19 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 at phobos.denx.de X-Virus-Status: Clean Hi, This series is improving DFU subsystem. This improves dfu_alt_info parser and fixing documents etc. When I was debuging my patch for updating dfu_alt_info on the DeveloperBox platform, I found that dfu_alt_info parser doesn't accept redundant spaces and tabs. Also the dfu.rst description seems wrong. Moreover, there is no way to check whether the parser parses the dfu_alt_info correctly. These patches fixes such issues. [1/5] is just for avoiding buffer overrun, [2/5] and [3/5] improves dfu_alt_info parser to accept redundant spaces and tabs, and check the number of arguments strictly so that the parser (and user) can notice any unexpected parameters. [4/5] fixes the documents (there seems some wrong description maybe coming from copy&paste). [5/5] allows user to run 'dfu list' even if the platform doesn't support DFU_OVER_USB. Thank you, --- Masami Hiramatsu (5): DFU: Do not copy the entity name over the buffer size DFU: Accept redundant spaces and tabs in dfu_alt_info DFU: Check the number of arguments and argument string strictly doc: usage: DFU: Fix dfu_alt_info document cmd/dfu: Enable 'dfu list' command without DFU_OVER_USB cmd/dfu.c | 6 +++-- doc/usage/dfu.rst | 57 ++++++++++++++++++++++++++++++++++-------------- drivers/dfu/dfu.c | 37 ++++++++++++++++++++++++------- drivers/dfu/dfu_mmc.c | 55 +++++++++++++++++++++++++++------------------- drivers/dfu/dfu_mtd.c | 34 +++++++++++++++++++---------- drivers/dfu/dfu_nand.c | 34 ++++++++++++++++++----------- drivers/dfu/dfu_ram.c | 24 ++++++++++---------- drivers/dfu/dfu_sf.c | 34 ++++++++++++++++++----------- drivers/dfu/dfu_virt.c | 5 +++- include/dfu.h | 33 ++++++++++++++++++---------- 10 files changed, 205 insertions(+), 114 deletions(-) -- Masami Hiramatsu