linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Dominique Martinet <dominique.martinet@cea.fr>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Eric Van Hensbergen <ericvh@gmail.com>,
	Ron Minnich <rminnich@sandia.gov>,
	Latchesar Ionkov <lucho@ionkov.net>,
	linux-fsdevel@vger.kernel.org,
	v9fs-developer@lists.sourceforge.net
Subject: Re: [V9fs-developer] [PATCH] 9p: use unsinged integers for nwqid/count
Date: Wed, 7 Jan 2015 14:06:10 +0200	[thread overview]
Message-ID: <20150107120610.GA6378@node.dhcp.inet.fi> (raw)
In-Reply-To: <20150106130402.GB15671@u-galfione>

On Tue, Jan 06, 2015 at 02:04:02PM +0100, Dominique Martinet wrote:
> Hi,
> 
> Kirill A. Shutemov wrote on Tue, Dec 30, 2014 at 02:48:09AM +0200:
> > @@ -273,7 +273,7 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt,
> >  			}
> >  			break;
> >  		case 'R':{
> > -				int16_t *nwqid = va_arg(ap, int16_t *);
> > +				uint16_t *nwqid = va_arg(ap, uint16_t *);
> >  				struct p9_qid **wqids =
> >  				    va_arg(ap, struct p9_qid **);
> >  
> 
> Good find there!
> 
> Given we also have pdu->size, would it make sense to check nwqid through
> this?
> I'd need to check but I'd assume we should always have, after reading
> nwqid, pdu->size - pdu->offset >= *nwqid * 13 (size of qid on the wire)

Other option is to ask caller for upper limit. Since it's reply to Twalk
request, we should never see nwqid > nwname on request.

-- 
 Kirill A. Shutemov

      reply	other threads:[~2015-01-07 12:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-30  0:48 [PATCH] 9p: use unsinged integers for nwqid/count Kirill A. Shutemov
2015-01-06 13:04 ` [V9fs-developer] " Dominique Martinet
2015-01-07 12:06   ` Kirill A. Shutemov [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=20150107120610.GA6378@node.dhcp.inet.fi \
    --to=kirill@shutemov.name \
    --cc=dominique.martinet@cea.fr \
    --cc=ericvh@gmail.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=lucho@ionkov.net \
    --cc=rminnich@sandia.gov \
    --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;
as well as URLs for NNTP newsgroup(s).