net: add sanity check in proto_register()
Subsystems (3)
PATCH 1/1 net: add sanity check in proto_register()
From: Eric Dumazet <[email protected]>
prot->memory_allocated should only be set if prot->sysctl_mem is also set.
This is a followup of commit 25206111512d ("crypto: af_alg - get rid of alg_memory_allocated").
Signed-off-by Eric Dumazet <[email protected]>
--- net/core/sock.c | 4 ++++ 1 file changed, 4 insertions(+)
net/core/sock.c +4 -0
@@ -3718,6 +3718,10 @@ int proto_register(struct proto *prot, int alloc_slab) {int ret = -ENOBUFS ; +if (prot->memory_allocated && !prot->sysctl_mem) { +pr_err ("%s: missing sysctl_mem\n" , prot->name); +return -EINVAL ; + }if (alloc_slab) { prot->slab = kmem_cache_create_usercopy(prot->name, prot->obj_size, 0,
Signature · 1 line
2.35.1.265.g69c8d7142f-goog
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Wed, 16 Feb 2022 09:18:01 -0800 you wrote:
From: Eric Dumazet <[email protected]>
prot->memory_allocatedshould only be set ifprot->sysctl_memis also set.This is a followup of commit
25206111512d("crypto:af_alg- get rid ofalg_memory_allocated").[...]
Here is the summary with links:
- [net-next] net: add sanity check in proto_register()
https://git.kernel.org/netdev/net-next/c/f20cfd662a62
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html