netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Jay Vosburgh <jay.vosburgh@canonical.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Andy Gospodarek <andy@greyhouse.net>,
	Ding Tianhong <dingtianhong@huawei.com>,
	Hangbin Liu <liuhangbin@gmail.com>,
	Sam Sun <samsun1006219@gmail.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net v5] bonding: Fix out-of-bounds read in bond_option_arp_ip_targets_set()
Date: Tue, 2 Jul 2024 14:44:47 +0100	[thread overview]
Message-ID: <20240702134447.GA616664@kernel.org> (raw)
In-Reply-To: <20240701195908.06f8edc3@kernel.org>

On Mon, Jul 01, 2024 at 07:59:08PM -0700, Jakub Kicinski wrote:
> On Mon, 01 Jul 2024 16:07:46 -0700 Jay Vosburgh wrote:
> > >	if (strlen(newval->string) < 1 ||  
> > 
> > 	I find the second option clearer, FWIW.  This isn't in a hot
> > path, and including strlen() in there makes it more obvious to my
> > reading what the intent is.  The size_t return from strlen() is
> > unsigned, so we really want to test the return value for zero-ness.
> 
> True, I picked < 1 because the line below offsets by 1.
> Either way is fine, but lets make sure we drop the parenthesis.

Thanks, I will go with < 1.

      reply	other threads:[~2024-07-02 13:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-30 13:20 [PATCH net v5] bonding: Fix out-of-bounds read in bond_option_arp_ip_targets_set() 'Simon Horman'
2024-06-30 18:20 ` Jay Vosburgh
2024-07-01  0:57 ` Hangbin Liu
2024-07-01 21:32 ` Jakub Kicinski
2024-07-01 23:07   ` Jay Vosburgh
2024-07-02  2:59     ` Jakub Kicinski
2024-07-02 13:44       ` Simon Horman [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=20240702134447.GA616664@kernel.org \
    --to=horms@kernel.org \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=dingtianhong@huawei.com \
    --cc=edumazet@google.com \
    --cc=jay.vosburgh@canonical.com \
    --cc=kuba@kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=samsun1006219@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;
as well as URLs for NNTP newsgroup(s).