[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2] util/async: avoid NULL pointer dereference
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-block] [PATCH v2] util/async: avoid NULL pointer dereference |
Date: |
Mon, 18 Jun 2018 18:53:34 +0200 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
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 <address@hidden>
> > ---
> > 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: <address@hidden>
I didn't review it yet, but it seems to be for the same, or at least a
similar, problem.
Kevin
signature.asc
Description: PGP signature