Re: [PATCH] ui/cursor: fix integer overflow in cursor_alloc (CVE-2022-4206)

2022-04-05 Thread Gerd Hoffmann
On Tue, Apr 05, 2022 at 04:47:18PM +0200, Mauro Matteo Cascella wrote: > On Tue, Apr 5, 2022 at 1:10 PM Gerd Hoffmann wrote: > > > > > > +++ b/ui/cursor.c > > > > @@ -46,6 +46,13 @@ static QEMUCursor *cursor_parse_xpm(const char > > > > *xpm[]) > > > > > > > > /* parse pixel data */ > > > >

Re: [PATCH] ui/cursor: fix integer overflow in cursor_alloc (CVE-2022-4206)

2022-04-05 Thread Mauro Matteo Cascella
On Tue, Apr 5, 2022 at 1:10 PM Gerd Hoffmann wrote: > > > > +++ b/ui/cursor.c > > > @@ -46,6 +46,13 @@ static QEMUCursor *cursor_parse_xpm(const char *xpm[]) > > > > > > /* parse pixel data */ > > > c = cursor_alloc(width, height); > > > + > > > +if (!c) { > > > +fprintf(stde

Re: [PATCH] ui/cursor: fix integer overflow in cursor_alloc (CVE-2022-4206)

2022-04-05 Thread Peter Maydell
On Tue, 5 Apr 2022 at 11:50, Mauro Matteo Cascella wrote: > > Prevent potential integer overflow by limiting 'width' and 'height' to > 512x512. Also change 'datasize' type to size_t. Refer to security > advisory https://starlabs.sg/advisories/22-4206/ for more information. > > Fixes: CVE-2022-4206

Re: [PATCH] ui/cursor: fix integer overflow in cursor_alloc (CVE-2022-4206)

2022-04-05 Thread Marc-André Lureau
Hi On Tue, Apr 5, 2022 at 2:43 PM Mauro Matteo Cascella wrote: > Prevent potential integer overflow by limiting 'width' and 'height' to > 512x512. Also change 'datasize' type to size_t. Refer to security > advisory https://starlabs.sg/advisories/22-4206/ for more information. > > Fixes: CVE-2022

Re: [PATCH] ui/cursor: fix integer overflow in cursor_alloc (CVE-2022-4206)

2022-04-05 Thread Gerd Hoffmann
> > +++ b/ui/cursor.c > > @@ -46,6 +46,13 @@ static QEMUCursor *cursor_parse_xpm(const char *xpm[]) > > > > /* parse pixel data */ > > c = cursor_alloc(width, height); > > + > > +if (!c) { > > +fprintf(stderr, "%s: cursor %ux%u alloc error\n", > > +__func__, wi

[PATCH] ui/cursor: fix integer overflow in cursor_alloc (CVE-2022-4206)

2022-04-05 Thread Mauro Matteo Cascella
Prevent potential integer overflow by limiting 'width' and 'height' to 512x512. Also change 'datasize' type to size_t. Refer to security advisory https://starlabs.sg/advisories/22-4206/ for more information. Fixes: CVE-2022-4206 Signed-off-by: Mauro Matteo Cascella --- hw/display/qxl-render.c |