]> git.baikalelectronics.ru Git - kernel.git/commit
xdp: obtain the mem_id mutex before trying to remove an entry.
authorJonathan Lemon <jonathan.lemon@gmail.com>
Tue, 3 Dec 2019 22:01:14 +0000 (14:01 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Dec 2019 00:35:18 +0000 (16:35 -0800)
commit77d9bbe613f53856c7dfd895a38e311667209bdd
tree934806f44fc30fbc7412522e016c09b639bd805f
parent6c5b5ef06df8f88593bf9b0e5e4d6f46c95d4657
xdp: obtain the mem_id mutex before trying to remove an entry.

A lockdep splat was observed when trying to remove an xdp memory
model from the table since the mutex was obtained when trying to
remove the entry, but not before the table walk started:

Fix the splat by obtaining the lock before starting the table walk.

Fixes: 696a01de16dd ("page_pool: do not release pool until inflight == 0.")
Reported-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Tested-by: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/xdp.c