From: patchwork-bot+netdevbpf@kernel.org
To: Dairui Zhang <zhangdairui@gmail.com>
Cc: netdev@vger.kernel.org, willemb@google.com, daniel@iogearbox.net,
stable@vger.kernel.org
Subject: Re: [PATCH net v2] af_packet: fix integer overflow in prb_calc_retire_blk_tmo()
Date: Thu, 24 Sep 2026 17:50:06 +0000 [thread overview]
Message-ID: <179027220641.1681135.9631541848557905301.git-patchwork-notify@kernel.org> (raw)
In-Reply-To: <20260923050101.1510064-1-zhangdairui@gmail.com>
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 23 Sep 2026 13:01:01 +0800 you wrote:
> prb_calc_retire_blk_tmo() computes in 32-bit int arithmetic:
>
> mbits = (blk_size_in_bytes * 8) / (1024 * 1024);
>
> If I'm reading the validation right, tp_block_size is user
> controlled and packet_set_ring() only rejects values that are <= 0
> as int or not page aligned, so a 256MiB block goes right through
> (and alloc_one_pg_vec_page() even has a vzalloc fallback for it).
> 0x10000000 * 8 wraps to INT_MIN, and on a NIC reporting 1 Gbps
> (div == 1) the function ends up returning -2047.
>
> [...]
Here is the summary with links:
- [net,v2] af_packet: fix integer overflow in prb_calc_retire_blk_tmo()
https://git.kernel.org/netdev/net/c/56d82862a0a2
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
next prev parent reply other threads:[~2026-09-24 17:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 5:01 [PATCH net v2] af_packet: fix integer overflow in prb_calc_retire_blk_tmo() Dairui Zhang
2026-09-23 14:14 ` Willem de Bruijn
2026-09-24 17:50 ` patchwork-bot+netdevbpf [this message]
2026-09-25 8:02 ` netdev-bot+sashiko
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=179027220641.1681135.9631541848557905301.git-patchwork-notify@kernel.org \
--to=patchwork-bot+netdevbpf@kernel.org \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=willemb@google.com \
--cc=zhangdairui@gmail.com \
/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