]> git.itanic.dy.fi Git - linux-stable/commit
inet: frags: better deal with smp races
authorEric Dumazet <edumazet@google.com>
Fri, 9 Nov 2018 01:34:27 +0000 (17:34 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Nov 2018 07:19:27 +0000 (08:19 +0100)
commit59b830bf4436bdac3eace160fe1a9d7eb9e37392
treeae26dd0682de48bdbe898f29fc6dc10f4d53d780
parent039df755bd84022be5b423fb866e871b87a34ad5
inet: frags: better deal with smp races

[ Upstream commit 0d5b9311baf27bb545f187f12ecfd558220c607d ]

Multiple cpus might attempt to insert a new fragment in rhashtable,
if for example RPS is buggy, as reported by 배석진 in
https://patchwork.ozlabs.org/patch/994601/

We use rhashtable_lookup_get_insert_key() instead of
rhashtable_insert_fast() to let cpus losing the race
free their own inet_frag_queue and use the one that
was inserted by another cpu.

Fixes: 648700f76b03 ("inet: frags: use rhashtables for reassembly units")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: 배석진 <soukjin.bae@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/inet_fragment.c