Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp922070rwl; Fri, 7 Apr 2023 07:24:55 -0700 (PDT) X-Google-Smtp-Source: AKy350Z86/4eFNPm8NPjo05hpZf/DOZkVVTFiEsCGXzAtefw++PS9qxphope6z8Dn59QE5msunH9 X-Received: by 2002:a62:38cb:0:b0:625:e3c0:8a58 with SMTP id f194-20020a6238cb000000b00625e3c08a58mr2773717pfa.4.1680877495243; Fri, 07 Apr 2023 07:24:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680877495; cv=none; d=google.com; s=arc-20160816; b=A88yl9bOB2TC5OVVFFSx1UliVdTewJy8sOMMzG+2HM6+ne3OwBN3sYbdQ6PhwXSkHG SugcKLoUmpC2PxVC3ZlgR36sEJfSrCE29BNQf1PmyFhS0xqvmu9r430v0ysvRgaG6pE7 KMYsgcTSlJx27q1pHm5mQyKX1796/k0OIw7d6GHr9fwGg3mUUOyr8c/r/3Il0Gf/NZH7 KpGX5ae/XN4nu11FNwZRUI9efunVINrI8k0PajXrRfnIzn9xYtVcXsCoV1m2sR2SRJ49 X62mcqI0iuY+sii2FWCpeWeDtY+ldpHaYewY8kSzun0jr7u2jM/GZp2q68d8YCueZ4Sh LvmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KycbUd/6x6o2XMOQ7vp0xd2R5KmHrk0z1iFYchVzsqg=; b=SHtgqYyl2rvmCxpPn8GkAo7/GcUUseX4wO5camOderZmP3aOA2Ce25k9xBAXVZ92vd 0+rfQZRmuV5RF47RT27Wydx4qDc1lTHl+8p9mxDt8SHuccQZMDq+oXCYO56hNMzDwKrQ ZOeJ9fBAj2+XqgV3tMbmrcJhVUfsz9ajpPw8tWbibpc/vDR8dV3meHayjDbWmOnkyPvE JLTko1VucNQ6VgScB0GoOiW6jV7Lb0uoF2HKQKNSw+a98YFiipCQEzkqLiNrV8Y7fFZz IO95IOwKrwWaU0hddvJZCxjCDvEkOewbu1fEwsaa7z1kq4TL700jgYnyFOXdgoCgtME+ 7www== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=j6fm2Ak1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h30-20020a63211e000000b0050bc150235dsi3579916pgh.104.2023.04.07.07.24.42; Fri, 07 Apr 2023 07:24:55 -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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=j6fm2Ak1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240635AbjDGOYQ (ORCPT + 99 others); Fri, 7 Apr 2023 10:24:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232542AbjDGOYO (ORCPT ); Fri, 7 Apr 2023 10:24:14 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4EC97DBF; Fri, 7 Apr 2023 07:24:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=KycbUd/6x6o2XMOQ7vp0xd2R5KmHrk0z1iFYchVzsqg=; b=j6fm2Ak1KD8Kw3gq3gVDuUSzZc MpRIm0tUIamuAwJwXUwtwFaLJhk00G3vAAS22MqmHDNT5Fp6S7u1GZ0NjuwH83h4gIjc+iwVkwU4G lAh9z9xviV+I/qiIlkvHqbh27YrIgWsHe+P5M4mvJw4dcMjUZJ9/9Trmx9z52SBvijvo=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pkn0Y-009jHJ-Gv; Fri, 07 Apr 2023 16:24:06 +0200 Date: Fri, 7 Apr 2023 16:24:06 +0200 From: Andrew Lunn To: "Radu Pirea (OSS)" Cc: hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH net] net: phy: nxp-c45-tja11xx: fix unsigned long multiplication overflow Message-ID: References: <20230406095953.75622-1-radu-nicolae.pirea@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230406095953.75622-1-radu-nicolae.pirea@oss.nxp.com> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 On Thu, Apr 06, 2023 at 12:59:53PM +0300, Radu Pirea (OSS) wrote: > Any multiplication between GENMASK(31, 0) and a number bigger than 1 > will be truncated because of the overflow, if the size of unsigned long > is 32 bits. > > Replaced GENMASK with GENMASK_ULL to make sure that multiplication will > be between 64 bits values. > > Cc: # 5.15+ > Fixes: 514def5dd339 ("phy: nxp-c45-tja11xx: add timestamping support") > Signed-off-by: Radu Pirea (OSS) Reviewed-by: Andrew Lunn Andrew