[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241105062107.64837-1-kuniyu@amazon.com>
Date: Mon, 4 Nov 2024 22:21:07 -0800
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <kuba@...nel.org>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <johannes@...solutions.net>,
<netdev@...r.kernel.org>, <pabeni@...hat.com>, <pablo@...filter.org>,
<kuniyu@...zon.com>
Subject: Re: [PATCH net 2/2] selftests: net: add a test for closing a netlink socket ith dump in progress
From: Jakub Kicinski <kuba@...nel.org>
Date: Mon, 4 Nov 2024 17:03:47 -0800
> Close a socket with dump in progress. We need a dump which generates
> enough info not to fit into a single skb. Policy dump fits the bill.
>
> Use the trick discovered by syzbot for keeping a ref on the socket
> longer than just close, with mqueue.
>
> TAP version 13
> 1..3
> # Starting 3 tests from 1 test cases.
> # RUN global.test_sanity ...
> # OK global.test_sanity
> ok 1 global.test_sanity
> # RUN global.close_in_progress ...
> # OK global.close_in_progress
> ok 2 global.close_in_progress
> # RUN global.close_with_ref ...
> # OK global.close_with_ref
> ok 3 global.close_with_ref
> # PASSED: 3 / 3 tests passed.
> # Totals: pass:3 fail:0 xfail:0 xpass:0 skip:0 error:0
>
> Note that this test is not expected to fail but rather crash
> the kernel if we get the cleanup wrong.
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@...zon.com>
TIL mq_notify, and the trick was interesting that calls fdget(),
netlink_getsockbyfilp(), and fdput() to keep sock_hold() only :)
Powered by blists - more mailing lists