Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2306816rwi; Fri, 21 Oct 2022 02:14:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6GujwVnrRSFRyi9hok4sFN21EDz0VH1Mkbv1gp9IeG6yoQlKbmwg1If0qOzzifiIyCGffx X-Received: by 2002:aa7:9af5:0:b0:562:a65f:ec81 with SMTP id y21-20020aa79af5000000b00562a65fec81mr18155108pfp.16.1666343640073; Fri, 21 Oct 2022 02:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666343640; cv=none; d=google.com; s=arc-20160816; b=sx9mjQiIK7J9a7ClT52I6JPHu4fMLgfeKWOHwiBHn77biSpQYVfEfczc5e7WYjt7f0 V/Sy3CsmJTX1mmmEb3ob1i6rUWAE8yVt2OkJbmoot6TaKtorVpB+IXQ6kEY9H1hWlKh7 1fCNsvOlLWNbVNQLgM4/COvZrHhCMtbnyEWp0KxXJJ3vh7To9cNVEkdNKULZSzZRegij iimBiFKe5u/t9KvaqUP70AmQ3vGhdIqgRCz62PpYbw+bfHx8kB2DX0JFSOIK0nvm0J8/ JmS72uCZpatjv3FffOKW2Cu611/LoNWht3v5GloPgW3Y26cGthZKQkLlJxHqlfZRn/ol EzVA== 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=J7ndX3bz31NJ8hPOCsFvjhM3K4W6JODrzI7KdNACmi0=; b=o8/FDnMz68+lZMEoJQfzTkqnP+IT4h6N0Je1zSHH3AEm//QWMQFMguAnGeNztjl2aa KLWpF3NjaCrPZHBpLkmQLHkgZjzw+rbheDFjeoX1ANa23uZZqFj5crTdeoATy5Yfy2yH bDrCPiL9GXuMN4asZhHginVmvrqzxj3dShGklk7S100r3knwvX8zFjVyWhMwMYItMoMc UY6t9ATGb0llf4jTETwfWuTRnyLjCGe0u40bX1pJPlaWHEt3fm4j4ih4zgMNYB7iuOLi ulaRG8W5HGM0GTJtIUZMo3u1IIZZW75k199QuaA3TrwEyabvtYOu4CV/jk6Mof4XUIks 9U+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="KG/MTMXG"; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a170902f35100b00176bcd1ccf3si20266658ple.591.2022.10.21.02.13.48; Fri, 21 Oct 2022 02:14:00 -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=@linuxfoundation.org header.s=korg header.b="KG/MTMXG"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230077AbiJUJJt (ORCPT + 99 others); Fri, 21 Oct 2022 05:09:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231143AbiJUJJI (ORCPT ); Fri, 21 Oct 2022 05:09:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E73621A3E2E; Fri, 21 Oct 2022 02:09:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EA17AB82A2D; Fri, 21 Oct 2022 09:09:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE859C4314E; Fri, 21 Oct 2022 09:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666343340; bh=8Nfah4tp3bpy6ouB69Q6NueJyUc3gDXaer+xsnFlQjQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KG/MTMXGS81AMSRLzUooIBhmVbT3ayzGSCeusacLu5ojMPBH1XB1hiU56qkPYXZ6Z Pmj1BD8LMmszwgMOZDbuoIpwrByIbQUTN+L9c7e1JrlXehMTnYGRRHCxy2ZxTpEvxj 3g6zjK4bvf3VcnLXMJC3Gcf+ki1dT/YkGdUKLEHE= Date: Fri, 21 Oct 2022 11:08:57 +0200 From: Greg Kroah-Hartman To: Ping-Ke Shih Cc: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Kevin Yang , Kalle Valo , Sasha Levin Subject: Re: [PATCH 6.0 681/862] wifi: rtw88: phy: fix warning of possible buffer overflow Message-ID: References: <20221019083249.951566199@linuxfoundation.org> <20221019083320.063888989@linuxfoundation.org> <1ab422def27d43e1866b470a3f9d24aa@realtek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1ab422def27d43e1866b470a3f9d24aa@realtek.com> X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 Fri, Oct 21, 2022 at 12:12:29AM +0000, Ping-Ke Shih wrote: > > > > -----Original Message----- > > From: Greg Kroah-Hartman > > Sent: Wednesday, October 19, 2022 4:33 PM > > To: linux-kernel@vger.kernel.org > > Cc: Greg Kroah-Hartman ; stable@vger.kernel.org; Kevin Yang > > ; Ping-Ke Shih ; Kalle Valo ; Sasha Levin > > > > Subject: [PATCH 6.0 681/862] wifi: rtw88: phy: fix warning of possible buffer overflow > > > > From: Zong-Zhe Yang > > > > [ Upstream commit 86331c7e0cd819bf0c1d0dcf895e0c90b0aa9a6f ] > > > > reported by smatch > > > > phy.c:854 rtw_phy_linear_2_db() error: buffer overflow 'db_invert_table[i]' > > 8 <= 8 (assuming for loop doesn't break) > > > > However, it seems to be a false alarm because we prevent it originally via > > if (linear >= db_invert_table[11][7]) > > return 96; /* maximum 96 dB */ > > > > Still, we adjust the code to be more readable and avoid smatch warning. > > Like Pavel mentioned [1], this patch is to avoid smatch warning, not a really > bug. So, shouldn't take this patch. > > [1] https://lore.kernel.org/linux-wireless/20221018093921.GD1264@duo.ucw.cz/ Ok, will go drop now, thanks. greg k-h