net: nfs: fix the regression when nfs_read_reply() is called
authorJaehoon Chung <jh80.chung@samsung.com>
Mon, 10 Apr 2017 10:39:51 +0000 (19:39 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 11 Apr 2017 09:58:19 +0000 (18:58 +0900)
When nfs_read_reply() is called, it should be stucked in memcpy().
size of rpc_pkt.u.reply() might be too bigger.
Change from 'sizeof(rpc_pkt.u.reply)' to 'len'.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
net/nfs.c

index 83ed0a7c37c9af87b918f15e018853d70fb63d17..94507425122fde8b390dc39028f7a8d3b1b79d8b 100644 (file)
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -660,7 +660,7 @@ static int nfs_read_reply(uchar *pkt, unsigned len)
 
        debug("%s\n", __func__);
 
-       memcpy(&rpc_pkt.u.data[0], pkt, sizeof(rpc_pkt.u.reply));
+       memcpy(&rpc_pkt.u.data[0], pkt, len);
 
        if (ntohl(rpc_pkt.u.reply.id) > rpc_id)
                return -NFS_RPC_ERR;