From patchwork Thu Jul 14 00:15:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Van Hensbergen X-Patchwork-Id: 973832 X-Patchwork-Delegate: ericvh@gmail.com Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6E0GR2G019835 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 14 Jul 2011 00:16:48 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Qh9b5-000729-97; Thu, 14 Jul 2011 00:16:07 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Qh9b3-000722-Hf for v9fs-developer@lists.sourceforge.net; Thu, 14 Jul 2011 00:16:05 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.210.47 as permitted sender) client-ip=209.85.210.47; envelope-from=ericvh@gmail.com; helo=mail-pz0-f47.google.com; Received: from mail-pz0-f47.google.com ([209.85.210.47]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1Qh9b2-0005J2-ON for v9fs-developer@lists.sourceforge.net; Thu, 14 Jul 2011 00:16:05 +0000 Received: by pzk36 with SMTP id 36so6946973pzk.34 for ; Wed, 13 Jul 2011 17:15:58 -0700 (PDT) Received: by 10.68.44.34 with SMTP id b2mr2166304pbm.85.1310602558774; Wed, 13 Jul 2011 17:15:58 -0700 (PDT) Received: from localhost.localdomain ([32.97.110.63]) by mx.google.com with ESMTPS id v9sm7503323pbm.63.2011.07.13.17.15.56 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jul 2011 17:15:57 -0700 (PDT) From: Eric Van Hensbergen To: v9fs-developer@lists.sourceforge.net Date: Wed, 13 Jul 2011 19:15:52 -0500 Message-Id: <1310602552-14062-1-git-send-email-ericvh@gmail.com> X-Mailer: git-send-email 1.7.4.1 X-Spam-Score: -1.6 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ericvh[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 T_TO_NO_BRKTS_FREEMAIL To: misformatted and free email service X-Headers-End: 1Qh9b2-0005J2-ON Cc: Eric Van Hensbergen , linux-kernel@vger.kernel.org Subject: [V9fs-developer] [PATCH] net/9p: fix client code to fail more gracefully on protocol error X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 14 Jul 2011 00:16:48 +0000 (UTC) There was a BUG_ON to protect against a bad id which could be dealt with more gracefully. Reported-by: Natalie Orlin Signed-off-by: Eric Van Hensbergen --- net/9p/client.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/net/9p/client.c b/net/9p/client.c index 9e3b0e6..81e667b 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -280,7 +280,8 @@ struct p9_req_t *p9_tag_lookup(struct p9_client *c, u16 tag) * buffer to read the data into */ tag++; - BUG_ON(tag >= c->max_tag); + if(tag >= c->max_tag) + return NULL; row = tag / P9_ROW_MAXTAG; col = tag % P9_ROW_MAXTAG;