From: Abhishek Kulkarni <adkulkar@umail.iu.edu>
To: linux-kernel@vger.kernel.org
Cc: v9fs-developer@lists.sourceforge.net,
Abhishek Kulkarni <adkulkar@umail.iu.edu>,
netdev@vger.kernel.org
Subject: [9P PATCH 2/2] net/9p: Fix crash due to bad mount parameters.
Date: Wed, 1 Jul 2009 12:50:54 -0600 [thread overview]
Message-ID: <1246474254-10401-2-git-send-email-adkulkar@umail.iu.edu> (raw)
In-Reply-To: <1246474254-10401-1-git-send-email-adkulkar@umail.iu.edu>
It is not safe to use match_int without checking the token type returned
by match_token (especially when the token type returned is Opt_err and
args is empty). Fix it.
Signed-off-by: Abhishek Kulkarni <adkulkar@umail.iu.edu>
---
:100644 100644 c613ed08.. b884d98... M net/9p/trans_fd.c
net/9p/trans_fd.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index c613ed0..b884d98 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -731,12 +731,14 @@ static int parse_opts(char *params, struct p9_fd_opts *opts)
if (!*p)
continue;
token = match_token(p, tokens, args);
- r = match_int(&args[0], &option);
- if (r < 0) {
- P9_DPRINTK(P9_DEBUG_ERROR,
- "integer field, but no integer?\n");
- ret = r;
- continue;
+ if (token != Opt_err) {
+ r = match_int(&args[0], &option);
+ if (r < 0) {
+ P9_DPRINTK(P9_DEBUG_ERROR,
+ "integer field, but no integer?\n");
+ ret = r;
+ continue;
+ }
}
switch (token) {
case Opt_port:
--
1.6.3.3
next prev parent reply other threads:[~2009-07-01 18:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-01 18:50 [9P PATCH 1/2] 9p: Fix incorrect parameters to v9fs_file_readn Abhishek Kulkarni
2009-07-01 18:50 ` Abhishek Kulkarni [this message]
2009-07-02 20:18 ` [9P PATCH 2/2] net/9p: Fix crash due to bad mount parameters David Miller
2009-07-14 18:30 ` [V9fs-developer] [9P PATCH 1/2] 9p: Fix incorrect parameters to v9fs_file_readn Eric Van Hensbergen
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=1246474254-10401-2-git-send-email-adkulkar@umail.iu.edu \
--to=adkulkar@umail.iu.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--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
all inboxes | Powered by JetHome®