From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF96D381A9 for ; Mon, 16 Oct 2023 20:33:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:237:300::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FAAA9B; Mon, 16 Oct 2023 13:33:00 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1qsUGl-0002pi-1W; Mon, 16 Oct 2023 22:32:55 +0200 Date: Mon, 16 Oct 2023 22:32:55 +0200 From: Florian Westphal To: Phil Sutter Cc: David Miller , netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, Pablo Neira Ayuso Subject: Re: [net-next PATCH] net: skb_find_text: Ignore patterns extending past 'to' Message-ID: <20231016203255.GB10271@breakpoint.cc> References: <20231013195113.3663-1-phil@nwl.cc> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231013195113.3663-1-phil@nwl.cc> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Phil Sutter wrote: > Assume that caller's 'to' offset really represents an upper boundary for > the pattern search, so patterns extending past this offset are to be > rejected. > > The old behaviour also was kind of inconsistent when it comes to > fragmentation (or otherwise non-linear skbs): If the pattern started in > between 'to' and 'from' offsets but extended to the next fragment, it > was not found if 'to' offset was still within the current fragment. > > Test the new behaviour in a kselftest using iptables' string match. > > Suggested-by: Pablo Neira Ayuso > Fixes: f72b948dcbb85 ("[NET]: skb_find_text ignores to argument") FYI, checkpatch complains about the fixes tag. > diff --git a/tools/testing/selftests/netfilter/xt_string.sh b/tools/testing/selftests/netfilter/xt_string.sh > new file mode 100755 > index 0000000000000..1802653a47287 > --- /dev/null > +++ b/tools/testing/selftests/netfilter/xt_string.sh Thanks for the test case. Is there a reason why its not hooked up to the kselftest makefile? I think it should be.