[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] 9pfs: Fix segfault in do_readdir_many caused by struct diren
From: |
Christian Schoenebeck |
Subject: |
Re: [PATCH] 9pfs: Fix segfault in do_readdir_many caused by struct dirent overread |
Date: |
Fri, 28 Jan 2022 18:40:59 +0100 |
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