Skip to content

Stack-object example#47

Merged
JuneRousseau merged 32 commits intomainfrom
stack-object-example
Jan 6, 2026
Merged

Stack-object example#47
JuneRousseau merged 32 commits intomainfrom
stack-object-example

Conversation

@JuneRousseau
Copy link
Collaborator

@JuneRousseau JuneRousseau commented Dec 18, 2025

This PR implements the stack object example from Monotone Cerise, adapted to the Griotte setup.

Among others, in addition to the original checks on the passed stack object, we also need to check that the passed SO does not overlap with our stack frame. In Monotone Cerise, this is guaranteed by the machine, because functions arguments are passed via the stack, and stack capabilities are Directed, meaning that they can't point upward.

@JuneRousseau JuneRousseau marked this pull request as draft December 18, 2025 13:30
@JuneRousseau
Copy link
Collaborator Author

JuneRousseau commented Dec 18, 2025

Checking that the passed argument is a capability with at least read permission is very annoying without an instruction for getting more precise permission. See https://github.com/logsem/cerise-stack-monotone/blob/master/theories/examples/macros/checkra.v .
I think we can do the reverse enumeration (all the permissions that are not R or more), but it's still 8 tests.

@JuneRousseau JuneRousseau marked this pull request as ready for review January 2, 2026 21:21
@JuneRousseau
Copy link
Collaborator Author

The existing specification of the switcher return is too strong for proving the stack object example:
the unknown revoked addresses that we need to use to fix the final world are not all revoked from the same world,
and proving therefore, proving the world fixing requires multiple worlds for the different revoked addresses.

Intuitively, it comes from the fact that the passed SO contains words that are safe-to-share as public transitions of the world from the state pre-adversary call.
An unsafe example would be to pass a local capability for which we want no-capture: in the presence of passed SO, the callee can captures local capabilities via the passed SO, making it impossible to revoke via the switcher.

So, to make it work, we need a generalisation of the switcher specification: see switcher_ret_specification_gen in 340e39d.

@JuneRousseau JuneRousseau merged commit 439986c into main Jan 6, 2026
1 check passed
@JuneRousseau JuneRousseau deleted the stack-object-example branch January 6, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant