Re: [PATCH] vfio: fix use-after-free in display

2020-07-15 Thread Gerd Hoffmann
Hi, > Tricky, but I think I follow that dpy->region.surface is only ever > allocated to replace dpy->con->surface, so when ramfb_display_update() > then replaces and frees dpy->con->surface with dpy->ramfb->ds, that's > where the object point to by dpy->region.surface was freed. Right? Correct

Re: [PATCH] vfio: fix use-after-free in display

2020-07-13 Thread Alex Williamson
On Mon, 13 Jul 2020 14:45:20 +0200 Gerd Hoffmann wrote: > Calling ramfb_display_update() might replace the DisplaySurface with the > boot display, which in turn will free the currently active > DisplaySurface. > > So clear our DisplaySurface pinter (dpy->region.surface pointer) to (a)

Re: [PATCH] vfio: fix use-after-free in display

2020-07-13 Thread Philippe Mathieu-Daudé
On 7/13/20 4:00 PM, Gerd Hoffmann wrote: > On Mon, Jul 13, 2020 at 02:51:05PM +0200, Philippe Mathieu-Daudé wrote: >> On 7/13/20 2:45 PM, Gerd Hoffmann wrote: >>> Calling ramfb_display_update() might replace the DisplaySurface with the >>> boot display, which in turn will free the currently active

Re: [PATCH] vfio: fix use-after-free in display

2020-07-13 Thread Gerd Hoffmann
On Mon, Jul 13, 2020 at 02:51:05PM +0200, Philippe Mathieu-Daudé wrote: > On 7/13/20 2:45 PM, Gerd Hoffmann wrote: > > Calling ramfb_display_update() might replace the DisplaySurface with the > > boot display, which in turn will free the currently active > > DisplaySurface. > > > > So clear our D

Re: [PATCH] vfio: fix use-after-free in display

2020-07-13 Thread Philippe Mathieu-Daudé
On 7/13/20 2:45 PM, Gerd Hoffmann wrote: > Calling ramfb_display_update() might replace the DisplaySurface with the > boot display, which in turn will free the currently active > DisplaySurface. > > So clear our DisplaySurface pinter (dpy->region.surface pointer) to (a) > avoid use-after-free and

[PATCH] vfio: fix use-after-free in display

2020-07-13 Thread Gerd Hoffmann
Calling ramfb_display_update() might replace the DisplaySurface with the boot display, which in turn will free the currently active DisplaySurface. So clear our DisplaySurface pinter (dpy->region.surface pointer) to (a) avoid use-after-free and (b) force replacing the boot display with the real di