From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36A4FEB64D7 for ; Wed, 21 Jun 2023 08:45:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231268AbjFUIpE (ORCPT ); Wed, 21 Jun 2023 04:45:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231710AbjFUIpA (ORCPT ); Wed, 21 Jun 2023 04:45:00 -0400 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> 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?