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 372CA5C97 for ; Wed, 21 Jun 2023 08:45:00 +0000 (UTC) Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:237:300::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1669710E6; Wed, 21 Jun 2023 01:44:59 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1qBtSL-0005d4-9f; Wed, 21 Jun 2023 10:44:49 +0200 Date: Wed, 21 Jun 2023 10:44:49 +0200 From: Florian Westphal To: Sohom Cc: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Sohom , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] netfilter: Don't parse CTCP message if shorter than minimum length Message-ID: <20230621084449.GD3799@breakpoint.cc> References: <20230621032953.107143-1-sohomdatta1+git@gmail.com> 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: <20230621032953.107143-1-sohomdatta1+git@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Sohom wrote: > If the CTCP message is shorter than 10 + 21 + MINMATCHLEN > then exit early and don't parse the rest of the message. Please send a v2 explaining why, not what. > + if (data >= data_limit - (10 + 21 + MINMATCHLEN)) { > + goto out; > + } Please run your patches through scripts/checkpatch.pl, we don't use { } for single-line conditional bodies. > /* Skip any whitespace */ > - while (data < data_limit - 10) { > + while (data < data_limit) { Why this change?