All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masoud Aghasi <maghasi@disroot.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, Andrii Nakryiko <andrii@kernel.org>,
	Eduard <eddyz87@gmail.com>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Jiri Olsa <jolsa@kernel.org>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	Ihor Solodrai <ihor.solodrai@linux.dev>,
	John Fastabend <john.fastabend@gmail.com>,
	Brian Vazquez <brianvv@google.com>
Subject: Re: [PATCH v3] bpf: Fix u32 overflow issue in map batch operations
Date: Mon, 7 Sep 2026 00:34:45 +0100	[thread overview]
Message-ID: <da7d3192-a275-4d6a-bf9c-525bdbb6c9fa@disroot.org> (raw)
In-Reply-To: <CAADnVQLX5bjLTPm8Ch0wNuojHrKw6R5iJDBRsMJwrWMSupVwew@mail.gmail.com>

On 04/09/2026 05:45, Alexei Starovoitov wrote:
> On Thu, Sep 3, 2026 at 1:28 AM Masoud Aghasi <maghasi@disroot.org> wrote:
>>
>> Several map batch operation implementations such as
>> generic_map_lookup_batch() use calculations in the form of
>> "values + cp * map->value_size" to compute the desired userspace memory
>> address for reading or writing. This can overflow the u32 type
>> (the result of "cp * map->value_size") when the map size exceeds 4GB.
>>
>> generic_map_lookup_batch() may corrupt values for some keys in
>> userspace memory, and in some cases it mismatches values for some keys
>> while still reporting success.
> 
> without selftest I have to assume that this is AI hallucination.
> 
> pw-bot: cr

And here is the output of the same test after patching the kernel:
$ sudo ./test_progs -t map_batch_overflow
#212/1   map_batch_overflow/array_lookup:OK
#212/2   map_batch_overflow/array_lookup_4gb_plus:OK
#212/3   map_batch_overflow/array_update:OK
#212/4   map_batch_overflow/array_update_4gb_plus:OK
#212     map_batch_overflow:OK
Summary: 1/4 PASSED, 0 SKIPPED, 0 FAILED

Sorry for replying in multiple emails.

  parent reply	other threads:[~2026-09-06 23:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 11:31 [PATCH] bpf: Fix u32 overflow issue in map batch operations Masoud Aghasi
2026-08-24 11:42 ` sashiko-bot
2026-08-25 10:21   ` Masoud Aghasi
2026-09-02 20:44     ` [PATCH v2] " Masoud Aghasi
2026-09-02 21:50       ` bot+bpf-ci
2026-09-03  8:27       ` [PATCH v3] " Masoud Aghasi
2026-09-03  8:45         ` sashiko-bot
2026-09-03 12:31           ` Masoud Aghasi
2026-09-04  4:45         ` Alexei Starovoitov
2026-09-04 13:19           ` Masoud Aghasi
2026-09-06 22:42           ` Masoud Aghasi
2026-09-06 23:34           ` Masoud Aghasi [this message]
2026-08-24 12:17 ` [PATCH] " bot+bpf-ci
2026-08-24 19:15 ` Masoud Aghasi

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=da7d3192-a275-4d6a-bf9c-525bdbb6c9fa@disroot.org \
    --to=maghasi@disroot.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brianvv@google.com \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=song@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.