[Devel] [PATCH RH9 17/30] netlink: silence high-order memory allocation warning in netlink_ack

Andrey Zhadchenko andrey.zhadchenko at virtuozzo.com
Tue Sep 28 21:49:08 MSK 2021


From: Vasily Averin <vvs at virtuozzo.com>

In some cases netlink_ack() legally does high-order memory allocation.

 ------------[ cut here ]------------
 WARNING: CPU: 4 PID: 258995 at mm/page_alloc.c:3533 __alloc_pages_nodemask+0x1b1/0x600
 order 4 >= 3, gfp 0x2040d0
 Call Trace:
  [<ffffffff97c9d1ba>] __warn+0xfa/0x100
  [<ffffffff97c9d21f>] warn_slowpath_fmt+0x5f/0x80
  [<ffffffff97ddfaa1>] __alloc_pages_nodemask+0x1b1/0x600
  [<ffffffff983b4bb9>] kmalloc_large_node+0x5f/0x80
  [<ffffffff97e47ff2>] __kmalloc_node_track_caller+0x292/0x300
  [<ffffffff98272734>] __kmalloc_reserve.isra.32+0x44/0xa0
  [<ffffffff9827377d>] __alloc_skb+0x8d/0x2d0
  [<ffffffff982c80b9>] netlink_ack+0x49/0x110
  [<ffffffff97d4e267>] audit_receive+0x67/0xa0
  [<ffffffff982c7b8c>] netlink_unicast+0x1bc/0x240
  [<ffffffff982c7f5e>] netlink_sendmsg+0x34e/0x460
  [<ffffffff98269480>] sock_sendmsg+0xb0/0xf0
  [<ffffffff9826a379>] ___sys_sendmsg+0x3e9/0x400
  [<ffffffff9826ba01>] __sys_sendmsg+0x51/0x90
  [<ffffffff9826ba52>] SyS_sendmsg+0x12/0x20
  [<ffffffff983cbf92>] system_call_fastpath+0x25/0x2a

This patch disables warning generation in this case.
https://jira.sw.ru/browse/PSBM-120889
Signed-off-by: Vasily Averin <vvs at virtuozzo.com>

(cherry-picked from vz7 commit 6e0d67b80bd21a83eb5becc33ad69a7ee3074f00)
https://jira.sw.ru/browse/PSBM-127858
Signed-off-by: Valeriy Vdovin <valeriy.vdovin at virtuozzo.com>

(cherry picked from vz8 commit 0086e9b0683566341184ba4c1c54979c87a2022f)
Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
---
 net/netlink/af_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 528f4359..454110c 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2456,7 +2456,7 @@ void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err,
 	if (tlvlen)
 		flags |= NLM_F_ACK_TLVS;
 
-	skb = nlmsg_new(payload + tlvlen, GFP_KERNEL);
+	skb = nlmsg_new(payload + tlvlen, GFP_KERNEL|__GFP_ORDER_NOWARN);
 	if (!skb) {
 		NETLINK_CB(in_skb).sk->sk_err = ENOBUFS;
 		sk_error_report(NETLINK_CB(in_skb).sk);
-- 
1.8.3.1



More information about the Devel mailing list