* [PULL 0/1] 9p fixes for QEMU 4.2-rc3
@ 2019-11-23 16:59 Greg Kurz
2019-11-23 16:59 ` [PULL 1/1] 9pfs: Fix divide by zero bug Greg Kurz
2019-11-25 15:05 ` [PULL 0/1] 9p fixes for QEMU 4.2-rc3 Peter Maydell
0 siblings, 2 replies; 3+ messages in thread
From: Greg Kurz @ 2019-11-23 16:59 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Greg Kurz
The following changes since commit 2061735ff09f9d5e67c501a96227b470e7de69b1:
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2019-11-21 17:18:40 +0000)
are available in the Git repository at:
https://github.com/gkurz/qemu.git tags/9p-fix-2019-11-23
for you to fetch changes up to 68d654daee4364a0eca589a547d716084d9cb33d:
9pfs: Fix divide by zero bug (2019-11-23 15:51:48 +0100)
----------------------------------------------------------------
9pfs fixes for QEMU 4.2
This fixes a potential QEMU crash if the underlying filesystem returns
a null block size in statfs().
----------------------------------------------------------------
Dan Schatzberg (1):
9pfs: Fix divide by zero bug
hw/9pfs/9p.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--
2.21.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PULL 1/1] 9pfs: Fix divide by zero bug
2019-11-23 16:59 [PULL 0/1] 9p fixes for QEMU 4.2-rc3 Greg Kurz
@ 2019-11-23 16:59 ` Greg Kurz
2019-11-25 15:05 ` [PULL 0/1] 9p fixes for QEMU 4.2-rc3 Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Greg Kurz @ 2019-11-23 16:59 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Christian Schoenebeck, Greg Kurz, Dan Schatzberg
From: Dan Schatzberg <dschatzberg@fb.com>
Some filesystems may return 0s in statfs (trivially, a FUSE filesystem
can do so). QEMU should handle this gracefully and just behave the
same as if statfs failed.
Signed-off-by: Dan Schatzberg <dschatzberg@fb.com>
Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Signed-off-by: Greg Kurz <groug@kaod.org>
---
hw/9pfs/9p.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 37abcdb71ec0..520177f40c17 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -1834,8 +1834,10 @@ static int32_t coroutine_fn get_iounit(V9fsPDU *pdu, V9fsPath *path)
* and as well as less than (client msize - P9_IOHDRSZ))
*/
if (!v9fs_co_statfs(pdu, path, &stbuf)) {
- iounit = stbuf.f_bsize;
- iounit *= (s->msize - P9_IOHDRSZ)/stbuf.f_bsize;
+ if (stbuf.f_bsize) {
+ iounit = stbuf.f_bsize;
+ iounit *= (s->msize - P9_IOHDRSZ) / stbuf.f_bsize;
+ }
}
if (!iounit) {
iounit = s->msize - P9_IOHDRSZ;
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PULL 0/1] 9p fixes for QEMU 4.2-rc3
2019-11-23 16:59 [PULL 0/1] 9p fixes for QEMU 4.2-rc3 Greg Kurz
2019-11-23 16:59 ` [PULL 1/1] 9pfs: Fix divide by zero bug Greg Kurz
@ 2019-11-25 15:05 ` Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2019-11-25 15:05 UTC (permalink / raw)
To: Greg Kurz; +Cc: QEMU Developers
On Sat, 23 Nov 2019 at 16:59, Greg Kurz <groug@kaod.org> wrote:
>
> The following changes since commit 2061735ff09f9d5e67c501a96227b470e7de69b1:
>
> Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2019-11-21 17:18:40 +0000)
>
> are available in the Git repository at:
>
> https://github.com/gkurz/qemu.git tags/9p-fix-2019-11-23
>
> for you to fetch changes up to 68d654daee4364a0eca589a547d716084d9cb33d:
>
> 9pfs: Fix divide by zero bug (2019-11-23 15:51:48 +0100)
>
> ----------------------------------------------------------------
> 9pfs fixes for QEMU 4.2
>
> This fixes a potential QEMU crash if the underlying filesystem returns
> a null block size in statfs().
>
> ----------------------------------------------------------------
> Dan Schatzberg (1):
> 9pfs: Fix divide by zero bug
>
> hw/9pfs/9p.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
> --
> 2.21.0
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/4.2
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-25 15:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-23 16:59 [PULL 0/1] 9p fixes for QEMU 4.2-rc3 Greg Kurz
2019-11-23 16:59 ` [PULL 1/1] 9pfs: Fix divide by zero bug Greg Kurz
2019-11-25 15:05 ` [PULL 0/1] 9p fixes for QEMU 4.2-rc3 Peter Maydell
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).