lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <17700.44859.590516.673084@cse.unsw.edu.au>
Date:	Thu, 5 Oct 2006 17:07:39 +1000
From:	Neil Brown <neilb@...e.de>
To:	Greg Banks <gnb@....com>
Cc:	"J. Bruce Fields" <bfields@...ldses.org>,
	nfs@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: Re: [NFS] [PATCH 008 of 11] knfsd: Prepare knfsd for support
	of	rsize/wsize of up to 1MB, over TCP.

On Tuesday October 3, gnb@....com wrote:
> On Tue, Oct 03, 2006 at 03:41:43PM +1000, Neil Brown wrote:
> > Comments on the below?
> 
> Looks ok, except...
> 
> > @@ -57,7 +57,8 @@ struct svc_serv {
> >  	struct svc_stat *	sv_stats;	/* RPC statistics */
> >  	spinlock_t		sv_lock;
> >  	unsigned int		sv_nrthreads;	/* # of server threads */
> > -	unsigned int		sv_bufsz;	/* datagram buffer size */
> > +	unsigned int		sv_max_payload;	/* datagram payload size */
> > +	unsigned int		sv_max_mesg;	/* bufsz + 1 page for overheads */
> 
> Presumably the comment should read "max_payload + 1 page..." ?
> 

Yes....

> > @@ -414,9 +415,11 @@ svc_init_buffer(struct svc_rqst *rqstp, 
> >  	int pages;
> >  	int arghi;
> >  	
> > -	if (size > RPCSVC_MAXPAYLOAD)
> > -		size = RPCSVC_MAXPAYLOAD;
> > -	pages = 2 + (size+ PAGE_SIZE -1) / PAGE_SIZE;
> > +	if (size > RPCSVC_MAXPAYLOAD + PAGE_SIZE)
> > +		size = RPCSVC_MAXPAYLOAD + PAGE_SIZE;
> > +	pages = size + PAGE_SIZE; /* extra page as we hold both request and reply.
> > +				   * We assume one is at most one page
> > +				   */
> 
> Isn't there a divide by PAGE_SIZE missing here?  Looks
> like we'll be allocating a *lot* of pages ;-)

Better safe that sorry?  But yes, we would be very sorry if we tried
to allocate that many pages.

Thanks for the review.

NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ