From patchwork Fri Aug 26 16:57:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 111809 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A700AB6FA5 for ; Sat, 27 Aug 2011 03:00:15 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754334Ab1HZRAF (ORCPT ); Fri, 26 Aug 2011 13:00:05 -0400 Received: from mail-qw0-f46.google.com ([209.85.216.46]:61645 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753816Ab1HZRAA (ORCPT ); Fri, 26 Aug 2011 13:00:00 -0400 Received: by qwk3 with SMTP id 3so2145560qwk.19 for ; Fri, 26 Aug 2011 09:59:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=3xcHXuF+m+0QwbHtflSSnOMrfdiN7AGwHmWQxOXOWsE=; b=dEbw4NDr0yunfrCuEl4XtuFhpERExS3s5TmvOnhpYhBdUvRc3wundh3OjheVXir1ug KaZjp4mj99sho+pjY1jhNZ0pX+JroJBSESznxb+js9YCyXiTMXXOqHKthM5dojpNIPS6 pjhbYXN6i8EBl3FyCdJyHI7vC6h7egJrjPRDs= Received: by 10.142.49.11 with SMTP id w11mr632429wfw.448.1314377999154; Fri, 26 Aug 2011 09:59:59 -0700 (PDT) Received: from shale.localdomain ([41.139.221.94]) by mx.google.com with ESMTPS id x6sm2993561pba.5.2011.08.26.09.59.53 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 26 Aug 2011 09:59:58 -0700 (PDT) Date: Fri, 26 Aug 2011 19:57:40 +0300 From: Dan Carpenter To: Eric Van Hensbergen Cc: "David S. Miller" , "Venkateswararao Jujjuri (JV)" , "Aneesh Kumar K.V" , "M. Mohan Kumar" , Stephen Hemminger , "open list:NETWORKING [GENERAL]" , kernel-janitors@vger.kernel.org Subject: [patch 2/2] 9p: change an int to unsigned int Message-ID: <20110826165740.GF3775@shale.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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. Signed-off-by: Dan Carpenter Reviewed-by: Venkateswararao Jujjuri --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;