All of lore.kernel.org
 help / color / mirror / Atom feed
From: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Eric Van Hensbergen <ericvh@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	"M. Mohan Kumar" <mohan@in.ibm.com>,
	Stephen Hemminger <shemminger@vyatta.com>,
	"open list:NETWORKING [GENERAL]" <netdev@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch 2/2] 9p: change an int to unsigned int
Date: Wed, 07 Sep 2011 15:33:08 +0000	[thread overview]
Message-ID: <4E678EB4.6020002@linux.vnet.ibm.com> (raw)
In-Reply-To: <20110826165740.GF3775@shale.localdomain>

On 08/26/2011 09:57 AM, Dan Carpenter wrote:
> The size of things should be unsigned because negative sizes are
> silly.  My concern is the the limit checks don't take negative values
> into consideration in p9_client_create()
> 	if (clnt->msize>  clnt->trans_mod->maxsize)
> 		clnt->msize = clnt->trans_mod->maxsize;
> and in p9_tag_alloc()
> 	int alloc_msize = min(c->msize, max_size);
>
> I don't know if this is exported to user space?  Hopefully it's not
> too late to change this.
It is not exported to user space but the other way is true;
  msize can be populate from mount option. It should be fine.
>
> Signed-off-by: Dan Carpenter<error27@gmail.com>
Reviewed-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
>
> diff --git a/include/net/9p/client.h b/include/net/9p/client.h
> index 55ce72c..d479d7d 100644
> --- a/include/net/9p/client.h
> +++ b/include/net/9p/client.h
> @@ -151,7 +151,7 @@ struct p9_req_t {
>
>   struct p9_client {
>   	spinlock_t lock; /* protect client structure */
> -	int msize;
> +	unsigned int msize;
>   	unsigned char proto_version;
>   	struct p9_trans_module *trans_mod;
>   	enum p9_trans_status status;


WARNING: multiple messages have this Message-ID (diff)
From: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Eric Van Hensbergen <ericvh@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	"M. Mohan Kumar" <mohan@in.ibm.com>,
	Stephen Hemminger <shemminger@vyatta.com>,
	"open list:NETWORKING [GENERAL]" <netdev@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch 2/2] 9p: change an int to unsigned int
Date: Wed, 07 Sep 2011 08:33:08 -0700	[thread overview]
Message-ID: <4E678EB4.6020002@linux.vnet.ibm.com> (raw)
In-Reply-To: <20110826165740.GF3775@shale.localdomain>

On 08/26/2011 09:57 AM, Dan Carpenter wrote:
> The size of things should be unsigned because negative sizes are
> silly.  My concern is the the limit checks don't take negative values
> into consideration in p9_client_create()
> 	if (clnt->msize>  clnt->trans_mod->maxsize)
> 		clnt->msize = clnt->trans_mod->maxsize;
> and in p9_tag_alloc()
> 	int alloc_msize = min(c->msize, max_size);
>
> I don't know if this is exported to user space?  Hopefully it's not
> too late to change this.
It is not exported to user space but the other way is true;
  msize can be populate from mount option. It should be fine.
>
> Signed-off-by: Dan Carpenter<error27@gmail.com>
Reviewed-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
>
> diff --git a/include/net/9p/client.h b/include/net/9p/client.h
> index 55ce72c..d479d7d 100644
> --- a/include/net/9p/client.h
> +++ b/include/net/9p/client.h
> @@ -151,7 +151,7 @@ struct p9_req_t {
>
>   struct p9_client {
>   	spinlock_t lock; /* protect client structure */
> -	int msize;
> +	unsigned int msize;
>   	unsigned char proto_version;
>   	struct p9_trans_module *trans_mod;
>   	enum p9_trans_status status;

  parent reply	other threads:[~2011-09-07 15:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26 16:57 [patch 2/2] 9p: change an int to unsigned int Dan Carpenter
2011-08-26 16:57 ` Dan Carpenter
2011-08-30  7:38 ` Aneesh Kumar K.V
2011-08-30  7:50   ` Aneesh Kumar K.V
2011-09-07 15:33 ` Venkateswararao Jujjuri [this message]
2011-09-07 15:33   ` Venkateswararao Jujjuri

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=4E678EB4.6020002@linux.vnet.ibm.com \
    --to=jvrao@linux.vnet.ibm.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=ericvh@gmail.com \
    --cc=error27@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=mohan@in.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.