public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: Tomas Bortoli <tomasbortoli@gmail.com>
Cc: davem@davemloft.net, v9fs-developer@lists.sourceforge.net,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	syzkaller@googlegroups.com
Subject: Re: [PATCH] 9p: validate PDU length
Date: Wed, 25 Jul 2018 06:11:39 +0200	[thread overview]
Message-ID: <20180725041139.GB11041@nautica> (raw)
In-Reply-To: <20180723154404.2406-1-tomasbortoli@gmail.com>

Tomas Bortoli wrote on Mon, Jul 23, 2018:
> diff --git a/net/9p/client.c b/net/9p/client.c
> index 18c5271910dc..92240ccf476b 100644
> --- a/net/9p/client.c
> +++ b/net/9p/client.c
> @@ -524,6 +525,12 @@ static int p9_check_errors(struct p9_client *c, struct p9_req_t *req)
>  	int ecode;
>  
>  	err = p9_parse_header(req->rc, NULL, &type, NULL, 0);
> +	if (req->rc->size >= c->msize) {

I was looking at this again, I think it's more appropriate to use
req->rc->capacity at this point like you did in the first version of the
patch.

I had suggested msize in the common p9_parse_header function because
that'd let us accept zc requests where the size in the pdu could be
bigger than capacity, but this isn't the case in p9_check_errors.

If you're ok with this I'll edit your commit directly, this is less work
for me than having to check a new patch.

Thanks,
-- 
Dominique

  parent reply	other threads:[~2018-07-25  4:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23 15:44 [PATCH] 9p: validate PDU length Tomas Bortoli
2018-07-24  3:57 ` Dominique Martinet
2018-07-25  4:11 ` Dominique Martinet [this message]
2018-07-25 10:50   ` Tomas Bortoli

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=20180725041139.GB11041@nautica \
    --to=asmadeus@codewreck.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=syzkaller@googlegroups.com \
    --cc=tomasbortoli@gmail.com \
    --cc=v9fs-developer@lists.sourceforge.net \
    /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