From: Stefano Brivio <sbrivio@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top, Johannes Bartunek <contact@jbartunek.de>,
Jon Maloy <jmaloy@redhat.com>
Subject: Re: [PATCH] Fix assert() in tcp_vu_sock_recv()
Date: Tue, 17 Nov 2026 12:04:14 +0100 (CET) [thread overview]
Message-ID: <20261117120413.64f7a15b@elisabeth> (raw)
In-Reply-To: <20261116132119.1545654-1-lvivier@redhat.com>
On Mon, 16 Nov 2026 14:21:19 +0100
Laurent Vivier <lvivier@redhat.com> wrote:
> In tcp_vu_sock_recv(), iov_tail_clone() can copy up to
> ARRAY_SIZE(iov_msg) - j entries so the assert must allow
> ARRAY_SIZE(iov_msg) - j as valid a value.
>
> Reported-by: Johannes Bartunek <contact@jbartunek.de>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> tcp_vu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tcp_vu.c b/tcp_vu.c
> index 868a35b968e1..c83abd69d3d7 100644
> --- a/tcp_vu.c
> +++ b/tcp_vu.c
> @@ -291,7 +291,7 @@ static ssize_t tcp_vu_sock_recv(const struct ctx *c, struct vu_virtq *vq,
>
> cnt = iov_tail_clone(&iov_msg[j], ARRAY_SIZE(iov_msg) - j,
> &data);
> - assert(cnt < ARRAY_SIZE(iov_msg) - j);
> + assert(cnt <= ARRAY_SIZE(iov_msg) - j);
> if (cnt < 0)
> die("Missing entries in iov_msg");
>
Applied.
--
Stefano
prev parent reply other threads:[~2026-11-17 11:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 13:21 Laurent Vivier
2026-11-17 11:04 ` Stefano Brivio [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=20261117120413.64f7a15b@elisabeth \
--to=sbrivio@redhat.com \
--cc=contact@jbartunek.de \
--cc=jmaloy@redhat.com \
--cc=lvivier@redhat.com \
--cc=passt-dev@passt.top \
/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.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
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 IMAP folder(s).