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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 212F4C4332F for ; Fri, 2 Dec 2022 22:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: Date:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=DMSmvhS6bZHo1CsDyj/uiiGBtZvwDij6nCSUCgJXSp4=; b=OsnT/7/ITBxO4G +bvuBYRE73cXVXobZsY/nshOVAIje7HQ7WguEF8A6Nna0ZUJOEaq8J17O6GO9tfpYTppwDU5juLJv HGyE0CuB9LhgOx/xmn/8qYE0ZbTHTPDtr/HzxHLmt3w8vEYvh1foJ4QJQwrls2FqucF551U4LFDC9 TjUH0CtBiB8nCT3zAPMqnCbXzGKjHmRXWU90ovSWHq/q6ODZhyltPC6gHUcn9KYeXzUjlKqEFu1Cs aVRQ/Xs8JWAs1Vkj1+PE510lWpqbP39HvBRAE6XkWN0W9fRthH7/06+JajBP2Xi/8konz4TK4wddP cSHiiwzEbrgsE4+YJJVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1ERm-001VVH-Mk; Fri, 02 Dec 2022 22:23:54 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1ERj-001VTM-0R for linux-arm-kernel@lists.infradead.org; Fri, 02 Dec 2022 22:23:52 +0000 Received: by mail-pf1-x42d.google.com with SMTP id 21so6168108pfw.4 for ; Fri, 02 Dec 2022 14:23:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :from:to:cc:subject:date:message-id:reply-to; bh=2jTCIikbeptzJXD47+EMyi5YDiLQQfJyhpLRVU8dNm0=; b=ToGWGrmjiT0lMJNU69+4IxRqSU2UDAoa5JWa/ImgVTqrDAPvBqFY71W+U+knKfDsLp 6Gp/nSFOHt5+m0Q8yU1d8m1dfHrWQXxgZNXt9VC72vFrlEPN84l0JJ90OquEZXSkYb2a KYELpNU7HZ5x23pyFU+/OVsWhbIWwGK6BLjjY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2jTCIikbeptzJXD47+EMyi5YDiLQQfJyhpLRVU8dNm0=; b=jfjxnWF//oR4KhxlQIeJnJLlHwFy15FZTryggnPRmFC3vMH6KZbhSaQjyF5LzKY3bG CZGtU5ruob3uFDG6y4ZIYBfWik+PIHZoMXnQkko+uugM1up9T8nUJbf9mk2HHNCqYZcz ZBiYmXVmwHIfnQWoX9V/Mx2/KPlQ08sc+T08IQZStvoelYvcYJIDLYAXFi+JSjKLoPDK SutcJYOVQvQ2I2L7mquDObEg19W25DcSLJFDGSiSzvGm75e6tXTbl8lgKYBdV+V5mAp6 yxM5PawB9TbJkOKleZZ4aUyBKjSGki6pnVxC0OUvmzoOoIZiWcB6S0HFSuGq8QQ04W6m l+ag== X-Gm-Message-State: ANoB5pkLeyl6KqK+xnEqAM5S2FSTcPgOYJUBWW1/PazUoO8cc853+Zuf PR3NCUkwP75DmRJ7GA4Jzy1MCg== X-Google-Smtp-Source: AA0mqf5GQF0f6fi1jAPdLnQFOWtH9RQ4f6566bGOi++EJw411Ux5M2z0l8uDW3zkf0KDGJveJ54bGQ== X-Received: by 2002:a63:d117:0:b0:476:c781:d3ae with SMTP id k23-20020a63d117000000b00476c781d3aemr47136160pgg.183.1670019828150; Fri, 02 Dec 2022 14:23:48 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b6-20020a170903228600b00186a437f4d7sm5926117plh.147.2022.12.02.14.23.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 14:23:47 -0800 (PST) From: coverity-bot X-Google-Original-From: coverity-bot Date: Fri, 2 Dec 2022 14:23:47 -0800 To: Felix Fietkau Cc: Lorenzo Bianconi , linux-wireless@vger.kernel.org, Jakub Kicinski , Kalle Valo , linux-mediatek@lists.infradead.org, Matthias Brugger , Shayne Chen , Eric Dumazet , "David S. Miller" , linux-kernel@vger.kernel.org, Paolo Abeni , Sean Wang , linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, Ryder Lee , "Gustavo A. R. Silva" , linux-next@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Coverity: mt76x0_phy_get_target_power(): Memory - illegal accesses Message-ID: <202212021423.5D5F1FD@keescook> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221202_142351_073765_12B5C04E X-CRM114-Status: UNSURE ( 8.45 ) X-CRM114-Notice: Please train this message. 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 Hello! This is an experimental semi-automated report about issues detected by Coverity from a scan of next-20221202 as part of the linux-next scan project: https://scan.coverity.com/projects/linux-next-weekly-scan You're getting this email because you were associated with the identified lines of code (noted below) that were touched by commits: Thu Dec 1 17:29:12 2022 +0100 b376d96362d8 ("wifi: mt76: move mt76_rate_power from core to mt76x02 driver code") Coverity reported the following: *** CID 1527804: Memory - illegal accesses (OVERRUN) drivers/net/wireless/mediatek/mt76/mt76x0/phy.c:645 in mt76x0_phy_get_target_power() 639 case 4: 640 /* vht rates */ 641 tx_rate = info[1] & 0xf; 642 if (tx_rate > 9) 643 return -EINVAL; 644 vvv CID 1527804: Memory - illegal accesses (OVERRUN) vvv Overrunning array "dev->rate_power.vht" of 2 bytes at byte offset 9 using index "tx_rate" (which evaluates to 9). 645 *target_power = cur_power + dev->rate_power.vht[tx_rate]; 646 *target_pa_power = mt76x0_phy_get_rf_pa_mode(dev, 1, tx_rate); 647 break; 648 default: 649 /* ht rates */ 650 tx_rate = info[1] & 0x7f; If this is a false positive, please let us know so we can mark it as such, or teach the Coverity rules to be smarter. If not, please make sure fixes get into linux-next. :) For patches fixing this, please include these lines (but double-check the "Fixes" first): Reported-by: coverity-bot Addresses-Coverity-ID: 1527804 ("Memory - illegal accesses") Fixes: b376d96362d8 ("wifi: mt76: move mt76_rate_power from core to mt76x02 driver code") Thanks for your attention! -- Coverity-bot _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel