coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: "jonikelee AT gmail.com" <jonikelee AT gmail.com>
- To: Timothy Carstens <intoverflow AT gmail.com>
- Cc: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Safe to download and compile .v from evil source ?
- Date: Sun, 2 Feb 2020 00:07:45 -0500
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jonikelee AT gmail.com; spf=Pass smtp.mailfrom=jonikelee AT gmail.com; spf=None smtp.helo=postmaster AT mail-qk1-f182.google.com
- Ironport-phdr: 9a23:qIu5Dh2sJk6G4qs6smDT+DRfVm0co7zxezQtwd8ZseIQI/ad9pjvdHbS+e9qxAeQG9mCt7QY0KGJ4+igATVGvc/a9ihaMdRlbFwssY0uhQsuAcqIWwXQDcXBSGgEJvlET0Jv5HqhMEJYS47UblzWpWCuv3ZJQk2sfQV6Kf7oFYHMks+5y/69+4HJYwVPmTGxfa5+IA+5oAnMucQam4RvJ6g+xhbLoXZDZuBayX91KV6JkBvw+8m98IR//yhMvv4q6tJNX7j9c6kkV7JTES4oM3oy5M3ltBnDSRWA634BWWgIkRRGHhbI4gjiUpj+riX1uOx92DKHPcLtVrA7RS6i76ZwRxD2jioMKiM0/3vWisx0i6JbvQ6hqhliyIPafI2ZKPxzdb7bcNgHR2ROQ9xRWjRPDI28cYUBEukPMuRWr4f6qFQBsRSwCBKwBO7t0DJEmmX70bEk3+knDArI3BYgH9ULsHnMotn1NqASUea0zKnL0zrDa+1Z1inm5YjHdxAuu/CMXbZqfcXNzkkvEg3JhUiXpIznODOV0OUNs2uF4OpkS+2glXUqqw50oje1x8csjpPFiZ4SylDB7Ch0xps+K96gSENjf9KoDJ9duzuZOoZ2WM8uXX9ktDggxrEbupO3YjAGxIomyhLDdvCKdpWE7xb/W+uULjp1hW5pdK66ihqv8kWtyOjxWdSp31tIoCdIl9vBu3EX2BHR78WIUPtw80Wh1DuK1A3f9/tLLEIymKHGMZAu2KQwmYAWsUnbHi/5hkH2jKiOe0Uh4Oeo6uDnbqz/pp+fKoN4kw/+Prktl8ChG+g4PQ8OX2+U+eS4yrLv51H2QLJPjvEuk6nZto7VJdgDq6KnHwNY1pwv5hW/Aju8ztgUg2cLIEhYdB+EkYTlI1TOL+r5Dfe7jVSsijBrx/XeM73jBZXNKHnDkLT/crZ59UFT1hE+zd9a551OC7EBJOj/VVP2tNzdFhM5KRC7w/77CNVh0YMTQX6AAqiAMK/LrVCI4v8vLPKXaY8OuDf9LuAl6OT0gX84n18dZ6ip0oENZHC2BPQ1a3meNEbth9AdEXZClQMkV/DnjkbKBT9Ve3GsUrgy4jYkII2jBIbHAIuqherS8j28G8gcZGdAC1OBFXrlX4qBUvYILimVJ4Upxj4DU7miRoss2DmhsQb7z/xsKe+CqX5Qjo7qyNUgv76brho17zEhV53MgVHIdHl9myYzfxFz2al+pUJnzVLaiPp3hvVZEZpY4PYbC15nZ66Z9PRzDpXJYiyEftqNTwz4ENCvADV0V9FohtFXMxw7FNKlgRTOmSGtBu1NzuDZNNkP6qvZmkPJCYNl0X+fjfsuilAnRo1EMmj03qM=
Ok I think I understand now.
I think Jason's suggestion of coqchk is as close as Coq provides to
that, but maybe the following idea would be closer. I once used an
antequated proof system (pvs) that had a tactic language but also had
the ability to "macro-expand" the tactics into atomic proof steps and
record the resulting fully expanded proofs in a file. Having that
eliminates the need to run the tactic language later to verify the
proof, and thus the possibility that someone can exploit the tactic
language.
Ideally, or as close to it as one could hope, one would have the
ability to "macro-expand" Coq proofs into something that contains no
Ltac or vernacular (and is probably very large as a result), and is
completely checkable by the Coq kernel alone, which has been closely
scrutinized to be clean of exploitable behavior. It wouldn't even read
in other files - every such fully-expanded proof would be self
contained - so that the Coq kernel could run so as to say
Yeah or Nay without any other IO.
On Sat, 1 Feb 2020 20:30:36 -0800
Timothy Carstens
<intoverflow AT gmail.com>
wrote:
> Sorry for my part in any confusion <3
>
> Consider the following workflow:
> 1. User goes to website and downloads .tgz
> 2. User extracts .tgz, finds a bunch of .v files
> 3. README.md says "The safety guarantee is expressed in foo.v"
> 4. Independent expert in computer science reads foo.v, reads
> basic_definitions.v, and says "yep: the safety guarantee means what
> you think it means. if it typechecks, then you're good to go."
> 5. User runs coqc foo.v
>
> My question was: is this safe for the user to do, or is it possible
> that coqc foo.v might hack their computer?
>
> The interesting question is whether Coq intentionally has features
> that can facilitate this: things like the ability to run shell
> commands, write to files at arbitrary paths, explore the file system
> in any way, open sockets, run arbitrary ocaml, etc.
>
> [ Ignore memory safety for a moment; I'll assume no one knows if coqc
> is memory safe for the same reasons no one knows if any program is
> memory safe (no formal methods - yet!) ]
>
> If so, then (5) is inherently an unsafe thing to do, and in that case
> I don't see how Coq could be used to certify untrusted code. You'd
> need to first do a code review of the ltac and everything else to
> convince yourself that it was safe to compile. IMHO this should
> change in the future, simply on the appeal of the use case described
> above. One of Coq's best application domains is the verification of
> real world computing artifacts, after all.
>
>
> Again, I don't want people to think I'm raising giant alarm bells
> here - Coq is undergoing a lot of changes right now as a platform,
> and I respect the autonomy of the Coq maintainers to decide what
> problems to tackle and in what order. In my opinion they have shown
> excellent judgement thus far and I do not seek to interfere in their
> plans.
>
>
> On Sat, Feb 1, 2020 at 7:48 PM
> jonikelee AT gmail.com
> <jonikelee AT gmail.com>
> wrote:
>
> > There's some confusion here, perhaps all mine, about the distinction
> > between Coq as a system for verifying code (which it can do) vs. Coq
> > and the environment it runs in as a verified system (which it
> > isn't). It seems to me that these questions have been mixing those
> > two very different concepts.
> >
> > Coq, merely by virtue of it being a system for verifying code, does
> > not enhance trust of itself and the environment it is run in being
> > safe to use to check that some other code can be verified. One
> > level of trust does not eliminate the need for trusting the other
> > level.
> >
> > If you run Coq in a way such that something malicious can substitute
> > 'echo "Qed!"' for your Coq prover without you knowing it is
> > doing so, then there is nothing Coq nor its developers can do to
> > save you. Yet I am sure this must be obvious to all, so it must be
> > me that is still confused about your questions.
> >
> >
> >
> > On Sun, 2 Feb 2020 15:50:27 +1300
> > Marco Servetto
> > <marco.servetto AT gmail.com>
> > wrote:
> >
> > > > Also: "put it in a container" doesn't address the other use
> > > > case I mentioned above: namely, telling people that they can
> > > > use Coq to certify the safety/correctness of untrusted code.
> > >
> > > To make this more explicit:
> > > if there was an online service that gives you "proven correct and
> > > safe code1" and the corresponding coq proof code2; would running
> > > such proof be a valid certification that such code1 is
> > > correct and safe? or, is it possible that during the execution of
> > > code2 arbitrary behavior makes a "yes" result even if the proof in
> > > itself if bogus?
> > > Note how running coq in a container or not does not really change
> > > the issue here.
> >
> >
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, (continued)
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Clément Pit-Claudel, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Timothy Carstens, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, jonikelee AT gmail.com, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Timothy Carstens, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Marco Servetto, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Jason Gross, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Timothy Carstens, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, jonikelee AT gmail.com, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Timothy Carstens, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Jason Gross, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, jonikelee AT gmail.com, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Adam Chlipala, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Théo Zimmermann, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Emilio Jesús Gallego Arias, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Adam Chlipala, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Emilio Jesús Gallego Arias, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Timothy Carstens, 02/03/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Emilio Jesús Gallego Arias, 02/03/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, jonikelee AT gmail.com, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Timothy Carstens, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Clément Pit-Claudel, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Timothy Carstens, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, jonikelee AT gmail.com, 02/02/2020
- Re: [Coq-Club] Safe to download and compile .v from evil source ?, Adam Chlipala, 02/02/2020
Archive powered by MHonArc 2.6.18.