* [PATCH net-next] selftests: net: netlink-dumps: validation checks
@ 2024-11-15 0:32 Jakub Kicinski
2024-11-15 14:52 ` Simon Horman
2024-11-19 3:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2024-11-15 0:32 UTC (permalink / raw)
To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski, linux-kselftest
The sanity checks are going to get silently cast to unsigned
and always pass. Cast the sizeof to signed size.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: linux-kselftest@vger.kernel.org
---
tools/testing/selftests/net/netlink-dumps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/netlink-dumps.c b/tools/testing/selftests/net/netlink-dumps.c
index 195febbf6a61..07423f256f96 100644
--- a/tools/testing/selftests/net/netlink-dumps.c
+++ b/tools/testing/selftests/net/netlink-dumps.c
@@ -185,10 +185,10 @@ TEST(test_sanity)
ASSERT_EQ(n, sizeof(dump_policies));
n = recv(netlink_sock, buf, sizeof(buf), MSG_DONTWAIT);
- ASSERT_GE(n, sizeof(struct nlmsghdr));
+ ASSERT_GE(n, (ssize_t)sizeof(struct nlmsghdr));
n = recv(netlink_sock, buf, sizeof(buf), MSG_DONTWAIT);
- ASSERT_GE(n, sizeof(struct nlmsghdr));
+ ASSERT_GE(n, (ssize_t)sizeof(struct nlmsghdr));
close(netlink_sock);
}
--
2.47.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] selftests: net: netlink-dumps: validation checks
2024-11-15 0:32 [PATCH net-next] selftests: net: netlink-dumps: validation checks Jakub Kicinski
@ 2024-11-15 14:52 ` Simon Horman
2024-11-19 3:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-11-15 14:52 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, linux-kselftest
On Thu, Nov 14, 2024 at 04:32:48PM -0800, Jakub Kicinski wrote:
> The sanity checks are going to get silently cast to unsigned
> and always pass. Cast the sizeof to signed size.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Ouch. I checked and I couldn't see any other instances of this problem
under tools/testing/selftests/net/
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] selftests: net: netlink-dumps: validation checks
2024-11-15 0:32 [PATCH net-next] selftests: net: netlink-dumps: validation checks Jakub Kicinski
2024-11-15 14:52 ` Simon Horman
@ 2024-11-19 3:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-11-19 3:00 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, linux-kselftest
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 14 Nov 2024 16:32:48 -0800 you wrote:
> The sanity checks are going to get silently cast to unsigned
> and always pass. Cast the sizeof to signed size.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: linux-kselftest@vger.kernel.org
>
> [...]
Here is the summary with links:
- [net-next] selftests: net: netlink-dumps: validation checks
https://git.kernel.org/netdev/net-next/c/357c52ff860b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-19 3:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-15 0:32 [PATCH net-next] selftests: net: netlink-dumps: validation checks Jakub Kicinski
2024-11-15 14:52 ` Simon Horman
2024-11-19 3:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).