Skip to content

Commit

Permalink
NFS: null dereference in dev_remove()
Browse files Browse the repository at this point in the history
In commit 5ffaf85 "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>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Dan Carpenter authored and Trond Myklebust committed Mar 13, 2012
1 parent 9a3ba43 commit e138ead
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/blocklayout/blocklayoutdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e138ead

Please sign in to comment.