All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Ilja Van Sprundel <ivansprundel@ioactive.com>,
	George Dunlap <George.Dunlap@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [Xen-devel] [PATCH] console: avoid buffer overflow in guest_console_write()
Date: Fri, 29 Nov 2019 11:59:30 +0000	[thread overview]
Message-ID: <24033.2082.127306.518557@mariner.uk.xensource.com> (raw)
In-Reply-To: <5766dd2b-2aa7-bafe-56ad-3ea33ddf4591@suse.com>

Jan Beulich writes ("[PATCH] console: avoid buffer overflow in guest_console_write()"):
> The switch of guest_console_write()'s second parameter from plain to
> unsigned int has caused the function's main loop header to no longer
> guard the min_t() use within the function against effectively negative
> values, due to the casts hidden inside the macro. Replace by a plain
> min(), converting one of the arguments suitably without involving any
> cast.
> 
> Fixes: ea601ec9995b ("xen/console: Rework HYPERCALL_console_io interface")
> Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

ea601ec9995b included this hunk:

       case CONSOLEIO_read:
  +        /*
  +         * The return value is either the number of characters read or
  +         * a negative value in case of error. So we need to prevent
  +         * overlap between the two sets.
  +         */
  +        rc = -E2BIG;
  +        if ( count > INT_MAX )
  +            break;

Maybe it would be good to move that outside the switch so that it
affects CONSOLEIO_write too ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-11-29 11:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-29 10:13 [Xen-devel] [PATCH] console: avoid buffer overflow in guest_console_write() Jan Beulich
2019-11-29 10:22 ` Andrew Cooper
2019-11-29 10:27   ` Jan Beulich
2019-11-29 12:01     ` Ian Jackson
2019-11-29 12:04       ` Andrew Cooper
2019-11-29 12:13       ` Jan Beulich
2019-11-29 12:15         ` Andrew Cooper
2019-11-29 12:19           ` Jan Beulich
2019-11-29 12:37             ` Andrew Cooper
2019-11-29 13:26               ` Jan Beulich
2019-11-29 13:37                 ` Jürgen Groß
2019-11-29 13:55                   ` Jan Beulich
2019-11-29 13:57                     ` Andrew Cooper
2019-11-29 13:57                     ` Jürgen Groß
2019-11-29 10:39 ` Julien Grall
2019-11-29 11:59 ` Ian Jackson [this message]
2019-11-29 12:15   ` Jan Beulich
2019-11-29 12:17     ` Andrew Cooper
2019-11-29 12:02 ` Jürgen Groß
2019-11-29 14:35 ` [Xen-devel] [PATCH XTF] CONSOLEIO_write stack overflow PoC Andrew Cooper
2019-11-29 14:43   ` Jan Beulich
2019-11-29 14:45     ` Jan Beulich
2019-11-29 14:50       ` 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=24033.2082.127306.518557@mariner.uk.xensource.com \
    --to=ian.jackson@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=George.Dunlap@citrix.com \
    --cc=ivansprundel@ioactive.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --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 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.