From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 64D5E37B97 for ; Tue, 6 Jun 2023 15:49:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8D15C433EF; Tue, 6 Jun 2023 15:49:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686066560; bh=o3yIyCgRGH5S/mkc72bZVcX1gFYjf6Gdv8HpJ7qF+LU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=q6g8lMbvdId+tdw4GDmeH3iPjXPM1hrXJwWCMtjZ1/6w8jA1rh8Z0afNx+werNP1l o/9wul1LtP/LDysdjREGdKRrEzDp7lgdHlzDWht4Ru/0KjeXHRzL/Jjof1zHmUXYUF cr3cuV2fGPN782BxwYjayQ9UEOkL+WaksOpbwaSpLKY6ZCoUJdOleT4gZ4ca7Wde46 zEk3CHW8Gtzr/HblztuiSpWoCEXM8jXtjDkZ40xjxdECY/035mJX3k+DxIpABh+qsX Qb6/Ulo59sFh4bf23uezvjEPqua6wf6tl/A+XJy04MlJ+f6TOTN7u6ms+4fzV2RupW h/lhZ37Ph/JIw== Date: Tue, 6 Jun 2023 08:49:19 -0700 From: Jakub Kicinski To: "luwei (O)" Cc: Networking Subject: Re: [Question] integer overflow in function __qdisc_calculate_pkt_len() Message-ID: <20230606084919.5549dd58@kernel.org> In-Reply-To: References: <7723cc01-57bf-2b64-7f78-98a0e6508a2e@huawei.com> <20230605161922.5e417434@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 6 Jun 2023 20:54:47 +0800 luwei (O) wrote: > > on a quick look limiting the cell_align to S16_MIN at the netlink level > > (NLA_POLICY_MIN()) seems reasonable, feel free to send a patch. > > . =20 >=20 > Thanks for your reply, but do your mean cell_align or overhead? It seems= =20 > limit cell_align to >=20 > S16_MIN(-32768) can still cause the overflow: >=20 > =C2=A0=C2=A0=C2=A0 66 + (-2147483559) + (-32767) =3D 2147451036 >=20 > skb->len =3D 66 > stab->szopts.overhead =3D -2147483559 > stab->szopts.cell_align =3D -32767 Could you explain what the problem caused by the overflow will be?