From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org
Cc: Greg Kurz <groug@kaod.org>
Subject: Re: [PATCH] 9pfs: simplify v9fs_walk()
Date: Mon, 17 May 2021 15:14:23 +0200 [thread overview]
Message-ID: <81064612.2HtOhVY35N@silver> (raw)
In-Reply-To: <20210517133509.05d1f4f9@bahia.lan>
On Montag, 17. Mai 2021 13:35:09 CEST Greg Kurz wrote:
> On Sun, 16 May 2021 17:55:34 +0200
>
> Christian Schoenebeck <qemu_oss@crudebyte.com> wrote:
> > There is only one comparison between nwnames and P9_MAXWELEM required.
> >
> > Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> > ---
>
> Nice catch. It's been there for a decade :)
>
> Reviewed-by: Greg Kurz <groug@kaod.org>
Now that was a quick response! Queued, thanks!
https://github.com/cschoenebeck/qemu/commits/9p.next
>
> > hw/9pfs/9p.c | 9 +++++----
> > 1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
> > index 0fa776af09..89aa07db78 100644
> > --- a/hw/9pfs/9p.c
> > +++ b/hw/9pfs/9p.c
> > @@ -1739,7 +1739,11 @@ static void coroutine_fn v9fs_walk(void *opaque)
> >
> > trace_v9fs_walk(pdu->tag, pdu->id, fid, newfid, nwnames);
> >
> > - if (nwnames && nwnames <= P9_MAXWELEM) {
> > + if (nwnames > P9_MAXWELEM) {
> > + err = -EINVAL;
> > + goto out_nofid;
> > + }
> > + if (nwnames) {
> >
> > wnames = g_new0(V9fsString, nwnames);
> > qids = g_new0(V9fsQID, nwnames);
> > for (i = 0; i < nwnames; i++) {
> >
> > @@ -1753,9 +1757,6 @@ static void coroutine_fn v9fs_walk(void *opaque)
> >
> > }
> > offset += err;
> >
> > }
> >
> > - } else if (nwnames > P9_MAXWELEM) {
> > - err = -EINVAL;
> > - goto out_nofid;
> >
> > }
> > fidp = get_fid(pdu, fid);
> > if (fidp == NULL) {
prev parent reply other threads:[~2021-05-17 13:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-16 15:55 [PATCH] 9pfs: simplify v9fs_walk() Christian Schoenebeck
2021-05-17 11:35 ` [SPAM] " Greg Kurz
2021-05-17 13:14 ` 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=81064612.2HtOhVY35N@silver \
--to=qemu_oss@crudebyte.com \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.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).