From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tao Ren Date: Fri, 16 Apr 2021 11:25:59 -0700 Subject: [PATCH v2] watchdog: aspeed: fix integer overflow in set_timeout handler In-Reply-To: <2771f72a-cc3c-54a5-cc2c-715ea61be6b7@roeck-us.net> References: <20210416021337.18715-1-rentao.bupt@gmail.com> <2771f72a-cc3c-54a5-cc2c-715ea61be6b7@roeck-us.net> Message-ID: <20210416182558.GA4816@taoren-ubuntu-R90MNF91> List-Id: To: linux-aspeed@lists.ozlabs.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Thu, Apr 15, 2021 at 10:07:32PM -0700, Guenter Roeck wrote: > On 4/15/21 7:13 PM, rentao.bupt at gmail.com wrote: > > From: Tao Ren > > > > Fix the time comparison (timeout vs. max_hw_heartbeat_ms) in set_timeout > > handler to avoid potential integer overflow when the supplied timeout is > > greater than aspeed's maximum allowed timeout (4294 seconds). > > > > I think this is the wrong focus: What this fixes is the wrong hardware > timeout calculation. Again, I think that the wrong calculation leads to > the overflow should not be the focus of this patch, though it can of > course be mentioned. > > I'll leave it up to Wim to decide if he wants to apply the patch with the > current explanation. > > Thanks, > Guenter Sorry I didn't get your point correctly, and I guess it was because of my lack of knowledge in timeout/max_hw_heartbeat_ms/worker (hopefully my understanding is correct now :)) Let me drop this patch and send a new one with different subject and description soon. Cheers, Tao 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=-4.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 867A0C433B4 for ; Fri, 16 Apr 2021 18:26:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 619AE613B0 for ; Fri, 16 Apr 2021 18:26:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235874AbhDPS0c (ORCPT ); Fri, 16 Apr 2021 14:26:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235735AbhDPS0c (ORCPT ); Fri, 16 Apr 2021 14:26:32 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82180C061574; Fri, 16 Apr 2021 11:26:07 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id z22so9304959plo.3; Fri, 16 Apr 2021 11:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+NoMdFRqvCj0wjEu2wU+EppPHqkD5aPuBzCUVO8B5Dw=; b=I7NkKx+ryboIFsQYOl0hn9Owr8ah4PzLF123GS1rr/xs+Is+upY0kBQ6YKQF01qdjT /JXCewbuJ6m9FkA+hTJ0ZLNndSrBrcAxe1SL6n+h8Dz/6WwoLJGOl3Usr09pFM+DDcyZ HJpE32jNzCiYvUL/nDIlAczIlyUI4lF30PKHl8NsfqW4O8uK4lBvECjt4Wbi84sc0yUO TBw88FWyBysNTaVA0RWN6HfYwvdJzPzqKYBclHUW4yQSNJtWsJQzFIky0SHayASO+TKR MGpyBRr6Fzxc539M6xaRvLtYi/XqzOG3e21wiGh1pwMNcYgqwMmamry8dLyz86+6T+LX 24uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+NoMdFRqvCj0wjEu2wU+EppPHqkD5aPuBzCUVO8B5Dw=; b=LoTDgqrTAyK5bNPRl/F+wExhYebrUbV2sTtzQfrukRsuawPR/MLzbRk3D7JP4AS+nw +x8tNLzF/eSNF4D9YU0KmB07Rve8zEXtNZp/BvPxFhpHv9ycGKQhwCvPYShKdVX9wu1H HirGBD+2ih9N+njFyNUqmr0YGL5PNPDz7vUHGF1cknfB/J1kXV5l9Z+FhAVGmUybApuE mtq3l9funY4xAL1hrYMChw+p77d6oo+1eYvp+++/quE6i2sA/BTCu4hluM1Koowd1yV0 B6Y+1IXcdERfXpF59f52itO9pe6wHYdJUPtfsgYg2Y3+SLdNuD9hzKvVY43p87UDWaQm ou4A== X-Gm-Message-State: AOAM530hnCBYR900onZw95Xa1b72M36gpAUtuTfYDG3c6jEYbsALwcR9 aNGqxkg5jyAazdF6AWDWL0o= X-Google-Smtp-Source: ABdhPJw2kWFT896TOOCfe5suf1zLJSSp2jHsX2kBjJGSkduJ7jRvKnfFRK8cKa3n/6vBVu3+CGwaVQ== X-Received: by 2002:a17:90b:344e:: with SMTP id lj14mr11195691pjb.89.1618597567017; Fri, 16 Apr 2021 11:26:07 -0700 (PDT) Received: from taoren-ubuntu-R90MNF91 (c-73-252-146-110.hsd1.ca.comcast.net. [73.252.146.110]) by smtp.gmail.com with ESMTPSA id x1sm5324218pgp.24.2021.04.16.11.26.05 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Apr 2021 11:26:06 -0700 (PDT) Date: Fri, 16 Apr 2021 11:25:59 -0700 From: Tao Ren To: Guenter Roeck Cc: Wim Van Sebroeck , Joel Stanley , Andrew Jeffery , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Tao Ren , Amithash Prasad Subject: Re: [PATCH v2] watchdog: aspeed: fix integer overflow in set_timeout handler Message-ID: <20210416182558.GA4816@taoren-ubuntu-R90MNF91> References: <20210416021337.18715-1-rentao.bupt@gmail.com> <2771f72a-cc3c-54a5-cc2c-715ea61be6b7@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2771f72a-cc3c-54a5-cc2c-715ea61be6b7@roeck-us.net> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org On Thu, Apr 15, 2021 at 10:07:32PM -0700, Guenter Roeck wrote: > On 4/15/21 7:13 PM, rentao.bupt@gmail.com wrote: > > From: Tao Ren > > > > Fix the time comparison (timeout vs. max_hw_heartbeat_ms) in set_timeout > > handler to avoid potential integer overflow when the supplied timeout is > > greater than aspeed's maximum allowed timeout (4294 seconds). > > > > I think this is the wrong focus: What this fixes is the wrong hardware > timeout calculation. Again, I think that the wrong calculation leads to > the overflow should not be the focus of this patch, though it can of > course be mentioned. > > I'll leave it up to Wim to decide if he wants to apply the patch with the > current explanation. > > Thanks, > Guenter Sorry I didn't get your point correctly, and I guess it was because of my lack of knowledge in timeout/max_hw_heartbeat_ms/worker (hopefully my understanding is correct now :)) Let me drop this patch and send a new one with different subject and description soon. Cheers, Tao 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=-2.0 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 B3504C433B4 for ; Fri, 16 Apr 2021 18:26:52 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3A600610FB for ; Fri, 16 Apr 2021 18:26:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A600610FB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4FMPn652fPz3c3r for ; Sat, 17 Apr 2021 04:26:50 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=I7NkKx+r; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::1034; helo=mail-pj1-x1034.google.com; envelope-from=rentao.bupt@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=I7NkKx+r; dkim-atps=neutral Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4FMPmN4X50z3c4G; Sat, 17 Apr 2021 04:26:11 +1000 (AEST) Received: by mail-pj1-x1034.google.com with SMTP id f2-20020a17090a4a82b02900c67bf8dc69so16870404pjh.1; Fri, 16 Apr 2021 11:26:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+NoMdFRqvCj0wjEu2wU+EppPHqkD5aPuBzCUVO8B5Dw=; b=I7NkKx+ryboIFsQYOl0hn9Owr8ah4PzLF123GS1rr/xs+Is+upY0kBQ6YKQF01qdjT /JXCewbuJ6m9FkA+hTJ0ZLNndSrBrcAxe1SL6n+h8Dz/6WwoLJGOl3Usr09pFM+DDcyZ HJpE32jNzCiYvUL/nDIlAczIlyUI4lF30PKHl8NsfqW4O8uK4lBvECjt4Wbi84sc0yUO TBw88FWyBysNTaVA0RWN6HfYwvdJzPzqKYBclHUW4yQSNJtWsJQzFIky0SHayASO+TKR MGpyBRr6Fzxc539M6xaRvLtYi/XqzOG3e21wiGh1pwMNcYgqwMmamry8dLyz86+6T+LX 24uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+NoMdFRqvCj0wjEu2wU+EppPHqkD5aPuBzCUVO8B5Dw=; b=Tl0OPrQoXMAHeFlSTHne/qo9NY9h/WpaATZ5ZDID6JBV0BgEVQNJNaD71d5j4GOOys y9FqoM0YuTRQxAl2Dw7rY4MTiXz6jWZr1XZRE+2NSR2vPeYAn9+mFxB66KvjO0ZNm1t9 1MqqXvso/XA/2yLVAktJK84JkNwEliLHKMN5r2sJo2fQl6E2zdtM+yWuxjqdlV1S0h9L Q/PtJHX43/aYWFkLcf/gmf9B0u8n8gTw295KcZ5HRK4DO/tTYtinH+5cJUxzDUpc9/lq 0kLUGXPTlN1raSPujvI5gjrtzZvx9YeZrf6iWkptJ14YElUEXyq8t5UkOgX4ZBXMmo3S P6Bw== X-Gm-Message-State: AOAM531X00DClmWVDg79XNIpcic0q/F1fx9c8gO2+XecQV2cy4S8zkdR 3xmspsk006zJXJVf2YT0GZQ= X-Google-Smtp-Source: ABdhPJw2kWFT896TOOCfe5suf1zLJSSp2jHsX2kBjJGSkduJ7jRvKnfFRK8cKa3n/6vBVu3+CGwaVQ== X-Received: by 2002:a17:90b:344e:: with SMTP id lj14mr11195691pjb.89.1618597567017; Fri, 16 Apr 2021 11:26:07 -0700 (PDT) Received: from taoren-ubuntu-R90MNF91 (c-73-252-146-110.hsd1.ca.comcast.net. [73.252.146.110]) by smtp.gmail.com with ESMTPSA id x1sm5324218pgp.24.2021.04.16.11.26.05 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Apr 2021 11:26:06 -0700 (PDT) Date: Fri, 16 Apr 2021 11:25:59 -0700 From: Tao Ren To: Guenter Roeck Subject: Re: [PATCH v2] watchdog: aspeed: fix integer overflow in set_timeout handler Message-ID: <20210416182558.GA4816@taoren-ubuntu-R90MNF91> References: <20210416021337.18715-1-rentao.bupt@gmail.com> <2771f72a-cc3c-54a5-cc2c-715ea61be6b7@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2771f72a-cc3c-54a5-cc2c-715ea61be6b7@roeck-us.net> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-watchdog@vger.kernel.org, linux-aspeed@lists.ozlabs.org, Andrew Jeffery , Tao Ren , openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, Amithash Prasad , Wim Van Sebroeck , linux-arm-kernel@lists.infradead.org Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" On Thu, Apr 15, 2021 at 10:07:32PM -0700, Guenter Roeck wrote: > On 4/15/21 7:13 PM, rentao.bupt@gmail.com wrote: > > From: Tao Ren > > > > Fix the time comparison (timeout vs. max_hw_heartbeat_ms) in set_timeout > > handler to avoid potential integer overflow when the supplied timeout is > > greater than aspeed's maximum allowed timeout (4294 seconds). > > > > I think this is the wrong focus: What this fixes is the wrong hardware > timeout calculation. Again, I think that the wrong calculation leads to > the overflow should not be the focus of this patch, though it can of > course be mentioned. > > I'll leave it up to Wim to decide if he wants to apply the patch with the > current explanation. > > Thanks, > Guenter Sorry I didn't get your point correctly, and I guess it was because of my lack of knowledge in timeout/max_hw_heartbeat_ms/worker (hopefully my understanding is correct now :)) Let me drop this patch and send a new one with different subject and description soon. Cheers, Tao 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=-2.2 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 C6DEFC433B4 for ; Fri, 16 Apr 2021 18:28:22 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 54142610FB for ; Fri, 16 Apr 2021 18:28:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54142610FB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UFQkoJJ3HK/FXXliOwf/umpSjBJVHkbiAEBPHyvoVTE=; b=DJt1jkf/XLDNqedXRoBcKHhad Yzu0OzL5e4/kERHGAJdg/FR51LuAfBBKxboLBiwUImMVFD62m1Qb8OAR7ZvCziHSMTgv+29MJ5oY6 Ct/GWUkhBU34h66nYM0EkHrYgGLE05LF5kFU6q/4BoEyYsMS/8JQS/c0WWT4KvB3J/9VYsdNILEQE eHXCBGminCKFy/xDT+m0DQmr3gRA/dpeCyk3vCOnYriSpD+CpkJRFjAvX9qWgdAlX/YavvvjLmxkh NJ2GvjHI/RxlV4h9QBwZ+m/7QlIGSDAs5obJQgytu5/Z8/+KJVRJ5odpI6VMd8QHshJKj8PRjnCux G0Ejz9GlA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lXTAW-0034LN-LF; Fri, 16 Apr 2021 18:26:16 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lXTAS-0034L4-Ml for linux-arm-kernel@desiato.infradead.org; Fri, 16 Apr 2021 18:26:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=+NoMdFRqvCj0wjEu2wU+EppPHqkD5aPuBzCUVO8B5Dw=; b=UBISeDzkF5PcLVs/FruGTJPggA GDIKl9+lz0DfyhtbuIqXvQRAoYGJttFRFdwskfqouwhC5C7XwFXRsLHWhsB/A1HkmBxA3vmda+1cE 1+iEGppcJuSfLbCDesF+Bw2VvzTPjT0eA9cvj2kso1o67Pt7od5vamCTq7GSKGGsUAmILe6d4OVpa co8h8sIjM82//0Fe93mJwDudvDuDw8oTSs+j3WhvY2GeR5cmLxECmIG6RNZw2s0qS2Gt6961HguS1 q36mj0TllTLGTme+H+umZ7mOg47TA7Exiy7NPoMjG5sM9nGCu6JCRY4Q6KPlX2VpVkTHoRHBl/i/J rdPS4PFw==; Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lXTAO-009chR-6R for linux-arm-kernel@lists.infradead.org; Fri, 16 Apr 2021 18:26:11 +0000 Received: by mail-pl1-x629.google.com with SMTP id q11so1329162plx.2 for ; Fri, 16 Apr 2021 11:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+NoMdFRqvCj0wjEu2wU+EppPHqkD5aPuBzCUVO8B5Dw=; b=I7NkKx+ryboIFsQYOl0hn9Owr8ah4PzLF123GS1rr/xs+Is+upY0kBQ6YKQF01qdjT /JXCewbuJ6m9FkA+hTJ0ZLNndSrBrcAxe1SL6n+h8Dz/6WwoLJGOl3Usr09pFM+DDcyZ HJpE32jNzCiYvUL/nDIlAczIlyUI4lF30PKHl8NsfqW4O8uK4lBvECjt4Wbi84sc0yUO TBw88FWyBysNTaVA0RWN6HfYwvdJzPzqKYBclHUW4yQSNJtWsJQzFIky0SHayASO+TKR MGpyBRr6Fzxc539M6xaRvLtYi/XqzOG3e21wiGh1pwMNcYgqwMmamry8dLyz86+6T+LX 24uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+NoMdFRqvCj0wjEu2wU+EppPHqkD5aPuBzCUVO8B5Dw=; b=hz7bOE0hSup3nr1c699ftT/3ktSh7pHAjYTlQzFDAvx7Muaxf0xN3FbP0cHBxL7/zS VtmWLrqYKWsg0NqRLo8khClISN+X02mXOtKyYyp/QxgAtxJHIzsVd/4yEbSieZzol8tN mYSKa8u3MxljTY93C5q4YiEyXhiUotX8+jZQVjH2rMTTaFeysNMvGxbZHmN4PJSh77RE krISBuV4zlBiSRmlZdRYXC+vGLZGmzLNQwGVMO5fZ98000JTNVal9UAd4z7Z7hoPViOn BQpTz4veMC0JpaZ7f1HagO9l9Coe2MnijBrpkyYLf4hCExi6KS8VT+0ozJ6+60lHo651 NG+g== X-Gm-Message-State: AOAM532aZl1w5H6P6aVpQNnsycNEkV6e5vmFhGYY22thrCxcT5/sZNbK LbOiw3xS1++HpIxv8Tz8g9QCC7QYlABo8j4n7BI= X-Google-Smtp-Source: ABdhPJw2kWFT896TOOCfe5suf1zLJSSp2jHsX2kBjJGSkduJ7jRvKnfFRK8cKa3n/6vBVu3+CGwaVQ== X-Received: by 2002:a17:90b:344e:: with SMTP id lj14mr11195691pjb.89.1618597567017; Fri, 16 Apr 2021 11:26:07 -0700 (PDT) Received: from taoren-ubuntu-R90MNF91 (c-73-252-146-110.hsd1.ca.comcast.net. [73.252.146.110]) by smtp.gmail.com with ESMTPSA id x1sm5324218pgp.24.2021.04.16.11.26.05 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Apr 2021 11:26:06 -0700 (PDT) Date: Fri, 16 Apr 2021 11:25:59 -0700 From: Tao Ren To: Guenter Roeck Cc: Wim Van Sebroeck , Joel Stanley , Andrew Jeffery , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Tao Ren , Amithash Prasad Subject: Re: [PATCH v2] watchdog: aspeed: fix integer overflow in set_timeout handler Message-ID: <20210416182558.GA4816@taoren-ubuntu-R90MNF91> References: <20210416021337.18715-1-rentao.bupt@gmail.com> <2771f72a-cc3c-54a5-cc2c-715ea61be6b7@roeck-us.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <2771f72a-cc3c-54a5-cc2c-715ea61be6b7@roeck-us.net> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210416_112608_277498_B640689A X-CRM114-Status: GOOD ( 17.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Apr 15, 2021 at 10:07:32PM -0700, Guenter Roeck wrote: > On 4/15/21 7:13 PM, rentao.bupt@gmail.com wrote: > > From: Tao Ren > > > > Fix the time comparison (timeout vs. max_hw_heartbeat_ms) in set_timeout > > handler to avoid potential integer overflow when the supplied timeout is > > greater than aspeed's maximum allowed timeout (4294 seconds). > > > > I think this is the wrong focus: What this fixes is the wrong hardware > timeout calculation. Again, I think that the wrong calculation leads to > the overflow should not be the focus of this patch, though it can of > course be mentioned. > > I'll leave it up to Wim to decide if he wants to apply the patch with the > current explanation. > > Thanks, > Guenter Sorry I didn't get your point correctly, and I guess it was because of my lack of knowledge in timeout/max_hw_heartbeat_ms/worker (hopefully my understanding is correct now :)) Let me drop this patch and send a new one with different subject and description soon. Cheers, Tao _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel