From: "J. Bruce Fields" <bfields@fieldses.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
jlayton@redhat.com
Subject: Re: linux-next NFSD: NULL pointer dereference at nfsd_svc()
Date: Fri, 6 Aug 2010 18:05:37 -0400 [thread overview]
Message-ID: <20100806220537.GE29536@fieldses.org> (raw)
In-Reply-To: <20100806212727.GC29536@fieldses.org>
On Fri, Aug 06, 2010 at 05:27:28PM -0400, J. Bruce Fields wrote:
> Bah, so what you were hitting was simple--I just moved the
> nfsd_reset_versions() call to the wrong place; the below should fix it.
>
> There's also a couple other bugs in the area.
This isn't a serious bug, but I think it makes sense to fix it.
--b.
commit 7fa53cc872332b265bc5ba1266f39586f218ad4a
Author: J. Bruce Fields <bfields@redhat.com>
Date: Fri Aug 6 18:00:33 2010 -0400
nfsd: don't allow setting maxblksize after svc created
It's harmless to set this after the server is created, but also
ineffective, since the value is only used at the time of
svc_create_pooled(). So fail the attempt, in keeping with the pattern
set by write_versions, write_{lease,grace}time and write_recoverydir.
(This could break userspace that tried to write to nfsd/max_block_size
between setting up sockets and starting the server. However, such code
wouldn't have worked anyway, and I don't know of any examples--rpc.nfsd
in nfs-utils, probably the only user of the interface, doesn't do that.)
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 12f0ee7..b53b1d0 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -1190,7 +1190,7 @@ static ssize_t write_maxblksize(struct file *file, char *buf, size_t size)
bsize = NFSSVC_MAXBLKSIZE;
bsize &= ~(1024-1);
mutex_lock(&nfsd_mutex);
- if (nfsd_serv && nfsd_serv->sv_nrthreads) {
+ if (nfsd_serv) {
mutex_unlock(&nfsd_mutex);
return -EBUSY;
}
WARNING: multiple messages have this Message-ID (diff)
From: "J. Bruce Fields" <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
To: Tetsuo Handa
<penguin-kernel-JPay3/Yim36HaxMnTkn67Xf5DAMn2ifp@public.gmane.org>
Cc: linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Subject: Re: linux-next NFSD: NULL pointer dereference at nfsd_svc()
Date: Fri, 6 Aug 2010 18:05:37 -0400 [thread overview]
Message-ID: <20100806220537.GE29536@fieldses.org> (raw)
In-Reply-To: <20100806212727.GC29536-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
On Fri, Aug 06, 2010 at 05:27:28PM -0400, J. Bruce Fields wrote:
> Bah, so what you were hitting was simple--I just moved the
> nfsd_reset_versions() call to the wrong place; the below should fix it.
>
> There's also a couple other bugs in the area.
This isn't a serious bug, but I think it makes sense to fix it.
--b.
commit 7fa53cc872332b265bc5ba1266f39586f218ad4a
Author: J. Bruce Fields <bfields-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Date: Fri Aug 6 18:00:33 2010 -0400
nfsd: don't allow setting maxblksize after svc created
It's harmless to set this after the server is created, but also
ineffective, since the value is only used at the time of
svc_create_pooled(). So fail the attempt, in keeping with the pattern
set by write_versions, write_{lease,grace}time and write_recoverydir.
(This could break userspace that tried to write to nfsd/max_block_size
between setting up sockets and starting the server. However, such code
wouldn't have worked anyway, and I don't know of any examples--rpc.nfsd
in nfs-utils, probably the only user of the interface, doesn't do that.)
Signed-off-by: J. Bruce Fields <bfields-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 12f0ee7..b53b1d0 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -1190,7 +1190,7 @@ static ssize_t write_maxblksize(struct file *file, char *buf, size_t size)
bsize = NFSSVC_MAXBLKSIZE;
bsize &= ~(1024-1);
mutex_lock(&nfsd_mutex);
- if (nfsd_serv && nfsd_serv->sv_nrthreads) {
+ if (nfsd_serv) {
mutex_unlock(&nfsd_mutex);
return -EBUSY;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-08-06 22:07 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-02 7:47 linux-next NFSD: NULL pointer dereference at nfsd_svc() Tetsuo Handa
2010-08-02 14:32 ` Jeff Layton
2010-08-02 14:36 ` Jeff Layton
2010-08-02 18:16 ` J. Bruce Fields
2010-08-02 18:16 ` J. Bruce Fields
2010-08-02 18:53 ` Jeff Layton
2010-08-03 1:09 ` Tetsuo Handa
2010-08-03 1:09 ` Tetsuo Handa
2010-08-03 15:48 ` J. Bruce Fields
2010-08-03 16:24 ` J. Bruce Fields
2010-08-04 0:13 ` Tetsuo Handa
2010-08-04 0:13 ` Tetsuo Handa
[not found] ` <201008040013.o740DmYK024832-etx+eQDEXHD7nzcFbJAaVXf5DAMn2ifp@public.gmane.org>
2010-08-04 19:40 ` J. Bruce Fields
2010-08-04 19:40 ` J. Bruce Fields
2010-08-05 1:10 ` Tetsuo Handa
2010-08-05 1:10 ` Tetsuo Handa
2010-08-05 20:46 ` J. Bruce Fields
2010-08-05 20:46 ` J. Bruce Fields
2010-08-05 21:31 ` J. Bruce Fields
2010-08-05 21:31 ` J. Bruce Fields
2010-08-06 1:37 ` Tetsuo Handa
2010-08-06 1:37 ` Tetsuo Handa
2010-08-06 21:27 ` J. Bruce Fields
2010-08-06 21:27 ` J. Bruce Fields
2010-08-06 22:05 ` J. Bruce Fields [this message]
2010-08-06 22:05 ` J. Bruce Fields
2010-08-06 22:10 ` J. Bruce Fields
2010-08-07 1:48 ` Tetsuo Handa
2010-08-07 1:48 ` Tetsuo Handa
2010-08-07 2:33 ` J. Bruce Fields
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=20100806220537.GE29536@fieldses.org \
--to=bfields@fieldses.org \
--cc=jlayton@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
/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.