From patchwork Tue Dec 14 13:22:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1567729 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=gZEvuIoq; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JCzZY0Vp4z9s5P for ; Wed, 15 Dec 2021 00:22:45 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7FA4C8203C; Tue, 14 Dec 2021 14:22:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.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=kernel.org header.i=@kernel.org header.b="gZEvuIoq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6133A811BB; Tue, 14 Dec 2021 14:22:32 +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.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A5129801EB for ; Tue, 14 Dec 2021 14:22:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 52189B819A4; Tue, 14 Dec 2021 13:22:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2061BC34601; Tue, 14 Dec 2021 13:22:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639488147; bh=8jMPcmBScwREXqtmNdsAF4xygT/gAwCCJ2wwbh96gYE=; h=From:To:Cc:Subject:Date:From; b=gZEvuIoqdM0gImZFTJgwriub8ZIavfFMn777PptzYZj7we2Gru2Eljt2634xvpwIz WLcny6MADLnLGoi2zrfAGw8YZt0oxtXqFC5WGNRKcoQR1chsFzCR3DqzsN5nnQPeI/ iCIpMK5aQ/gA/nJhtOkepL/zrf2tCgYHzHQljcBNjn2Mgd6Y6E3uZ75Wvf7Ssz6uae ZNyBRm8Bm7cE/iMoEJuACafClgzYpkvDhUfaqVKWWjSGGCkEwz+3IrHVF8ul7sEs2r crhjAEMtXitxPlsR+rrYRlVw8cW8bg3c8vvyQkxhr8jCX2vBKz/l0Fy6vx8wOV0SB5 n+VRjDX7UZNBw== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: u-boot@lists.denx.de, =?utf-8?q?Pali_Roh=C3=A1r?= , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell v3 0/9] More verifications for kwbimage in SPL Date: Tue, 14 Dec 2021 14:22:13 +0100 Message-Id: <20211214132222.21324-1-kabel@kernel.org> X-Mailer: git-send-email 2.32.0 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 From: Marek Behún Hello Stefan, this is v3 of series that adds more checks for kwbimage validity and consistency to SPL, mainly checking image data checksum. Changes since v2: - changed the error message in patch 6 according to Pali's suggestion - added R-B tags Changes since v1: - updated error messages as requested by Stefan - fixed checkpatch warnings for uintN_t types (converted to preferred uN) - added more checkpatch fixes Marek Marek Behún (4): arm: mvebu: spl: Print srcaddr in error message arm: mvebu: spl: Use preferred types u8/u16/u32 instead of uintN_t arm: mvebu: spl: Use IS_ENABLED() instead of #ifdef where possible arm: mvebu: spl: Fix 100 column exceeds Pali Rohár (5): arm: mvebu: Check that kwbimage offset and blocksize are valid SPL: Add struct spl_boot_device parameter into spl_parse_board_header() arm: mvebu: Check that kwbimage blockid matches boot mode SPL: Add support for checking board / BootROM specific image types arm: mvebu: Check for kwbimage data checksum arch/arm/mach-mvebu/spl.c | 153 +++++++++++++++++++--------- arch/arm/mach-sunxi/spl_spi_sunxi.c | 2 +- common/spl/spl.c | 13 ++- common/spl/spl_ext.c | 9 +- common/spl/spl_fat.c | 11 +- common/spl/spl_legacy.c | 3 +- common/spl/spl_mmc.c | 43 +++++--- common/spl/spl_nand.c | 5 +- common/spl/spl_net.c | 2 +- common/spl/spl_nor.c | 4 +- common/spl/spl_onenand.c | 2 +- common/spl/spl_ram.c | 2 +- common/spl/spl_sata.c | 9 +- common/spl/spl_sdp.c | 2 +- common/spl/spl_spi.c | 9 +- common/spl/spl_ubi.c | 4 +- common/spl/spl_usb.c | 4 +- common/spl/spl_xip.c | 4 +- common/spl/spl_ymodem.c | 4 +- drivers/usb/gadget/f_sdp.c | 12 ++- include/sdp.h | 3 +- include/spl.h | 7 ++ 22 files changed, 201 insertions(+), 106 deletions(-)