Re: [PATCH net-next 2/2] vsock/test: Add test for null ptr deref when transport changes
From: Michal Luczaj
Date: Fri Mar 07 2025 - 04:36:07 EST
On 3/6/25 17:09, Luigi Leonardi wrote:
> Add a new test to ensure that when the transport changes a null pointer
> dereference does not occur[1].
>
> Note that this test does not fail, but it may hang on the client side if
> it triggers a kernel oops.
>
> This works by creating a socket, trying to connect to a server, and then
> executing a second connect operation on the same socket but to a
> different CID (0). This triggers a transport change. If the connect
> operation is interrupted by a signal, this could cause a null-ptr-deref.
>
> Since this bug is non-deterministic, we need to try several times. It
> is safe to assume that the bug will show up within the timeout period.
>
> If there is a G2H transport loaded in the system, the bug is not
> triggered and this test will always pass.
>
> [1]https://lore.kernel.org/netdev/Z2LvdTTQR7dBmPb5@v4bel-B760M-AORUS-ELITE-AX/
>
> Suggested-by: Michal Luczaj <mhal@xxxxxxx>
> Signed-off-by: Luigi Leonardi <leonardi@xxxxxxxxxx>
> ---
I think the credit should be given to Hyunwoo Kim, not me.
Thanks though,
Michal