qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] bea933: block/export: Fix null pointer derefe


From: Alex Bennée
Subject: [Qemu-commits] [qemu/qemu] bea933: block/export: Fix null pointer dereference in erro...
Date: Tue, 30 May 2023 05:09:35 -0700

  Branch: refs/heads/staging-8.0
  Home:   https://github.com/qemu/qemu
  Commit: bea933e430249fb81e1c020ddf50511d0481d56e
      
https://github.com/qemu/qemu/commit/bea933e430249fb81e1c020ddf50511d0481d56e
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 2023)

  Changed paths:
    M block/export/export.c

  Log Message:
  -----------
  block/export: Fix null pointer dereference in error path

There are some error paths in blk_exp_add() that jump to 'fail:' before
'exp' is even created. So we can't just unconditionally access exp->blk.

Add a NULL check, and switch from exp->blk to blk, which is available
earlier, just to be extra sure that we really cover all cases where
BlockDevOps could have been set for it (in practice, this only happens
in drv->create() today, so this part of the change isn't strictly
necessary).

Fixes: Coverity CID 1509238
Fixes: de79b52604e43fdeba6cee4f5af600b62169f2d2
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230510203601.418015-3-kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit a184563778f2b8970eb93291f08108e66432a575)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>


  Commit: f7f686b61cf7ee142c9264d2e04ac2c6a96d37f8
      
https://github.com/qemu/qemu/commit/f7f686b61cf7ee142c9264d2e04ac2c6a96d37f8
  Author: Michael Tokarev <mjt@tls.msk.ru>
  Date:   2023-05-30 (Tue, 30 May 2023)

  Changed paths:
    M VERSION

  Log Message:
  -----------
  Update version for 8.0.2 release

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>


Compare: https://github.com/qemu/qemu/compare/dabb4183d17d...f7f686b61cf7



reply via email to

[Prev in Thread] Current Thread [Next in Thread]