[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v2 2/4] xen/console: Rework HYPERCALL_console_io interface
- To: Julien Grall <julien.grall@xxxxxxx>
- From: Jan Beulich <JBeulich@xxxxxxxx>
- Date: Thu, 8 Aug 2019 13:57:19 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9QtXvvIgs6BhBNAMIA2c01UDV8X6l4dnVkAv3f38jtU=; b=YnXsFV2d1IQKSYTk3OpL4pSPYAIEZTAW+WHFtFJV7TXcr5qgKnImgVeZ8lFIslFg5RpFtsLgbapTPE5gv2vm6gOlXHVBenpE2MEMq8wZZ43oUmVyvcO9hJ6QtheHqVJBn4bVPXxq2SuBmW/0E6CjwRfnGTxI1BQkfbzPxmL91ms9R4u/ca3s0Xn015Znxqgo5eYWkXMHdVfwU14gdQVhnJ11HQNczcPIZ3jeEhmiEnKsSXRkdh35IaJNem/ju7j4bnUGmasd89qGKB+cl/D/6czdzTFPkhcjHImGFPVEHEzJ7nqP/9Gr5iTotZ4On7EEX6usnPwf62UlKspnpFDVNA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GzHZ/94r5KMHQ3PjPUjT1g5rWZJnNDcaJxa+I7gaNAcVCjd4/3pPsiBRfb64E/pH3zxcauxNMZB/6JcoYmuQTZ0SsfpCswoU9WBSxNvXE9uQ7292YWqZK1Jv6QesYhdGWfuajprwE33dF+mxPhMolpE5jpBi4s2Skcqx0Ttqc6X+5pSmK/QoejJXuv6DA6E/YOLns3c7fVjyC4/pB6w89IhgEFZipABC1pWz8lvt8aVZLIqJrlowueTsP2j1M9/q9eUDLBdwlsIspMBZzSD3uEGC0eAZwnzoLSFsXUyhC3NeRTV1cx5n8pZ8CZs80STh3wXK9zM6U3OnYP6xMDB1lw==
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Thu, 08 Aug 2019 13:59:32 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHVS5H5pzxcqbmNhkST9HIKVDZInabxSzqA
- Thread-topic: [PATCH v2 2/4] xen/console: Rework HYPERCALL_console_io interface
On 05.08.2019 15:29, Julien Grall wrote:
> @@ -627,6 +629,15 @@ long do_console_io(int cmd, int count,
> XEN_GUEST_HANDLE_PARAM(char) buffer)
> rc = guest_console_write(buffer, count);
> break;
> 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 ( (int)count < 0 )
> + break;
A more portable (afaict) approach would be to check against INT_MAX.
Either way
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|