qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org
Cc: Vitaly Chikunov <vt@altlinux.org>,
	qemu-stable@nongnu.org, ldv@altlinux.org,
	Greg Kurz <groug@kaod.org>
Subject: Re: [PATCH] 9pfs: Fix segfault in do_readdir_many caused by struct dirent overread
Date: Fri, 28 Jan 2022 18:40:59 +0100	[thread overview]
Message-ID: <1768416.RRnjqH5RSi@silver> (raw)
In-Reply-To: <20220128162401.vbnffmghae3zgrfo@altlinux.org>

On Freitag, 28. Januar 2022 17:24:01 CET Vitaly Chikunov wrote:
> > > diff --git a/util/osdep.c b/util/osdep.c
> > > index 42a0a4986a..e39d1071fd 100644
> > > --- a/util/osdep.c
> > > +++ b/util/osdep.c
> > > @@ -33,6 +33,7 @@
> > > 
> > >  extern int madvise(char *, size_t, int);
> > >  #endif
> > > 
> > > +#include <dirent.h>
> > 
> > Wouldn't that break Windows builds?
> 
> Possible, but I don't have windows build to test. What would you
> suggest as better fix?
> 
> I took as example `util/path.c' which includes `dirent.h' too, but it is
> not handled anyway different than `util/osdep.c'

AFAICS the current expectation is to build QEMU for Windows with a POSIX-aware 
toolchain like msys2, cygwin or some cross compiler:
https://wiki.qemu.org/Hosts/W32

So I suggest leave it as is, it should be fine. Otherwise we can still wrap it 
into something like

	#if !defined(WIN32)
	...
	#endif

later on if really required.

Best regards,
Christian Schoenebeck




      reply	other threads:[~2022-01-28 18:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 21:27 [PATCH] 9pfs: Fix segfault in do_readdir_many caused by struct dirent overread Vitaly Chikunov
2022-01-28 14:43 ` Christian Schoenebeck
2022-01-28 14:49   ` Christian Schoenebeck
2022-01-28 16:24   ` Vitaly Chikunov
2022-01-28 17:40     ` Christian Schoenebeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1768416.RRnjqH5RSi@silver \
    --to=qemu_oss@crudebyte.com \
    --cc=groug@kaod.org \
    --cc=ldv@altlinux.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=vt@altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).