Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp776157rwi; Thu, 13 Oct 2022 05:14:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5iRqWk6oLVWo4k3AKROCC133gjIaI2VCcy+2stIhg1J87gq3uTR9UJ1c9iQWu4Qe9ZmVlV X-Received: by 2002:a05:6402:27c9:b0:45c:3c77:8881 with SMTP id c9-20020a05640227c900b0045c3c778881mr16254519ede.250.1665663253629; Thu, 13 Oct 2022 05:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665663253; cv=none; d=google.com; s=arc-20160816; b=X3rKLa6a+26v+cRzhgclB1hFp12+NaO4a/uvZRghCRFekAjxA4GqNicw3FZ1NaE+5v llQqiWw7WkfxtiRNdwkSOumGADjmxTJQ2lGGR6mU2luSTeboikoD6h2/G+y0aPjtob1/ ievkWJ0Ytndssda9ipIygzAZvyCglTAcOMVdUJY0nuiiTEnUX30R1I8AuZsfD5iH+3pB iQDru6IQf3KBYe6E0g5QDKGOvthBkj4xLg2V195ji6EeQsldq/Dp20ULPW+muXKEFUVa h10DyRjKToYc0nWfG44agP3lcZS2hVWiuQ27wq8G/ijuh1m5pF2oHmUkD6RA3KkBazzL qqjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=YEW8tDgFPRHfRa0+o25FQhK00CXSj8b3QIG9cVhiYs4=; b=oWHkAYOgT2FNh5JeI48IQF7dktw/OkUhvwu/kYM4HweKrwF+sNotOFoaU2pYm3LlXa aZyTCCS88XjxaU7Bp8MReC5GJEqHj+CbzgoM4xwmuW/b0VzC0CbOJcL1leeYLqFDlVSs qrrq1lCL6PaK6qaDaI1R2DIY9P7DJQ3/L4z5CwAeprF/Kfc1ukcp6IXjqU1RF+6qDJqO j1Z70oMT6xVVP5YT28amrZHOWEcVxgv3SzbPE4Quco+HjFLarboFCCNfJzCpI+RpTF3m FjdFSqBTe5j3DndvhDZ3L1IQJNL7O24yChO1N5axC4t+H4HytYUyNq95N1QHeumrp8Y5 U5AQ== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r5-20020aa7c145000000b00458b87a0919si16011439edp.114.2022.10.13.05.13.42; Thu, 13 Oct 2022 05:14:13 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229548AbiJMLnE (ORCPT + 99 others); Thu, 13 Oct 2022 07:43:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbiJMLnC (ORCPT ); Thu, 13 Oct 2022 07:43:02 -0400 Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E429B1DCC; Thu, 13 Oct 2022 04:43:01 -0700 (PDT) Received: by mail-qt1-f173.google.com with SMTP id l28so790692qtv.4; Thu, 13 Oct 2022 04:43:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YEW8tDgFPRHfRa0+o25FQhK00CXSj8b3QIG9cVhiYs4=; b=k9vosQSSe2uGFhMiSPsUYaLqLFc75RjjNHJ8Rjcm3/FeYM0S9OnB0FPtrbOG6kz48V R4d8n1rXcJ+vtT/ouBGyvbhfrGi5KUsYMFJPNBH6s4oVqYru1w1+7WaD5dG6gKLMzzBe x9XodDgUbqVYpeI64MKkcjrUahkoChBn/ojpR2HxqUd/zZIt15zUv1lbBAijbuLY5/7U 0jmekt6FtlWMQ+9O5i1AVIDl+LowD7jSW3h5Eq/Q1zdF9uZCzpi9jgv24qt2zCIIa+WW T1/3GWI34SeJaTTZg7utepSRsLw+eBrUfEOuoKg0ug+bSIVg5UTRr57Bo89BPi+MNlbn b5cQ== X-Gm-Message-State: ACrzQf2VYSfCCw3q5g5VPrMuVQNWQnb2rs0uK81cnsTSpTES0FFatjNs +qibZfr5qyg3NKkiqbvcqS6dNce8cvxaDPRP4xQ= X-Received: by 2002:ac8:5ac1:0:b0:39a:123c:9df5 with SMTP id d1-20020ac85ac1000000b0039a123c9df5mr16490537qtd.27.1665661380743; Thu, 13 Oct 2022 04:43:00 -0700 (PDT) MIME-Version: 1.0 References: <20221013054947.1355884-1-pmanank200502@gmail.com> In-Reply-To: <20221013054947.1355884-1-pmanank200502@gmail.com> From: "Rafael J. Wysocki" Date: Thu, 13 Oct 2022 13:42:48 +0200 Message-ID: Subject: Re: [PATCH] ACPI: acpi_pcc.c: Fix unintentional integer overflow To: pmanank200502@gmail.com Cc: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no 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, Oct 13, 2022 at 7:50 AM wrote: > > From: Manank Patel > > Fixed unintentional u32 overflow by casting it to u64 before multiplication. > > Signed-off-by: Manank Patel A Fixes tag would be nice to have here. > --- > drivers/acpi/acpi_pcc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c > index ee4ce5ba1fb2..b929d2e5c622 100644 > --- a/drivers/acpi/acpi_pcc.c > +++ b/drivers/acpi/acpi_pcc.c > @@ -112,7 +112,7 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr, > * processor could be much slower to reply. So add an arbitrary > * amount of wait on top of Nominal. > */ > - usecs_lat = PCC_CMD_WAIT_RETRIES_NUM * data->pcc_chan->latency; > + usecs_lat = PCC_CMD_WAIT_RETRIES_NUM * ((u64) data->pcc_chan->latency); Or redefine PCC_CMD_WAIT_RETRIES_NUM as 500ULL? > ret = wait_for_completion_timeout(&data->done, > usecs_to_jiffies(usecs_lat)); > if (ret == 0) { > -- > 2.38.0 >