Am 18.06.2018 um 17:50 hat Stefan Hajnoczi geschrieben:
> On Tue, Jun 12, 2018 at 07:26:25AM +0800, Jie Wang wrote:
> > if laio_init create linux_aio failed and return NULL, NULL pointer
> > dereference will occur when laio_attach_aio_context dereference
> > linux_aio in aio_get_linux_aio. Let's avoid it and report error.
> > 
> > Signed-off-by: Jie Wang <[email protected]>
> > ---
> >  block/file-posix.c | 19 +++++++++++++++++--
> >  util/async.c       |  5 ++++-
> >  2 files changed, 21 insertions(+), 3 deletions(-)
> 
> If someone wants to split aio_get_linux_aio() into an initialization
> function and a "get" function which doesn't return NULL if init
> succeeded, then we can make this a bit cleaner.  But it doesn't matter
> at the moment since there are few callers and duplicating the NULL check
> isn't too bad.
> 
> Thanks, applied to my block tree:
> https://github.com/stefanha/qemu/commits/block

Did you see this patch?

[RFC v2] aio: properly bubble up errors from initialization
Message-Id: <[email protected]>

I didn't review it yet, but it seems to be for the same, or at least a
similar, problem.

Kevin

Attachment: signature.asc
Description: PGP signature

Reply via email to