diff mbox series

[net-next] net: mctp: test: Use correct skb for route input check

Message ID 20240816-mctp-kunit-skb-fix-v1-1-3c367ac89c27@codeconstruct.com.au (mailing list archive)
State Accepted
Commit ce335db0621648472f9bb4b7191eb2e13a5793cf
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: mctp: test: Use correct skb for route input check | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 7 this patch: 7
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 7 this patch: 7
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 7 this patch: 7
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-16--21-00 (tests: 710)

Commit Message

Jeremy Kerr Aug. 16, 2024, 10:29 a.m. UTC
In the MCTP route input test, we're routing one skb, then (when delivery
is expected) checking the resulting routed skb.

However, we're currently checking the original skb length, rather than
the routed skb. Check the routed skb instead; the original will have
been freed at this point.

Fixes: 8892c0490779 ("mctp: Add route input to socket tests")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/kernel-janitors/4ad204f0-94cf-46c5-bdab-49592addf315@kili.mountain/
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
---
 net/mctp/test/route-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


---
base-commit: 34afb82a3c67f869267a26f593b6f8fc6bf35905
change-id: 20240816-mctp-kunit-skb-fix-513710d79cb5

Best regards,

Comments

Simon Horman Aug. 16, 2024, 5:18 p.m. UTC | #1
On Fri, Aug 16, 2024 at 06:29:17PM +0800, Jeremy Kerr wrote:
> In the MCTP route input test, we're routing one skb, then (when delivery
> is expected) checking the resulting routed skb.
> 
> However, we're currently checking the original skb length, rather than
> the routed skb. Check the routed skb instead; the original will have
> been freed at this point.
> 
> Fixes: 8892c0490779 ("mctp: Add route input to socket tests")
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/kernel-janitors/4ad204f0-94cf-46c5-bdab-49592addf315@kili.mountain/
> Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>

Reviewed-by: Simon Horman <horms@kernel.org>
patchwork-bot+netdevbpf@kernel.org Aug. 20, 2024, 1 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 16 Aug 2024 18:29:17 +0800 you wrote:
> In the MCTP route input test, we're routing one skb, then (when delivery
> is expected) checking the resulting routed skb.
> 
> However, we're currently checking the original skb length, rather than
> the routed skb. Check the routed skb instead; the original will have
> been freed at this point.
> 
> [...]

Here is the summary with links:
  - [net-next] net: mctp: test: Use correct skb for route input check
    https://git.kernel.org/netdev/net/c/ce335db06216

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/mctp/test/route-test.c b/net/mctp/test/route-test.c
index 77e5dd422258..8551dab1d1e6 100644
--- a/net/mctp/test/route-test.c
+++ b/net/mctp/test/route-test.c
@@ -366,7 +366,7 @@  static void mctp_test_route_input_sk(struct kunit *test)
 
 		skb2 = skb_recv_datagram(sock->sk, MSG_DONTWAIT, &rc);
 		KUNIT_EXPECT_NOT_ERR_OR_NULL(test, skb2);
-		KUNIT_EXPECT_EQ(test, skb->len, 1);
+		KUNIT_EXPECT_EQ(test, skb2->len, 1);
 
 		skb_free_datagram(sock->sk, skb2);