From: sashiko-bot@kernel.org
To: "Michal Luczaj" <mhal@rbox.co>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf v4 4/4] selftests/bpf: Fail unbound UDP on sockmap update
Date: Tue, 07 Jul 2026 04:31:06 +0000 [thread overview]
Message-ID: <20260707043106.B1CEF1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260707-sockmap-lookup-udp-leak-v4-4-f878346f27ab@rbox.co>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Usage of the deprecated CHECK() macro in new patch code.
--
--- Patch [4]: [PATCH bpf v4 4/4] selftests/bpf: Fail unbound UDP on sockmap update ---
commit 97dab8be7b651b7cede0184ca7321b97bf080f13
Author: Michal Luczaj <mhal@rbox.co>
selftests/bpf: Fail unbound UDP on sockmap update
This commit adjusts test_maps to reflect that sockmap now rejects unbound
UDP sockets. It adds a check for the socket() return value and effectively
reverts an earlier commit.
> diff --git a/tools/testing/selftests/bpf/test_maps.c b/tools/testing/selftests/bpf/test_maps.c
> --- a/tools/testing/selftests/bpf/test_maps.c
> +++ b/tools/testing/selftests/bpf/test_maps.c
> @@ -759,16 +759,15 @@ static void test_sockmap(unsigned int tasks, void *data)
> goto out_sockmap;
> }
>
> - /* Test update with unsupported UDP socket */
> + /* Test update with unsupported unbound UDP socket */
> udp = socket(AF_INET, SOCK_DGRAM, 0);
> - i = 0;
> - err = bpf_map_update_elem(fd, &i, &udp, BPF_ANY);
> - if (err) {
> - printf("Failed socket update SOCK_DGRAM '%i:%i'\n",
> - i, udp);
> + CHECK(udp < 0, "socket(AF_INET, SOCK_DGRAM)", "errno:%d\n", errno);
[Severity: Low]
This isn't a bug, but could we use ASSERT_OK_FD() or ASSERT_GE() instead of
the deprecated CHECK() macro here?
The BPF subsystem coding guidelines prefer using the modern ASSERT_* family
of macros for new tests and updates.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260707-sockmap-lookup-udp-leak-v4-0-f878346f27ab@rbox.co?part=4
prev parent reply other threads:[~2026-07-07 4:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 4:23 [PATCH bpf v4 0/4] bpf, sockmap: Fix sockmap leaking UDP socks Michal Luczaj
2026-07-07 4:23 ` [PATCH bpf v4 1/4] selftests/bpf: Ensure UDP sockets are bound Michal Luczaj
2026-07-07 4:23 ` [PATCH bpf v4 2/4] bpf, sockmap: Reject unhashed UDP sockets on sockmap update Michal Luczaj
2026-07-07 4:53 ` sashiko-bot
2026-07-07 4:23 ` [PATCH bpf v4 3/4] selftests/bpf: Adapt sockmap update error handling Michal Luczaj
2026-07-07 4:23 ` [PATCH bpf v4 4/4] selftests/bpf: Fail unbound UDP on sockmap update Michal Luczaj
2026-07-07 4:31 ` sashiko-bot [this message]
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=20260707043106.B1CEF1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=mhal@rbox.co \
--cc=sashiko-reviews@lists.linux.dev \
/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