uc20 model does not verify modes: snap consistencies

Bug #1883970 reported by Ian Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Fix Released
High
Samuele Pedroni

Bug Description

if I have a model.json snaps header like this:

    "snaps": [
        {
            "name": "pc",
            "type": "gadget",
            "default-channel": "20/edge",
            "id": "UqFziVZDHLSyO3TqSWgNBoAdHbLI4dAH"
        },
        {
            "name": "pc-kernel",
            "type": "kernel",
            "default-channel": "20/edge",
            "id": "pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza"
        },
        {
            "name": "snapd",
            "type": "snapd",
            "default-channel": "latest/edge",
            "id": "PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4"
        },
        {
            "name": "core20",
            "type": "base",
            "default-channel": "latest/edge",
            "id": "DLqre5XGLbDqg9jPtiAhRRjDuPVa5X1q"
        },
        {
            "name": "core",
            "type": "core",
            "default-channel": "latest/edge",
            "id": "99T7MUlRhtI3U0QFgl5mXXESAiSwt776",
            "modes": [
                "run"
            ]
        },
        {
            "name": "http",
            "type": "app",
            "default-channel": "latest/edge",
            "id": "TJEfggNhgEJ4XKJ8o7ahsvRklz5kRK5w",
            "modes": [
                "run",
                "recover"
            ]
        }
    ]

when I go into recovery mode, it will fail to seed because for the http snap in recovery mode, I also need the core snap (the base of http) to be included in recovery mode, but signing this model is perfectly valid. We should add additional verification to the model for the various mode combinations.

Tags: uc20
tags: added: uc20
Changed in snapd:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Samuele Pedroni (pedronis)
Changed in snapd:
importance: High → Medium
importance: Medium → High
status: Triaged → In Progress
Revision history for this message
Samuele Pedroni (pedronis) wrote :

we cannot check this at model signing them, in general we don't know what the snaps bases are etc without consulting the store.

We can check at image built time though, I opened a PR about that:

https://github.com/snapcore/snapd/pull/9710

Changed in snapd:
status: In Progress → Fix Committed
Revision history for this message
Samuele Pedroni (pedronis) wrote :

This will be fixed in 2.49

Changed in snapd:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.