From: Andrew Morton <akpm@linux-foundation.org>
To: Dan Carpenter <error27@gmail.com>
Cc: Eric Van Hensbergen <ericvh@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Abhishek Kulkarni <adkulkar@umail.iu.edu>,
Venkateswararao Jujjuri <jvrao@us.ibm.com>,
linux-kernel@vger.kernel.org,
Tilman Sauerbeck <tilman@code-monkey.de>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] 9p: strlen() doesn't count the terminator
Date: Mon, 12 Jul 2010 20:04:58 +0000 [thread overview]
Message-ID: <20100712130458.bb8ae751.akpm@linux-foundation.org> (raw)
In-Reply-To: <20100710095154.GU19184@bicker>
On Sat, 10 Jul 2010 11:51:54 +0200
Dan Carpenter <error27@gmail.com> wrote:
> This is an off by one bug because strlen() doesn't count the NULL
> terminator. We strcpy() addr into a fixed length array of size
> UNIX_PATH_MAX later on.
>
> The addr variable is the name of the device being mounted.
>
> CC: stable@kernel.org
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
> index 98ce9bc..c85109d 100644
> --- a/net/9p/trans_fd.c
> +++ b/net/9p/trans_fd.c
> @@ -948,7 +948,7 @@ p9_fd_create_unix(struct p9_client *client, const char *addr, char *args)
>
> csocket = NULL;
>
> - if (strlen(addr) > UNIX_PATH_MAX) {
> + if (strlen(addr) >= UNIX_PATH_MAX) {
> P9_EPRINTK(KERN_ERR, "p9_trans_unix: address too long: %s\n",
> addr);
> return -ENAMETOOLONG;
This bug doesn't strike me as serious enough to warrant backporting the fix
into -stable. What was your thinking there?
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Dan Carpenter <error27@gmail.com>
Cc: Eric Van Hensbergen <ericvh@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Abhishek Kulkarni <adkulkar@umail.iu.edu>,
Venkateswararao Jujjuri <jvrao@us.ibm.com>,
linux-kernel@vger.kernel.org,
Tilman Sauerbeck <tilman@code-monkey.de>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] 9p: strlen() doesn't count the terminator
Date: Mon, 12 Jul 2010 13:04:58 -0700 [thread overview]
Message-ID: <20100712130458.bb8ae751.akpm@linux-foundation.org> (raw)
In-Reply-To: <20100710095154.GU19184@bicker>
On Sat, 10 Jul 2010 11:51:54 +0200
Dan Carpenter <error27@gmail.com> wrote:
> This is an off by one bug because strlen() doesn't count the NULL
> terminator. We strcpy() addr into a fixed length array of size
> UNIX_PATH_MAX later on.
>
> The addr variable is the name of the device being mounted.
>
> CC: stable@kernel.org
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
> index 98ce9bc..c85109d 100644
> --- a/net/9p/trans_fd.c
> +++ b/net/9p/trans_fd.c
> @@ -948,7 +948,7 @@ p9_fd_create_unix(struct p9_client *client, const char *addr, char *args)
>
> csocket = NULL;
>
> - if (strlen(addr) > UNIX_PATH_MAX) {
> + if (strlen(addr) >= UNIX_PATH_MAX) {
> P9_EPRINTK(KERN_ERR, "p9_trans_unix: address too long: %s\n",
> addr);
> return -ENAMETOOLONG;
This bug doesn't strike me as serious enough to warrant backporting the fix
into -stable. What was your thinking there?
next prev parent reply other threads:[~2010-07-12 20:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-10 9:51 [patch] 9p: strlen() doesn't count the terminator Dan Carpenter
2010-07-10 9:51 ` Dan Carpenter
2010-07-12 20:04 ` Andrew Morton [this message]
2010-07-12 20:04 ` Andrew Morton
2010-07-12 21:51 ` Dan Carpenter
2010-07-12 21:51 ` Dan Carpenter
2010-07-13 3:34 ` David Miller
2010-07-13 3:34 ` David Miller
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=20100712130458.bb8ae751.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=adkulkar@umail.iu.edu \
--cc=davem@davemloft.net \
--cc=ericvh@gmail.com \
--cc=error27@gmail.com \
--cc=jvrao@us.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tilman@code-monkey.de \
/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.