[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220401142536.1948161-130-sashal@kernel.org>
Date: Fri, 1 Apr 2022 10:25:17 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Jakub Kicinski <kuba@...nel.org>,
George Shuklin <george.shuklin@...il.com>,
Sasha Levin <sashal@...nel.org>, davem@...emloft.net,
pabeni@...hat.com, idosch@...dia.com, petrm@...dia.com,
edumazet@...gle.com, yajun.deng@...ux.dev, johannes.berg@...el.com,
cong.wang@...edance.com, netdev@...r.kernel.org
Subject: [PATCH AUTOSEL 5.17 130/149] net: account alternate interface name memory
From: Jakub Kicinski <kuba@...nel.org>
[ Upstream commit 5d26cff5bdbebdf98ba48217c078ff102536f134 ]
George reports that altnames can eat up kernel memory.
We should charge that memory appropriately.
Reported-by: George Shuklin <george.shuklin@...il.com>
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
net/core/rtnetlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 2fb8eb6791e8..9c9ad3d4b766 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -3658,7 +3658,7 @@ static int rtnl_alt_ifname(int cmd, struct net_device *dev, struct nlattr *attr,
if (err)
return err;
- alt_ifname = nla_strdup(attr, GFP_KERNEL);
+ alt_ifname = nla_strdup(attr, GFP_KERNEL_ACCOUNT);
if (!alt_ifname)
return -ENOMEM;
--
2.34.1
Powered by blists - more mailing lists