BPF List
 help / color / mirror / Atom feed
From: Martin KaFai Lau <martin.lau@linux.dev>
To: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Mykola Lysenko <mykolal@fb.com>,
	Kuniyuki Iwashima <kuni1840@gmail.com>,
	bpf@vger.kernel.org, Dan Carpenter <dan.carpenter@linaro.org>
Subject: Re: [PATCH v2 bpf-next] selftest: bpf: Remove mssind boundary check in test_tcp_custom_syncookie.c.
Date: Wed, 21 Aug 2024 23:35:18 -0700	[thread overview]
Message-ID: <6f23ff95-dce3-4ee1-b387-72adf0060b47@linux.dev> (raw)
In-Reply-To: <82ae0ebb-b56f-4a91-a5f8-65f48b4da1ce@linux.dev>

On 8/21/24 7:54 AM, Yonghong Song wrote:
> 
> On 8/20/24 6:34 PM, Kuniyuki Iwashima wrote:
>> Smatch reported a possible off-by-one in tcp_validate_cookie().
>>
>> However, it's false positive because the possible range of mssind is
>> limited from 0 to 3 by the preceding calculation.
>>
>>    mssind = (cookie & (3 << 6)) >> 6;
>>
>> Now, the verifier does not complain without the boundary check.
>> Let's remove the checks.
>>
>> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
>> Closes: https://lore.kernel.org/bpf/6ae12487-d3f1-488b-9514- 
>> af0dac96608f@stanley.mountain/
>> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
> Acked-by: Yonghong Song <yonghong.song@linux.dev>

Applied to bpf-next/net. Thanks.

      reply	other threads:[~2024-08-22  6:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21  1:34 [PATCH v2 bpf-next] selftest: bpf: Remove mssind boundary check in test_tcp_custom_syncookie.c Kuniyuki Iwashima
2024-08-21 14:54 ` Yonghong Song
2024-08-22  6:35   ` Martin KaFai Lau [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=6f23ff95-dce3-4ee1-b387-72adf0060b47@linux.dev \
    --to=martin.lau@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=daniel@iogearbox.net \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@amazon.com \
    --cc=mykolal@fb.com \
    --cc=yonghong.song@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