From: Mina Almasry <almasrymina@google.com>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org
Cc: Mina Almasry <almasrymina@google.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Jesper Dangaard Brouer <hawk@kernel.org>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Shuah Khan <shuah@kernel.org>
Subject: [PATCH net-next v1 7/7] ncdevmem: add test for too many token_count
Date: Tue, 29 Oct 2024 20:55:22 +0000 [thread overview]
Message-ID: <20241029205524.1306364-3-almasrymina@google.com> (raw)
In-Reply-To: <20241029205524.1306364-1-almasrymina@google.com>
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 <almasrymina@google.com>
---
tools/testing/selftests/net/ncdevmem.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tools/testing/selftests/net/ncdevmem.c b/tools/testing/selftests/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;
}
+ token.token_start = dmabuf_cmsg->frag_token;
+ token.token_count = 8192;
+
+ ret = setsockopt(client_fd, SOL_SOCKET,
+ SO_DEVMEM_DONTNEED, &token,
+ sizeof(token));
+ if (ret >= 0)
+ error(1, 0,
+ "DONTNEED of too many frags should have failed. ret=%ld\n",
+ ret);
+
token.token_start = dmabuf_cmsg->frag_token;
token.token_count = 1;
--
2.47.0.163.g1226f6d8fa-goog
next prev parent reply other threads:[~2024-10-29 20:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-29 20:55 [PATCH net-next v1 0/7] devmem TCP fixes Mina Almasry
2024-10-29 20:55 ` [PATCH net-next v1 6/7] net: fix SO_DEVMEM_DONTNEED looping too long Mina Almasry
2024-10-30 14:33 ` Stanislav Fomichev
2024-10-30 14:46 ` Mina Almasry
2024-10-30 15:06 ` Stanislav Fomichev
2024-11-05 21:28 ` Mina Almasry
2024-11-05 21:46 ` Stanislav Fomichev
2024-11-05 23:43 ` Mina Almasry
2024-11-06 0:13 ` Stanislav Fomichev
2024-10-29 20:55 ` Mina Almasry [this message]
2024-11-01 2:41 ` [PATCH net-next v1 0/7] devmem TCP fixes Jakub Kicinski
2024-11-01 13:14 ` Mina Almasry
2024-11-02 2:27 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241029205524.1306364-3-almasrymina@google.com \
--to=almasrymina@google.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox