all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Philipp Stephani <p.stephani2@gmail.com>,
	Noam Postavsky <npostavs@gmail.com>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: How much do we care about undefined behavior triggered by invalid bytecode?
Date: Thu, 24 May 2018 18:30:07 -0600	[thread overview]
Message-ID: <87h8mw1ss0.fsf@tromey.com> (raw)
In-Reply-To: <2f400c58-1214-d442-f3a9-30b5c7d73863@cs.ucla.edu> (Paul Eggert's message of "Tue, 22 May 2018 07:51:07 -0700")

>>>>> "Paul" == Paul Eggert <eggert@cs.ucla.edu> writes:

Paul> We could fix this problem by verifying that a series of bytecodes
Paul> cannot make Emacs crash, before allowing the bytecodes to be
Paul> executed. But wouldn't that be a reasonably large project?

FWIW on my more experiment JIT branch, I have a small bytecode verifier.
I needed it for the JIT, so it only does what I needed there, namely:

* Checking that the bytecode doesn't fall off the end
* Checking that the stack doesn't over- or underflow
* Checking that the stack depth at any given PC is a constant
* Checking that only valid opcodes are used
* Checking that the hash table given to Bswitch has only integer PC
  values and that they are in range

I don't know how hard it would be to extract this from the JIT.  Not too
bad maybe.

The other issue would be when to run it.  Maybe it would work to do it
the first time a bit of bytecode is executed.

Tom



  parent reply	other threads:[~2018-05-25  0:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22 13:31 How much do we care about undefined behavior triggered by invalid bytecode? Philipp Stephani
2018-05-22 13:42 ` Noam Postavsky
2018-05-22 14:01   ` Andreas Schwab
2018-05-23  3:28     ` Richard Stallman
2018-05-22 14:04   ` Philipp Stephani
2018-05-22 14:40     ` Noam Postavsky
2018-05-22 14:51       ` Paul Eggert
2018-05-22 15:37         ` Philipp Stephani
2018-05-25  0:30         ` Tom Tromey [this message]
2018-05-22 17:30       ` Philipp Stephani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h8mw1ss0.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=npostavs@gmail.com \
    --cc=p.stephani2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.