Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9028928rwd; Wed, 21 Jun 2023 01:56:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7WQqgYmZteRwgzIxY8ul/0jZLrc760Xs09gI2B6PkmL7EeRVoLfX70ATLmUqsEQZpgWZKa X-Received: by 2002:a05:6a20:3d82:b0:10b:d70d:f971 with SMTP id s2-20020a056a203d8200b0010bd70df971mr22080381pzi.3.1687337801182; Wed, 21 Jun 2023 01:56:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687337801; cv=none; d=google.com; s=arc-20160816; b=WnHjv8mq99ZgxOvW0yDCVdkHDqyrOOM+URq9gmqSGF58EbtOUEoQY84wjBw+0cjtpB svG0whtxzhWYm/iousdOGt99BhT3cAaQJaJKCxUUT9HJoqhcLdGMcoICWDcmTRPDvGdQ TGkcFL3NrzGf+DPRUWY0HWi9cEuEZFzGX22BE550EWN0dyFMUw9lXtSQwYu7hQ/cGXxu LTC7eQ/xJ2Ys+zqgw+xOQsANcZjfqclmwwY3P5D2OddFmvArjwvnTQBl1BOoAhMT5O5u mjxXkVJq8sQHyoWPoGh9O3IzMaw59/05Xfkq21tbAFxBt/IDY6NgBG4tFj6DhCRSTIMy Auwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=MCuYk9fhcoNwBbDwJ25jB6PNzRzN1gFhs2Baqd5SpZc=; b=BbpiW2pxbqce2Lg3L1poc+oyrAuQy5haAWWZc7tatEOPxTQtbw+h/T9b+mxHUWi4ai dFhbiaI2VIx4L49uz4CRlUCRe4kQZpKkMeMDunpBLWBlYRvCjufzeZ4joKm4exkk08kP gi3lY1VEkeCXxbw1DTtwU6/GK+mZtqHoAtwjmqA4rCkAwWwwQdoUsRdmOz1enXatijcp yKwuuUxZwzFpqWJO8YUtajHOGZfkTBoP5O6giArq4Ss9LffSLYiNZLVxTA+tnOxYkCtL LV55mtX4EYVArsBPVBDbRlGE/PLWSieoAMz90GhvelqlxqCojwL0QiQvKad0nI/aOkXI DLQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s189-20020a625ec6000000b006689d5c5953si80144pfb.112.2023.06.21.01.56.24; Wed, 21 Jun 2023 01:56:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231403AbjFUIpD (ORCPT + 99 others); Wed, 21 Jun 2023 04:45:03 -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) 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 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?