Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2747392rwb; Fri, 2 Dec 2022 14:34:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf6um3A/pB9WtOgnF/ZiH/XgwN4n+oW3Ezgr2uobx3Gat9Ca7mL9j+z9rU+MIuND92KYpdRW X-Received: by 2002:a05:6402:1f03:b0:468:7be6:55e7 with SMTP id b3-20020a0564021f0300b004687be655e7mr65714274edb.345.1670020460176; Fri, 02 Dec 2022 14:34:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670020460; cv=none; d=google.com; s=arc-20160816; b=GY5WmvaPoerYgxGedzdpqpotM3UAuxLsySP+/o3SMS1CuoLtGRc4TsaGtAVWHY4FTT fZvJA2F3WYLBiDMr+0uPRB1aXp5gc/NrTw/osmXIa9Qt8xn7wFRUSrVkBVLah7hUL2ej uPmVGqa7ane2Ciu9SkJ5EnL5RCEjcGDaBnFISH0mHzTYbe6FcAx601EVfrY/em2VED0E Mt+APp8CDmsiSSZ0Vo7SdrLPpMf9uAr8uyCG63GEnuALdZJRbhQy1S6hkj3JnPUUN22u /n0Eau9mu39fVlJwnXEsZhj7SHrxRPaE3qiknimEJ4HETdYR0F7RZ0D8nOpGJzUvW48M hN3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:date:from:dkim-signature; bh=F3xXQ9lCYQUlSBdhMmL8tVWcZF1nta/Hqkq7klcjUGo=; b=MpFD4xbovtS3Pdra/h7O4oTVDhBaVF+JKq3+m5zRChNVkEvXRQba/Mh4KCuw0jPc17 c9Z0namt5xEq03EisEg/TO1knZe6mER1e/4ObetWdQUhZz7oXFbjZoRuGwWQ3hsiiv4Z t2OL1HH4T9guL4T8gr7E5MMJgWP7sgemp65Clig8D1DzudLM13kyS2mM8r135PuIra9E iP/aScsRDp9o/GUfjGpNGutr0TUn33HePfPaXt3xf9i/sqfe0rLI5zDCodR+TkpMkdiv ai8zG7XBZiZupfuUanqFJmnUNNDABcdO2dZFOUcHqW/zOOhPHb+wbN2XXgMdeMhtpcEj nTGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ANMtQZQ2; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go36-20020a1709070da400b0078dd73ae297si1742323ejc.172.2022.12.02.14.34.03; Fri, 02 Dec 2022 14:34:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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=@chromium.org header.s=google header.b=ANMtQZQ2; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234892AbiLBWYj (ORCPT + 66 others); Fri, 2 Dec 2022 17:24:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234894AbiLBWYe (ORCPT ); Fri, 2 Dec 2022 17:24:34 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1CE0ED693 for ; Fri, 2 Dec 2022 14:24:32 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id q71so5475347pgq.8 for ; Fri, 02 Dec 2022 14:24:32 -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=F3xXQ9lCYQUlSBdhMmL8tVWcZF1nta/Hqkq7klcjUGo=; b=ANMtQZQ22M8vFa//m1q5Nmz5C5pG2EpSadk6l4a/nZGYH8n8ibP6Wt6LaUr0FtwdxZ 8YJeutEDfbFawUjEe7XOl53hVibAOcUc5N7HvhA+E15qlobGxxJb5hICBtS23EoLD3Zq oyal/07g/8aHTI8NzzysmrvqI1hNFUbBl+PCw= 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=F3xXQ9lCYQUlSBdhMmL8tVWcZF1nta/Hqkq7klcjUGo=; b=mqy+C4ydLuaHBoTY4MAKHNWVNM4iwIPkYIuWnEweVYryaB44T4Qjf1vWKrwlK4HcMj HsH9sEM7/F0LyYpVbUYvoptbPKWXKK3uWXXRidD+mSPu3ZPhpHwh6gDolcNdrz1wQALM RH/ue5kE4Z4SinlDr4p9sWJz9EvM7GJsTODgHOXm+B/2RxT+Ex6hbvw9OLdMTK1LjdKB wqp0x/6ZagtvrRP9RDLAI4IPreN4gG7v58i7uV6YCDFO5oLbVtMf91KS7wLxdqv1kUwx Xbq6kphaHx1WkmKxXT86RLNNqOae5xcvaxGqnBJehdM+goqEc4f8mor4wNO2AYtKAST3 hHWA== X-Gm-Message-State: ANoB5pmsQdINdq3/ffn5BA35T/+SIlZxPB5b+B/h3HJ18Rb0a6QIbd5j TUBb/hO84TjQnYSDmx2ljEmHkA== X-Received: by 2002:a63:2310:0:b0:457:a1a5:3ce with SMTP id j16-20020a632310000000b00457a1a503cemr47333634pgj.416.1670019872324; Fri, 02 Dec 2022 14:24:32 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z2-20020a17090ab10200b0021885b05660sm5201731pjq.24.2022.12.02.14.24.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 14:24:31 -0800 (PST) From: coverity-bot X-Google-Original-From: coverity-bot Date: Fri, 2 Dec 2022 14:24:30 -0800 To: Bo Jiao Cc: Lorenzo Bianconi , linux-wireless@vger.kernel.org, Jakub Kicinski , Kalle Valo , Matthias Brugger , Shayne Chen , Eric Dumazet , linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, Felix Fietkau , "David S. Miller" , linux-kernel@vger.kernel.org, Paolo Abeni , Sean Wang , MeiChia Chiu , Ryder Lee , Sujuan Chen , Bo Jiao , "Gustavo A. R. Silva" , linux-next@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Coverity: mt7915_mcu_get_chan_mib_info(): Memory - illegal accesses Message-ID: <202212021424.34C0F695E4@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,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-wireless@vger.kernel.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 Feb 3 13:57:56 2022 +0100 417a4534d223 ("mt76: mt7915: update mt7915_chan_mib_offs for mt7916") Coverity reported the following: *** CID 1527801: Memory - illegal accesses (OVERRUN) drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:3005 in mt7915_mcu_get_chan_mib_info() 2999 start = 5; 3000 ofs = 0; 3001 } 3002 3003 for (i = 0; i < 5; i++) { 3004 req[i].band = cpu_to_le32(phy->mt76->band_idx); vvv CID 1527801: Memory - illegal accesses (OVERRUN) vvv Overrunning array "offs" of 9 4-byte elements at element index 9 (byte offset 39) using index "i + start" (which evaluates to 9). 3005 req[i].offs = cpu_to_le32(offs[i + start]); 3006 3007 if (!is_mt7915(&dev->mt76) && i == 3) 3008 break; 3009 } 3010 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: 1527801 ("Memory - illegal accesses") Fixes: 417a4534d223 ("mt76: mt7915: update mt7915_chan_mib_offs for mt7916") Thanks for your attention! -- Coverity-bot