From: Peter Seiderer <ps.report@gmx.net>
To: Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH net-next v4 00/17] Some pktgen fixes/improvments
Date: Tue, 11 Feb 2025 10:36:39 +0100 [thread overview]
Message-ID: <20250211103639.531a2baa@gmx.net> (raw)
In-Reply-To: <20250206135154.GB641369@kernel.org>
Hello Simon,
On Thu, 6 Feb 2025 13:51:54 +0000, Simon Horman <horms@kernel.org> wrote:
> On Wed, Feb 05, 2025 at 02:11:36PM +0100, Peter Seiderer wrote:
> > hile taking a look at '[PATCH net] pktgen: Avoid out-of-range in
> > get_imix_entries' ([1]) and '[PATCH net v2] pktgen: Avoid out-of-bounds access
> > in get_imix_entries' ([2], [3]) and doing some tests and code review I
> > detected that the /proc/net/pktgen/... parsing logic does not honour the
> > user given buffer bounds (resulting in out-of-bounds access).
> >
> > This can be observed e.g. by the following simple test (sometimes the
> > old/'longer' previous value is re-read from the buffer):
> >
> > $ echo add_device lo@0 > /proc/net/pktgen/kpktgend_0
> >
> > $ echo "min_pkt_size 12345" > /proc/net/pktgen/lo\@0 && grep min_pkt_size /proc/net/pktgen/lo\@0
> > Params: count 1000 min_pkt_size: 12345 max_pkt_size: 0
> > Result: OK: min_pkt_size=12345
> >
> > $ echo -n "min_pkt_size 123" > /proc/net/pktgen/lo\@0 && grep min_pkt_size /proc/net/pktgen/lo\@0
> > Params: count 1000 min_pkt_size: 12345 max_pkt_size: 0
> > Result: OK: min_pkt_size=12345
> >
> > $ echo "min_pkt_size 123" > /proc/net/pktgen/lo\@0 && grep min_pkt_size /proc/net/pktgen/lo\@0
> > Params: count 1000 min_pkt_size: 123 max_pkt_size: 0
> > Result: OK: min_pkt_size=123
> >
> > So fix the out-of-bounds access (and some minor findings) and add a simple
> > proc_net_pktgen selftest...
> >
> > Regards,
> > Peter
> >
> > Changes v3 -> v4:
> > - add rev-by Simon Horman
> > - new patch 'net: pktgen: use defines for the various dec/hex number parsing
> > digits lengths' (suggested by Simon Horman)
> > - replace C99 comment (suggested by Paolo Abeni)
> > - drop available characters check in strn_len() (suggested by Paolo Abeni)
> > - factored out patch 'net: pktgen: align some variable declarations to the
> > most common pattern' (suggested by Paolo Abeni)
> > - factored out patch 'net: pktgen: remove extra tmp variable (re-use len
> > instead)' (suggested by Paolo Abeni)
> > - factored out patch 'net: pktgen: remove some superfluous variable
> > initializing' (suggested by Paolo Abeni)
> > - factored out patch 'net: pktgen: fix mpls maximum labels list parsing'
> > (suggested by Paolo Abeni)
> > - factored out 'net: pktgen: hex32_arg/num_arg error out in case no
> > characters are available' (suggested by Paolo Abeni)
> > - factored out 'net: pktgen: num_arg error out in case no valid character
> > is parsed' (suggested by Paolo Abeni)
>
> Hi Peter,
>
> Thanks for splitting up the patchset some more, I for one find it much
> easier to review them in this form.
Definitely!
>
> That said, we are now over the preferred maximum of 15 patches in a series.
> Perhaps the maintainers are ok with that, but I'd like to suggest breaking
> the series in two: The first 7 patches seem to be somewhat stable, from a
> review perspective, and could be posted as "part i"; And then the remaining
> patches could be posted as "part ii" once "part i" has been accepted.
Yes, the patch set evolved a little bit over the 'just fix some little strange
behavior'..., splitting it up will work for me for sure..., will do on next
patch set iteration...
Regards,
Peter
>
> As for the selftests (the last patch of the series). A version,
> trimmed down as appropriate, could be included in "part i", with a
> follow-up in "part ii". Or the cover note for "part i" could state that the
> selftests have been deferred to "part ii".
>
> Perhaps the maintainers have other ideas, if so hopefully they will comment
> here.
prev parent reply other threads:[~2025-02-11 9:36 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-05 13:11 [PATCH net-next v4 00/17] Some pktgen fixes/improvments Peter Seiderer
2025-02-05 13:11 ` [PATCH net-next v4 01/17] net: pktgen: replace ENOTSUPP with EOPNOTSUPP Peter Seiderer
2025-02-05 13:11 ` [PATCH net-next v4 02/17] net: pktgen: enable 'param=value' parsing Peter Seiderer
2025-02-05 13:11 ` [PATCH net-next v4 03/17] net: pktgen: fix hex32_arg parsing for short reads Peter Seiderer
2025-02-05 13:11 ` [PATCH net-next v4 04/17] net: pktgen: fix 'rate 0' error handling (return -EINVAL) Peter Seiderer
2025-02-05 13:11 ` [PATCH net-next v4 05/17] net: pktgen: fix 'ratep " Peter Seiderer
2025-02-05 13:11 ` [PATCH net-next v4 06/17] net: pktgen: fix ctrl interface command parsing Peter Seiderer
2025-02-05 13:11 ` [PATCH net-next v4 07/17] net: pktgen: fix access outside of user given buffer in pktgen_thread_write() Peter Seiderer
2025-02-05 13:11 ` [PATCH net-next v4 08/17] net: pktgen: use defines for the various dec/hex number parsing digits lengths Peter Seiderer
2025-02-06 13:14 ` Simon Horman
2025-02-05 13:11 ` [PATCH net-next v4 09/17] net: pktgen: align some variable declarations to the most common pattern Peter Seiderer
2025-02-06 13:25 ` Simon Horman
2025-02-11 9:29 ` Peter Seiderer
2025-02-11 10:15 ` Simon Horman
2025-02-05 13:11 ` [PATCH net-next v4 10/17] net: pktgen: remove extra tmp variable (re-use len instead) Peter Seiderer
2025-02-06 13:12 ` Simon Horman
2025-02-05 13:11 ` [PATCH net-next v4 11/17] net: pktgen: remove some superfluous variable initializing Peter Seiderer
2025-02-06 13:11 ` Simon Horman
2025-02-05 13:11 ` [PATCH net-next v4 12/17] net: pktgen: fix mpls maximum labels list parsing Peter Seiderer
2025-02-06 13:04 ` Simon Horman
2025-02-05 13:11 ` [PATCH net-next v4 13/17] net: pktgen: fix access outside of user given buffer in pktgen_if_write() Peter Seiderer
2025-02-06 16:01 ` Simon Horman
2025-02-05 13:11 ` [PATCH net-next v4 14/17] net: pktgen: hex32_arg/num_arg error out in case no characters are available Peter Seiderer
2025-02-06 16:04 ` Simon Horman
2025-02-05 13:11 ` [PATCH net-next v4 15/17] net: pktgen: num_arg error out in case no valid character is parsed Peter Seiderer
2025-02-05 13:11 ` [PATCH net-next v4 16/17] net: pktgen: fix mpls reset parsing Peter Seiderer
2025-02-05 13:11 ` [PATCH net-next v4 17/17] selftest: net: add proc_net_pktgen Peter Seiderer
2025-02-06 13:51 ` [PATCH net-next v4 00/17] Some pktgen fixes/improvments Simon Horman
2025-02-11 9:36 ` Peter Seiderer [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=20250211103639.531a2baa@gmx.net \
--to=ps.report@gmx.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
/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).