* [PATCH net-next] keys, dns: Use kmalloc_flex to improve dns_resolver_preparse
@ 2026-02-26 21:49 Thorsten Blum
2026-02-28 16:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-02-26 21:49 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman
Cc: linux-hardening, Thorsten Blum, netdev, linux-kernel
Use kmalloc_flex() when allocating a new 'struct user_key_payload' in
dns_resolver_preparse() to replace the open-coded size arithmetic.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
net/dns_resolver/dns_key.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/dns_resolver/dns_key.c b/net/dns_resolver/dns_key.c
index c42ddd85ff1f..891287a86979 100644
--- a/net/dns_resolver/dns_key.c
+++ b/net/dns_resolver/dns_key.c
@@ -215,7 +215,7 @@ dns_resolver_preparse(struct key_preparsed_payload *prep)
kdebug("store result");
prep->quotalen = result_len;
- upayload = kmalloc(sizeof(*upayload) + result_len + 1, GFP_KERNEL);
+ upayload = kmalloc_flex(*upayload, data, result_len + 1);
if (!upayload) {
kleave(" = -ENOMEM");
return -ENOMEM;
--
Thorsten Blum <thorsten.blum@linux.dev>
GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net-next] keys, dns: Use kmalloc_flex to improve dns_resolver_preparse
2026-02-26 21:49 [PATCH net-next] keys, dns: Use kmalloc_flex to improve dns_resolver_preparse Thorsten Blum
@ 2026-02-28 16:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-02-28 16:50 UTC (permalink / raw)
To: Thorsten Blum
Cc: davem, edumazet, kuba, pabeni, horms, linux-hardening, netdev,
linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 26 Feb 2026 22:49:29 +0100 you wrote:
> Use kmalloc_flex() when allocating a new 'struct user_key_payload' in
> dns_resolver_preparse() to replace the open-coded size arithmetic.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> net/dns_resolver/dns_key.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [net-next] keys, dns: Use kmalloc_flex to improve dns_resolver_preparse
https://git.kernel.org/netdev/net-next/c/a9a13c7379ec
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-28 16:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-26 21:49 [PATCH net-next] keys, dns: Use kmalloc_flex to improve dns_resolver_preparse Thorsten Blum
2026-02-28 16:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox