[Suit] Propose to add suit-uninstall in Multiple Trust Domains draft

Ken Takayama <11kenterada@gmail.com> Wed, 27 July 2022 13:27 UTC

Return-Path: <11kenterada@gmail.com>
X-Original-To: suit@ietfa.amsl.com
Delivered-To: suit@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6A578C1BED0C for <suit@ietfa.amsl.com>; Wed, 27 Jul 2022 06:27:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.103
X-Spam-Level:
X-Spam-Status: No, score=-2.103 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xGZm80m4JBa3 for <suit@ietfa.amsl.com>; Wed, 27 Jul 2022 06:27:55 -0700 (PDT)
Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D0104C1BED07 for <suit@ietf.org>; Wed, 27 Jul 2022 06:27:55 -0700 (PDT)
Received: by mail-pj1-x1036.google.com with SMTP id o14-20020a17090a4b4e00b001f2f2b61be5so2120975pjl.4 for <suit@ietf.org>; Wed, 27 Jul 2022 06:27:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=8a39Jf9D6pb6yNgpRHYOttMv5JjsJAWbnR+2WK159qo=; b=g9z6YVtuK/1oKP7lVMiZqXWUgJT4MgfD7G4rih/YHBV59JeqsG7Z89wSiHp4A3wthF 1fDjN1AFCCsgehDC3AWJ/BbEjaLo0o5ruQV3eGws+bCpyIu18M5trzhWvxRts/qXatcy 9egGxRZmcC0Qz7q+mV4wqNGsGpOBZVs88RXBwuUbbxX03cy0K+4R4CgbJDsSf2ltNHwp KbXeV2UsCKOijyNgZoJ0T8o2IHPCjhwV9EbPxFlBipyjNavqk2CL1+OE2wdw9sby7T9O TE0ZyLeJd6CBBbyWLOQIN52+G+0mrQ/+gzkev63R1CXidfOCbWaZodFgP1jEIQBCCgRL R7Ng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=8a39Jf9D6pb6yNgpRHYOttMv5JjsJAWbnR+2WK159qo=; b=MVQ5HuX+inThQBsCC7IB6m7OOILS1vzQMmoUI4354uonSfnBGIZv2l8FleLNCQnaNy VrvXSmI1X6oAz0dBJ3J3cBELpPoZiQzf7a3OK40Oj3wabjASm+MTZlRG5+fz0hd7Ns6i Uv3lB1sIuOgIIEtWlzv4YsGLaQqby/XLyAfPG08wrI4Nta4ftiXSZ5Nt77n0fiEvUOY9 MYsBQKKadYPLz5uHxFCMp+HaQN33F8V8BXqvkN6Lm29DElr1iACRIVs5lePkXX2JuEBJ 9eTQEZdeRO4qQfGJAzvLqMgM/gMpenM834GfeDVfSK9QdhCBxaQ4MIcPQX9CvUlzELWV TvNw==
X-Gm-Message-State: AJIora/DIn0uGvsH0Bi8K5wfD6ZPHxd7LVNNNRTl+Mz1wC64qRykCDAQ Brb1Hv8RSzHeWBdW4U1eOFN0s3hOG/BhZDgudd1MxYGpD4atHpuZ
X-Google-Smtp-Source: AGRyM1uEce09ns9yJwZt21mlTp2berqkBlnGEnQjdFx6Bkx7dcsqkFXpLbge//cFrDX6nZ9afyVQfwBmlkk/MqtfPdM=
X-Received: by 2002:a17:903:2d0:b0:16d:297d:af09 with SMTP id s16-20020a17090302d000b0016d297daf09mr21662457plk.85.1658928474809; Wed, 27 Jul 2022 06:27:54 -0700 (PDT)
MIME-Version: 1.0
From: Ken Takayama <11kenterada@gmail.com>
Date: Wed, 27 Jul 2022 09:27:44 -0400
Message-ID: <CAMGQZH7PK_m71fV7E6bTS0ELqChx_G3GVJ2GZYLWWuv3MjbZjQ@mail.gmail.com>
To: suit@ietf.org
Content-Type: multipart/alternative; boundary="00000000000072eab905e4c962e7"
Archived-At: <https://mailarchive.ietf.org/arch/msg/suit/nNXlX6OXYdPVe9h7_N1AdlIi1ls>
Subject: [Suit] Propose to add suit-uninstall in Multiple Trust Domains draft
X-BeenThere: suit@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Software Updates for Internet of Things <suit.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/suit>, <mailto:suit-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/suit/>
List-Post: <mailto:suit@ietf.org>
List-Help: <mailto:suit-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/suit>, <mailto:suit-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jul 2022 13:27:56 -0000

Dear SUIT WG,

I'm Ken Takayama an implementer of SUIT and TEEP parser and encoder.
Before WG Last Call, I want to make some comments to
draft-ietf-suit-trust-domains.

- I could encode depending manifest using dependency
  + which is now explained in [teep-protocol v09](
https://datatracker.ietf.org/doc/html/draft-ietf-teep-protocol-09#section-4.4.3)
and
  + the binary is in the Appendix E example 3, thank you Brendan for your
comments in the past IETF meeting
- I could write its parser resolving dependency
  + the functions are enough when installing depending manifests
- The suit-dependency-resolution value needs to be updated
  + see [Issue #70](https://github.com/suit-wg/manifest-spec/issues/70) in
detail
- I propose adding suit-uninstall to the draft (see below)


# Proposal
Add suit-uninstall to the Multiple Trust Domains document
because it is useful functionality when updating depending components in
some situations.
When updating a dependent component the SUIT Manifest parser decrements
the reference counter of dependee's manifest (such as library) in the old
versoin.
If a component is not required anymore, the SUIT Manifest parser MAY
uninstall it
by executing commands listed in suit-uninstall.


## Example situation: Updating an application
Currently Installed
  + component ["application"] version 0
    * depends component ["library-a"] version 0
  + component ["library-a"] version 0

  |
  v

To be Updated
  + component ["application"] version 1
    * depends component ["library-b"] version 0
  + component ["library-b"] version 0


## Issue
The library-a is no more required and should be uninstalled,
but how to uninstall it when updating the application?

This problem is complicated at some points.
- There might be no uninstall (or unlink) manifest of library-a
  + because the library-a developer does not want to uninstall it,
    just the application does not require it anymore
- The library-b manifest may not know how to uninstall library-a
  + when library-a and library-b are created by other parties
- The application manifest version 1 may unlink the library-a
  + but the library-a manifest would remain in the device
  + the library-a would be doubly unlinked when the library-a developer
creates uninstall manifest


## Detailed proposal
The library-a manifest stores how to uninstall the component itself.
When updating the application, the SUIT Manifest parser decrements
reference counters of ["application"] version 0 and ["library-a"] version 0
respectively.
The counters becomes 0 and the SUIT Manifest parser MAY uninstall
the library-a by executing commands listed in suit-uninstall and
delete its manifest finally.


Best,
Ken