xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 3/4] x86emul: drop pointless and add useful default cases
Date: Thu, 23 Jun 2016 11:44:47 +0100	[thread overview]
Message-ID: <7ea1b9fa-9e42-002e-d970-b27bd459ed16@citrix.com> (raw)
In-Reply-To: <5767F68A02000078000F6AD1@prv-mh.provo.novell.com>

On 20/06/16 12:58, Jan Beulich wrote:
> @@ -3845,10 +3834,11 @@ x86_emulate(
>              goto push;
>          case 7:
>              generate_exception_if(1, EXC_UD, -1);
> -        default:
> -            goto cannot_emulate;
>          }
>          break;
> +
> +    default:
> +        BUG();

These introduce DoS vulnerabilities if there is indeed a path to default.

Could I recommend instead a one-time printk() dumping the instruction
stream which lead to here, an ASSERT_UNREACHABLE(), and a goto
cannot_emulate?

That way, a production build won't crash.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-06-23 10:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 11:44 [PATCH 0/4] x86: instruction emulator adjustments Jan Beulich
2016-06-20 11:57 ` [PATCH RESEND 1/4] x86emul: support MOVBE and CRC32 Jan Beulich
2016-06-23 10:27   ` Andrew Cooper
2016-06-20 11:58 ` [PATCH 2/4] x86emul: use (locally) consistent exit mechanisms Jan Beulich
2016-06-23 10:36   ` Andrew Cooper
2016-06-23 12:27     ` Jan Beulich
2016-06-20 11:58 ` [PATCH 3/4] x86emul: drop pointless and add useful default cases Jan Beulich
2016-06-23 10:44   ` Andrew Cooper [this message]
2016-06-23 12:28     ` Jan Beulich
2016-06-20 11:59 ` [PATCH 4/4] x86emul: fold local variables Jan Beulich
2016-06-23 10:31   ` Andrew Cooper

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=7ea1b9fa-9e42-002e-d970-b27bd459ed16@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).