diff mbox series

[net] ipfrag: really prevent allocation on netns exit

Message ID 9e1410de1efa471f4824cc21b07908cc9a74297d.1530872944.git.pabeni@redhat.com
State Accepted, archived
Delegated to: David Miller
Headers show
Series [net] ipfrag: really prevent allocation on netns exit | expand

Commit Message

Paolo Abeni July 6, 2018, 10:30 a.m. UTC
Setting the low threshold to 0 has no effect on frags allocation,
we need to clear high_thresh instead.

The code was pre-existent to commit 648700f76b03 ("inet: frags:
use rhashtables for reassembly units"), but before the above,
such assignment had a different role: prevent concurrent eviction
from the worker and the netns cleanup helper.

Fixes: 648700f76b03 ("inet: frags: use rhashtables for reassembly units")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/ipv4/inet_fragment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller July 8, 2018, 4:06 a.m. UTC | #1
From: Paolo Abeni <pabeni@redhat.com>
Date: Fri,  6 Jul 2018 12:30:20 +0200

> Setting the low threshold to 0 has no effect on frags allocation,
> we need to clear high_thresh instead.
> 
> The code was pre-existent to commit 648700f76b03 ("inet: frags:
> use rhashtables for reassembly units"), but before the above,
> such assignment had a different role: prevent concurrent eviction
> from the worker and the netns cleanup helper.
> 
> Fixes: 648700f76b03 ("inet: frags: use rhashtables for reassembly units")
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Applied and queued up for -stable, thanks!
diff mbox series

Patch

diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c
index c9e35b81d093..1e4cf3ab560f 100644
--- a/net/ipv4/inet_fragment.c
+++ b/net/ipv4/inet_fragment.c
@@ -90,7 +90,7 @@  static void inet_frags_free_cb(void *ptr, void *arg)
 
 void inet_frags_exit_net(struct netns_frags *nf)
 {
-	nf->low_thresh = 0; /* prevent creation of new frags */
+	nf->high_thresh = 0; /* prevent creation of new frags */
 
 	rhashtable_free_and_destroy(&nf->rhashtable, inet_frags_free_cb, NULL);
 }