From 3ce17f71e42f813a875744b625c3dc4eaf91f954 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Mon, 10 Apr 2017 19:39:51 +0900 Subject: [PATCH] net: nfs: fix the regression when nfs_read_reply() is called 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 --- net/nfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/nfs.c b/net/nfs.c index 83ed0a7c37..9450742512 100644 --- 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; -- 2.34.1