From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>,
Benny Halevy <bhalevy@panasas.com>,
Weston Andros Adamson <dros@netapp.com>,
Peng Tao <peng_tao@emc.com>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>
Subject: Re: [patch] NFS: null dereference in dev_remove()
Date: Tue, 13 Mar 2012 21:25:56 +0400 [thread overview]
Message-ID: <4F5F8324.30608@parallels.com> (raw)
In-Reply-To: <20120313171848.GA31808@elgon.mountain>
13.03.2012 21:18, Dan Carpenter пишет:
> In commit 5ffaf85541 "NFS: replace global bl_wq with per-net one" we
> made "msg" a pointer instead of a struct stored in stack memory. But we
> forgot to change the memset() here so we're still clearing stack memory
> instead clearing the struct like we intended. It will lead to a kernel
> crash.
>
> Signed-off-by: Dan Carpenter<dan.carpenter@oracle.com>
>
> diff --git a/fs/nfs/blocklayout/blocklayoutdm.c b/fs/nfs/blocklayout/blocklayoutdm.c
> index 30fc22a..737d839 100644
> --- a/fs/nfs/blocklayout/blocklayoutdm.c
> +++ b/fs/nfs/blocklayout/blocklayoutdm.c
> @@ -54,7 +54,7 @@ static void dev_remove(struct net *net, dev_t dev)
> dprintk("Entering %s\n", __func__);
>
> bl_pipe_msg.bl_wq =&nn->bl_wq;
> - memset(&msg, 0, sizeof(*msg));
> + memset(msg, 0, sizeof(*msg));
> msg->data = kzalloc(1 + sizeof(bl_umount_request), GFP_NOFS);
> if (!msg->data)
> goto out;
Thanks, Dan!
--
Best regards,
Stanislav Kinsbursky
prev parent reply other threads:[~2012-03-13 17:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-13 17:18 [patch] NFS: null dereference in dev_remove() Dan Carpenter
2012-03-13 17:25 ` Stanislav Kinsbursky [this message]
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=4F5F8324.30608@parallels.com \
--to=skinsbursky@parallels.com \
--cc=Trond.Myklebust@netapp.com \
--cc=bhalevy@panasas.com \
--cc=dan.carpenter@oracle.com \
--cc=dros@netapp.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=peng_tao@emc.com \
/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