Re: [PATCH -rc] workqueue: Reimplement UAF fix to avoid lockdep worning

From: Leon Romanovsky
Date: Sun Jun 02 2024 - 02:56:51 EST


On Fri, May 31, 2024 at 07:45:35AM -1000, Tejun Heo wrote:
> Hello,
>
> On Fri, May 31, 2024 at 06:48:51AM +0300, Leon Romanovsky wrote:
> > We have similar issues but with different workqueue.
>
> So, the problem with the proposed patch is that pwq may still be in use by
> then (due to async freeing) and thus can't be freed immediately. I still
> don't understand why KASAN is triggering there. I tried to repro by
> introducing a pwq alloc failure but couldn't. Can you please share the
> repro?

The repro is part of our CI test, where we run traffic tests and at the
end perform "restart driver" stage. At that stage, this lockdep is
printed.

The test is:
1. Create bond interfaces
2. Run traffic
3. Strop traffic and check that everything is OK
4. Restart driver:
modprobe -r -a bonding
modprobe -r -a vfio-pci ip_gre ip6_gre bonding geneve ipip ip6_tunnel
modprobe -r -a ib_umad ib_ipoib rdma_ucm mlx5_vfio_pci mlx5_ib mlx5_core mlx5-vfio-pci nf_tables

Thanks

>
> Thanks.
>
> --
> tejun
>