Re: [Suit] Introducing draft-moran-suit-manifest-04

Martin Pagel <> Fri, 15 March 2019 23:24 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id B1BAC131095 for <>; Fri, 15 Mar 2019 16:24:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.001
X-Spam-Status: No, score=-2.001 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id bMusNj3JGTx6 for <>; Fri, 15 Mar 2019 16:24:22 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 2531512787D for <>; Fri, 15 Mar 2019 16:24:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5M1D5GWNN8MNlORyI/MLYr4r1qr0Om6vRnnEZGjt8Gk=; b=PQGA1M+VWAlN62YDm0mLVtcnNFoyYz2gcuWLjdDlTI/GtBvRTnsKKegjX6yUJftVFTwjgdftfrowMt21BZQDIp8Y/7kpKiorAqtuCFiBB63NflCmTXJUie3+MxOnn4cvkw5g1Li0cCaWJE3efFs6inkSqzED8Ml3X/mYC3oIi8k=
Received: from ( by ( with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.0; Fri, 15 Mar 2019 23:24:19 +0000
Received: from ([fe80::a89a:5b8a:e27c:ec15]) by ([fe80::a89a:5b8a:e27c:ec15%7]) with mapi id 15.20.1730.000; Fri, 15 Mar 2019 23:24:19 +0000
From: Martin Pagel <>
To: David Brown <>, Brendan Moran <>
CC: "" <>
Thread-Topic: [Suit] Introducing draft-moran-suit-manifest-04
Thread-Index: AQHU2L81dzELNCQKcEaCHfQ8cPehA6YM6E0AgABx0iA=
Date: Fri, 15 Mar 2019 23:24:19 +0000
Message-ID: <>
References: <> <>
In-Reply-To: <>
Accept-Language: en-US
Content-Language: en-US
msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2019-03-15T23:24:18.3751278Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=e6677e54-59fe-4c64-9cb8-227a37a8ebbf; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic
x-originating-ip: []
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 62a2bba2-2632-4353-2de2-08d6a99d5981
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:BYAPR21MB1350;
x-ms-traffictypediagnostic: BYAPR21MB1350:
x-ms-exchange-purlcount: 2
x-microsoft-antispam-prvs: <>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-forefront-prvs: 09778E995A
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(396003)(346002)(136003)(366004)(39860400002)(199004)(13464003)(189003)(186003)(76176011)(53936002)(2906002)(478600001)(25786009)(26005)(110136005)(53546011)(6506007)(6116002)(6246003)(3846002)(66066001)(256004)(966005)(102836004)(81166006)(22452003)(81156014)(316002)(6346003)(106356001)(97736004)(8676002)(99286004)(14444005)(105586002)(10290500003)(4326008)(6436002)(9686003)(6306002)(14454004)(229853002)(55016002)(7696005)(7736002)(72206003)(305945005)(446003)(86362001)(11346002)(74316002)(8936002)(86612001)(5660300002)(476003)(71190400001)(52536014)(68736007)(10090500001)(8990500004)(71200400001)(486006)(33656002); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR21MB1350;; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None ( does not designate permitted sender hosts)
authentication-results: spf=none (sender IP is );
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: yq+fFpbpqdchf0RfmbU58klu7KR7fa7Y7+ACZ49fR1PFV3+Zg8Qyw8aIfGd6jb+UP75xQXPpI8qT6NbR5LxsOdIsMIC8gcMBZTQt+nZT0j2vaxaWqM++6rJN3xRvWJDVGMergrzP8sVJH/Xro2oX7Fu5i4dFsxYeQf0fOI89Sfsgr3Uhhdhthbu3eouUL7z8jZZ+ygx97R53kXqmV79R0lcW6L2X5bS7niLk/NTwgXSSOeq5k8HtTKh6xjHNluDhCqKrQSCV5QiqMz1H0WsggxaihU7/vIOmOVaVHpmqiH9jEdz5CVwoj9sHTQqTxcor7wCF+bsSiGDd7VyiNTsSUFknJRARmEbvjWQcbc+IoseWcO00qLw3T/wnLHYzLTFZBCHECQO2TgeDzXf5zwgy3XC7VGObmh4J9rtbwVj5MH8=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 62a2bba2-2632-4353-2de2-08d6a99d5981
X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Mar 2019 23:24:19.4747 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR21MB1350
Archived-At: <>
Subject: Re: [Suit] Introducing draft-moran-suit-manifest-04
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Software Updates for Internet of Things <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 15 Mar 2019 23:24:25 -0000

I don't think that copying to RAM is mandatory or even recommended.
Example 1 should be all you need.

-----Original Message-----
From: Suit <> On Behalf Of David Brown
Sent: Friday, March 15, 2019 9:34 AM
To: Brendan Moran <>
Subject: Re: [Suit] Introducing draft-moran-suit-manifest-04

On Tue, Mar 12, 2019 at 10:34:44AM +0000, Brendan Moran wrote:
>draft-moran-suit-manifest-04 has now been published.

One point I wanted to bring up on-list was that this draft seems to have a bit of a bias toward devices that execute programs by copying them from flash to RAM and executing them out of RAM.

Given the class of devices that we are targeting, I would suggest that this is actually fairly uncommon, and most of these types of devices will generally be set up to execute directly out of flash, so called XIP or eXecute In Place.  For these kinds of devices, the directives in the draft are a little bit of a mismatch with how upgrades happen on these kinds of devices.

To clarify, I will explain how upgrades currently work for devices targeted by MCUboot (and by extension TF-M):

  - The flash is divided into a series of slots.  For a device with a
    single process and image, it will be something like:

    | bootloader |
    | Primary    |
    | Secondary  |
    | Scratch    |
    | Storage    |

    For a multi-CPU/image device, there will be a pair of primary and
    secondary slots.  To simplify, I will make this example just for a
    single-image device.

  - For normal execution, the bootloader validates the image in the
    "primary" slot, and if it is valid, jumps directly to its start
    address within flash.

  - The download part of an upgrade happens while the application is
    running, and this code is contained within the code currently
    running in the primary image.  It downloads the upgrade into the
    "secondary" slot.  This new code cannot execute at this address,
    but is placed here as the image is downloaded.  The assumption is
    that their isn't sufficient RAM to hold the entire image, and that
    a download may be interrupted.

  - Once the application has finished downloading the new image, it
    writes a special marker to the end of the "secondary" slot and
    causes a reboot.

  - The bootloader detects this upgrade request in the secondary slot
    and begins a series of steps:

    - Verify the image in the secondary slot.

    - Using the scratch area exchange the images in the primary and
      secondary slot

    - Verify the new primary slot.

    - Jump to the new primary image

    This is designed in such a way that it can resume after any
    untimely interruption.

  - If the new image boots successfully, it writes a marker at the end
    of the "primary" slot to indicate that the image is correct.
    Otherwise, if the bootloader boots without seeing this marker, it
    will exchange the primary and secondary images again to undo the

Within either the primary or secondary slot, the image has a format similar to:

    | Header     |
    | Executable |
    | Manifest   |

there is no real separate place to store the manifest.  This does mean that during an upgrade the manifest for both the old and the new image are present in flash.

I'm curious what thoughts people have on how to apply the draft 4 manifest to the above scenario.  Operations such as "load" aren't really meaningful, but apply-image would certainly make sense.
However, the installation of a new image is partially initiated by a different piece of code than the bootloader which is responsible for actually installing the image.  This state has to be managed carefully in a way that works with NOR flash, and therefore will probably live outside of the manifest.


Suit mailing list;;sdata=271MhUpRnQbktJs5CgZfjLBYPbVkMXnPE80wSZL%2BrDY%3D&amp;reserved=0