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 X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 537DDC433DB for ; Sun, 3 Jan 2021 21:18:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 20B2020784 for ; Sun, 3 Jan 2021 21:18:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727414AbhACVRE (ORCPT ); Sun, 3 Jan 2021 16:17:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725840AbhACVRD (ORCPT ); Sun, 3 Jan 2021 16:17:03 -0500 X-Greylist: delayed 680 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 03 Jan 2021 13:16:23 PST Received: from canardo.mork.no (canardo.mork.no [IPv6:2001:4641::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 102B1C061573 for ; Sun, 3 Jan 2021 13:16:22 -0800 (PST) Received: from miraculix.mork.no (miraculix.mork.no [IPv6:2001:4641:0:2:7627:374e:db74:e353]) (authenticated bits=0) by canardo.mork.no (8.15.2/8.15.2) with ESMTPSA id 103L4hgK030212 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 3 Jan 2021 22:04:43 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1609707883; bh=tJ9Si7uwTlF1+m4XAh1P6KDZfGpLXIZq6AArp/iMmMY=; h=From:To:Cc:Subject:References:Date:Message-ID:From; b=Rl2CWHYNakjmQtPotlTxNDabtYe/RZV9ne96VqhvcWG+KI1AQTYyjwjQBTnhyWa+f q+E561rOh30bBnwDz7TtCNkOeaz3mL8xREV0KLAZNXDyNgPtaPF2wL5DqeSslq/YfL iYQb7Y9m8/SBsabqzdjOgVVMDl/da7KPW4lu3ZA8= Received: from bjorn by miraculix.mork.no with local (Exim 4.94) (envelope-from ) id 1kwAYN-000Ecx-AR; Sun, 03 Jan 2021 22:04:43 +0100 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Jouni =?utf-8?Q?Sepp=C3=A4nen?= Cc: Oliver Neukum , linux-usb@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Enrico Mioso , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net,stable] net: cdc_ncm: correct overhead in delayed_ndp_size Organization: m References: <20210103143602.95343-1-jks@iki.fi> Date: Sun, 03 Jan 2021 22:04:43 +0100 In-Reply-To: <20210103143602.95343-1-jks@iki.fi> ("Jouni =?utf-8?Q?Sepp?= =?utf-8?Q?=C3=A4nen=22's?= message of "Sun, 3 Jan 2021 16:36:02 +0200") Message-ID: <87ft3henpw.fsf@miraculix.mork.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: clamav-milter 0.102.4 at canardo X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jouni Sepp=C3=A4nen writes: > + delayed_ndp_size =3D ctx->max_ndp_size + > + max(ctx->tx_ndp_modulus, > + ctx->tx_modulus + ctx->tx_remainder) - 1; You'll probably have to use something like max_t(u32, ctx->tx_ndp_modulus, ctx->tx_modulus + ctx->tx_remainder) =20=20 here as the test robot already said. Sorry for not seeing that earlier. Otherwise this looks very good to me. The bug is real and severe, and your patch appears to be the proper fix for it. Thanks a lot for figuring this out and taking the time to fixup this rather messy piece of code. Reviewed-by: Bj=C3=B8rn Mork