From nobody Mon Nov 25 06:24:33 2024 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72310209664 for ; Tue, 29 Oct 2024 20:55:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730235334; cv=none; b=X08EDsoO8XiBvco8Pxank3LsSh4jbWCxXLhvsNALbUSwV/dQ+aVd81oMQgtK1gnR0lH9e6oc082F3ibTnxkjdaFR3qhVb5sqlL61DC/nyOtaU8qMLF/HjchecgKo8045bmIjPDjIaqgA7FmX9Ac5+qHXPP73tWhIq+LlQZdYXhc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730235334; c=relaxed/simple; bh=NpiPjVlAleIs97JWrTTn4QJPsC0BpJIKw9WCJk+Z79w=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=qDD+eVer122x9bJeKBq9fcy802hGH3LmLiuHBqkpxVKEMMtkeD3GDrufaTEy0uFwblczH4QVWhxtTSJ/gtCoffJxhjGi1eB9DG/fGaAbF8I/1iMVg2nWdPfLHsXhuoBYYuLmCwUlSIecpR/72+t/MjLsLkEOU53HL4+ayLpDyAE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--almasrymina.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=g3CCQu6V; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--almasrymina.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="g3CCQu6V" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-e292dbfd834so9612578276.3 for ; Tue, 29 Oct 2024 13:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1730235331; x=1730840131; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=DtLM3BZMi5MIdFZN9lcNyhV6lseOB34DRhYH9xsg+Ww=; b=g3CCQu6VO4Ch+qwjkBGjxW2sSO1t5E9ViI4Q4t9LbNK9mBzd9gedI0pQh9SZ+qLcdS vXwLzlOR7Y2/RcC+qDMXcUrksdvnVJJzkt19/yfDnERR8JcXLouEgmgK8ShEvAxNARZl aHtQToG2wTNa90TG1J8JmJTPHgA7Y+QIXmqTXMBQmD32x818gu8PTzlfKO5qIhAEw6Bv KXhtH8kcNEWcjNfS5iel+R1v0krw5ya9EQ0FOpNuSpopoFv0qjAd6xOAo81PQFKD2KeU pWMu35EtbV3A0B5HNKdmGXcEmmVy0UVSISYTNqMv4PTe/Kk+vVNmDsMpnTTQ1RnqWDoW iqtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730235331; x=1730840131; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DtLM3BZMi5MIdFZN9lcNyhV6lseOB34DRhYH9xsg+Ww=; b=vDT8djVpXZ0GwUetdji86IDkpFZxUwyTPtVwdegOQxlAL4uVdm8llN1W+CcVE7LuBw UWwzaUBwdwuNbGLs8+Tb0sR17e0Zi/Xf/lDsfvyloE2qSr3bphoUgxx6Yme87QGZC/Bf IS6zU9ligG7DOgilmjfczzB7us/ttAO6hwmR5EqiN9ZROEshWz+0zy1kuF+7cfLY83fi rgeY3yPXkhchkseI4tPqRyeAsfJWqeM0aTiTyrOuz0H2jmnlsoM+0ttv0PXV6QymQTn0 x0aO1lJNlxHC6o5k6hiz5OuQ5ESQ/ZknvOvg4DMbEU/91tjR+ZbNZFR74HLL+P7rTab2 wo7Q== X-Forwarded-Encrypted: i=1; AJvYcCWHIr7lICSj4Li/R5K0gEOsTLiGJNnei6ara01z2knMhLIklAFJWzZ4ttcIhFx8DR2wKrmJTzE8xMt2UQY=@vger.kernel.org X-Gm-Message-State: AOJu0YyVuPmjFc9vSL7Jf9Zoem8qW247VxJoI8wYKL6B2xyjL0370RlJ GeaRkPv9oOrL+L6jBgVgN6LnpY/I5+uQRN2ncW6/FjnP9gszHfJAhmNSMNKnyH8/5+qEFPeEyZb 6GiXdPYScXPa5rb1poYU/TQ== X-Google-Smtp-Source: AGHT+IFn71lHuPHiTD9RgndIXcKae2ZOCG2qnAN6B+/dPZ7/I2Uz1eJaAxX4qOtQrBvdw/LPXzQJ1QqhI/OPErXQEQ== X-Received: from almasrymina.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:4bc5]) (user=almasrymina job=sendgmr) by 2002:a25:c78a:0:b0:e17:8e4f:981a with SMTP id 3f1490d57ef6-e3087c2d8b1mr69575276.11.1730235331689; Tue, 29 Oct 2024 13:55:31 -0700 (PDT) Date: Tue, 29 Oct 2024 20:55:22 +0000 In-Reply-To: <20241029205524.1306364-1-almasrymina@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241029205524.1306364-1-almasrymina@google.com> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog Message-ID: <20241029205524.1306364-3-almasrymina@google.com> Subject: [PATCH net-next v1 7/7] ncdevmem: add test for too many token_count From: Mina Almasry To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: Mina Almasry , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Jesper Dangaard Brouer , Ilias Apalodimas , Shuah Khan Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add test for fixed issue: user passing a token with a very large token_count. Expect an error in this case. Signed-off-by: Mina Almasry --- tools/testing/selftests/net/ncdevmem.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/testing/selftests/net/ncdevmem.c b/tools/testing/selftes= ts/net/ncdevmem.c index 64d6805381c5..3fd2aee461f3 100644 --- a/tools/testing/selftests/net/ncdevmem.c +++ b/tools/testing/selftests/net/ncdevmem.c @@ -391,6 +391,17 @@ int do_server(void) continue; } =20 + token.token_start =3D dmabuf_cmsg->frag_token; + token.token_count =3D 8192; + + ret =3D setsockopt(client_fd, SOL_SOCKET, + SO_DEVMEM_DONTNEED, &token, + sizeof(token)); + if (ret >=3D 0) + error(1, 0, + "DONTNEED of too many frags should have failed. ret=3D%ld\n", + ret); + token.token_start =3D dmabuf_cmsg->frag_token; token.token_count =3D 1; =20 --=20 2.47.0.163.g1226f6d8fa-goog