All of lore.kernel.org
 help / color / mirror / Atom feed
From: willemb@google.com
To: mdshahid03@gmail.com, edumazet@google.com, ncardwell@google.com,
	 kuniyu@google.com, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com
Cc: horms@kernel.org, netdev@vger.kernel.org,
	 Mohammad Shahid <mdshahid03@gmail.com>
Subject: Re: [PATCH] tcp: fix division by zero in tcp_cong_avoid_ai()
Date: Wed, 25 Nov 2026 20:48:12 -0500	[thread overview]
Message-ID: <willemb.2909963e120e6@google.com> (raw)
In-Reply-To: <20261120122348.207708-1-mdshahid03@gmail.com>

mdshahid03@ wrote:
> From: Mohammad Shahid <mdshahid03@gmail.com>

> The tcp_cong_avoid_ai() function divides snd_cwnd_cnt by the
> argument w without checking whether w is zero.

> Since w is an unsigned value, the condition tp->snd_cwnd_cnt
> >=w does not prevent division by zero when w is zero.

> This function is also exposed as BPF kfunc, and the BPF
> verifier does not enforce a nonzero value for this argunement

> Return early when w is zero to avoid divison by zero.

> Signed-off-by: Mohammad Shahid <mdshahid03@gmail.com>

Please resubmit, with

- A target tree: [PATCH net]

- A Fixes tag, likely e78aea8b2170 ("bpf: tcp: Put some tcp cong functions  
in allowlist for bpf-tcp-cc")

- Commit message typos addressed and core of your response merged into
the main commit.

- Cc also bpf@vger.kernel.org

--

pw-bot: cr

      parent reply	other threads:[~2026-11-26  1:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 12:23 [PATCH] tcp: fix division by zero in tcp_cong_avoid_ai() mdshahid03
2026-11-20 12:27 ` netdev-bot+sinfo
2026-11-21 17:21   ` mdshahid03
2026-11-24 12:53     ` mdshahid03
2026-11-26  1:48 ` willemb [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=willemb.2909963e120e6@google.com \
    --to=willemb@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=mdshahid03@gmail.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 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.