io_uring/zcrx: fix leaks on failed registration
Subsystems (2)
Pavel Begunkov
maintainerPATCH 1/1 io_uring/zcrx: fix leaks on failed registration
If we try to register a device-less interface like veth, io_register_zcrx_ifq() will leak struct io_zcrx_ifq with a bunch of resources attached to it. Fix that.
Fixes 9fd13751abf5f ("io_uring/zcrx: grab a net device")
Reported-by kernel test robot <[email protected]>
Reported-by Dan Carpenter <[email protected]>
Signed-off-by Pavel Begunkov <[email protected]>
--- io_uring/zcrx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
io_uring/zcrx.c +2 -1
@@ -388,8 +388,9 @@ int io_register_zcrx_ifq(struct io_ring_ctx *ctx, goto err; ifq->dev = ifq->netdev->dev.parent; + ret = -EOPNOTSUPP ;if (!ifq->dev) -return -EOPNOTSUPP ; + goto err;get_device (ifq->dev); ret =io_zcrx_map_area (ifq, ifq->area);
Signature · 1 line
2.48.1
Quoted 5 lines · Pavel Begunkov
If we try to register a device-less interface like veth,
io_register_zcrx_ifq()will leak structio_zcrx_ifqwith a bunch of resources attached to it. Fix that.
Applied, thanks!
[1/1] io_uring/zcrx: fix leaks on failed registration
commit: f6977b06c598eab1db7416476452cf260208dbb0
Best regards,
Signature · 1 line
Jens Axboe