qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/1] vfio coverity reported error fix
@ 2018-08-21 16:47 Alex Williamson
  2018-08-21 16:47 ` [Qemu-devel] [PULL 1/1] vfio/pci: Handle subsystem realpath() returning NULL Alex Williamson
  2018-08-21 18:43 ` [Qemu-devel] [PULL 0/1] vfio coverity reported error fix Alex Williamson
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Williamson @ 2018-08-21 16:47 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit ee135aa0428fe5af2af7be04ff16d2b596a9330a:

  Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-3.1-20180821' into staging (2018-08-21 13:27:11 +0100)

are available in the Git repository at:

  git://github.com/awilliam/qemu-vfio.git tags/vfio-fix-20180821.0

for you to fetch changes up to 5d6023cf74cf403fd3aee903050f43278d359e6a:

  vfio/pci: Handle subsystem realpath() returning NULL (2018-08-21 10:29:26 -0600)

----------------------------------------------------------------
VFIO fix 2018-08-21

 - Fix coverity reported issue with use of realpath (Alex Williamson)

----------------------------------------------------------------
Alex Williamson (1):
      vfio/pci: Handle subsystem realpath() returning NULL

 hw/vfio/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PULL 1/1] vfio/pci: Handle subsystem realpath() returning NULL
  2018-08-21 16:47 [Qemu-devel] [PULL 0/1] vfio coverity reported error fix Alex Williamson
@ 2018-08-21 16:47 ` Alex Williamson
  2018-08-21 18:43 ` [Qemu-devel] [PULL 0/1] vfio coverity reported error fix Alex Williamson
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2018-08-21 16:47 UTC (permalink / raw)
  To: qemu-devel

Fix error reported by Coverity where realpath can return NULL,
resulting in a segfault in strcmp().  This should never happen given
that we're working through regularly structured sysfs paths, but
trivial enough to easily avoid.

Fixes: 238e91728503 ("vfio/ccw/pci: Allow devices to opt-in for ballooning")
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 hw/vfio/pci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 056f3a887a8f..866f0deeb7eb 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2879,7 +2879,7 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
     tmp = g_strdup_printf("%s/subsystem", vdev->vbasedev.sysfsdev);
     subsys = realpath(tmp, NULL);
     g_free(tmp);
-    is_mdev = (strcmp(subsys, "/sys/bus/mdev") == 0);
+    is_mdev = subsys && (strcmp(subsys, "/sys/bus/mdev") == 0);
     free(subsys);
 
     trace_vfio_mdev(vdev->vbasedev.name, is_mdev);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PULL 0/1] vfio coverity reported error fix
  2018-08-21 16:47 [Qemu-devel] [PULL 0/1] vfio coverity reported error fix Alex Williamson
  2018-08-21 16:47 ` [Qemu-devel] [PULL 1/1] vfio/pci: Handle subsystem realpath() returning NULL Alex Williamson
@ 2018-08-21 18:43 ` Alex Williamson
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2018-08-21 18:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

On Tue, 21 Aug 2018 10:47:10 -0600
Alex Williamson <alex.williamson@redhat.com> wrote:

> The following changes since commit ee135aa0428fe5af2af7be04ff16d2b596a9330a:
> 
>   Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-3.1-20180821' into staging (2018-08-21 13:27:11 +0100)
> 
> are available in the Git repository at:
> 
>   git://github.com/awilliam/qemu-vfio.git tags/vfio-fix-20180821.0
> 
> for you to fetch changes up to 5d6023cf74cf403fd3aee903050f43278d359e6a:
> 
>   vfio/pci: Handle subsystem realpath() returning NULL (2018-08-21 10:29:26 -0600)
> 
> ----------------------------------------------------------------
> VFIO fix 2018-08-21
> 
>  - Fix coverity reported issue with use of realpath (Alex Williamson)
> 
> ----------------------------------------------------------------
> Alex Williamson (1):
>       vfio/pci: Handle subsystem realpath() returning NULL
> 
>  hw/vfio/pci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Put a halt on this, nothing wrong with the fix but I notice a separate
bug in the original commit (not closing an fd on error).  I'll post
the fix and send another pull request with both.  Thanks,

Alex

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-21 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-21 16:47 [Qemu-devel] [PULL 0/1] vfio coverity reported error fix Alex Williamson
2018-08-21 16:47 ` [Qemu-devel] [PULL 1/1] vfio/pci: Handle subsystem realpath() returning NULL Alex Williamson
2018-08-21 18:43 ` [Qemu-devel] [PULL 0/1] vfio coverity reported error fix Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).