pnfs-block: removing DM device maybe cause oops when call dev_remove
authorfanchaoting <fanchaoting@cn.fujitsu.com>
Thu, 21 Mar 2013 01:15:30 +0000 (09:15 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 10 Apr 2013 02:20:01 +0000 (03:20 +0100)
commit8626d723c5495ec9a276c8c13a22b374c421ba72
treec879e3b376be6363d842150dd8728617de74c84c
parent4f9347e4b59bdc29b17ff6c4b377195f208402b2
pnfs-block: removing DM device maybe cause oops when call dev_remove

commit 4376c94618c26225e69e17b7c91169c45a90b292 upstream.

when pnfs block using device mapper,if umounting later,it maybe
cause oops. we apply "1 + sizeof(bl_umount_request)" memory for
msg->data, the memory maybe overflow when we do "memcpy(&dataptr
[sizeof(bl_msg)], &bl_umount_request, sizeof(bl_umount_request))",
because the size of bl_msg is more than 1 byte.

Signed-off-by: fanchaoting<fanchaoting@cn.fujitsu.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
[bwh: Backported to 3.2:
 - In dev_remove(), msg is a structure not a pointer to it]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/nfs/blocklayout/blocklayoutdm.c