xfrm/compat: Don't allocate memory with __GFP_ZERO
authorDmitry Safonov <dima@arista.com>
Mon, 2 Nov 2020 16:14:47 +0000 (16:14 +0000)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 9 Nov 2020 06:34:56 +0000 (07:34 +0100)
32-bit to 64-bit messages translator zerofies needed paddings in the
translation, the rest is the actual payload.
Don't allocate zero pages as they are not needed.

Fixes: 5106f4a8acff ("xfrm/compat: Add 32=>64-bit messages translator")
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_compat.c

index 556e9f33b815a45b8960a6956c58f2a64398648e..d8e8a11ca845e3603680c61aa0dc3a9b2ecfefe2 100644 (file)
@@ -564,7 +564,7 @@ static struct nlmsghdr *xfrm_user_rcv_msg_compat(const struct nlmsghdr *h32,
                return NULL;
 
        len += NLMSG_HDRLEN;
-       h64 = kvmalloc(len, GFP_KERNEL | __GFP_ZERO);
+       h64 = kvmalloc(len, GFP_KERNEL);
        if (!h64)
                return ERR_PTR(-ENOMEM);