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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6400AC4708D for ; Fri, 2 Dec 2022 22:13:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234879AbiLBWNM (ORCPT ); Fri, 2 Dec 2022 17:13:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234859AbiLBWNG (ORCPT ); Fri, 2 Dec 2022 17:13:06 -0500 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57D77BD0E0 for ; Fri, 2 Dec 2022 14:13:04 -0800 (PST) Received: by mail-pf1-x433.google.com with SMTP id h28so6119923pfq.9 for ; Fri, 02 Dec 2022 14:13:04 -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=/kWu3ykUp6jy2oE1ZRRlRshB8WYV422H/n94yGeyIhw=; b=GAXzEoo+S14lTK4cD0oXTEUsG2k/16arWIJHGYDGGoAITzPptHOYra+4PIZqAMKrAp 0tB61+aGUNfbM+CwM2yGVn+YfT1RARaHjexCaAWA6Kq22roouKhqhimPBUwevE+wG2Sg ZdiVdxiW6gDD6Q9OAe7rXSCASwOhwS+nWPyfQ= 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=/kWu3ykUp6jy2oE1ZRRlRshB8WYV422H/n94yGeyIhw=; b=Umv28zdoi5BRuYoZXE1ZagGwWY5puhEXPIX8yoxt887DnzRGqsvghYDBHg0woCaVkn W71Mj0foGThF50rZlFjKry0e4WZdQDgNcyhM5IIHS3ZYuXifrokI4zxftawF/mOt9Xrb mRp01GlBxlnzsMnZMRGVvkVpwpw5tbCsTIKzeZtt7z8R+n6normzkjODXMsx+51mpimS 42Q1hjyEroryC86ogUtk3IsJ+WJtc2j3JqcxF4O169cncUbGO8Nyzuqrkql55rf0Skez ib8MhBJoR5eDwLIxWX8qXOE8tL5xAEho9hYaZEuI4gzleaBN+dW/HOT4CdnlZa9/5n4k 3HdQ== X-Gm-Message-State: ANoB5plO1HiioQEfRbhn3EQHqStnCQfoUMzMcQTub1yZL9q/0d70sbLL VDLZbBZ+bna4jqthtleab55NvpwP1wzLtVNi X-Google-Smtp-Source: AA0mqf4yMGLxJ4yzBzgABiEyiOC9Cw7v89H4Mg51yU3dIagFC0iIYu5hjOGUJWotx3YNlubWgYaiJQ== X-Received: by 2002:a63:dd16:0:b0:476:d2d9:5151 with SMTP id t22-20020a63dd16000000b00476d2d95151mr45023874pgg.487.1670019184321; Fri, 02 Dec 2022 14:13:04 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id f205-20020a6238d6000000b00574679561b4sm5563234pfa.134.2022.12.02.14.13.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 14:13:03 -0800 (PST) From: coverity-bot X-Google-Original-From: coverity-bot Date: Fri, 2 Dec 2022 14:13:02 -0800 To: Shayne Chen Cc: Lorenzo Bianconi , linux-wireless@vger.kernel.org, Jakub Kicinski , Kalle Valo , StanleyYP Wang , Matthias Brugger , Peter Chiu , Eric Dumazet , Money Wang , linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, Howard Hsu , linux-mediatek@lists.infradead.org, Felix Fietkau , "David S. Miller" , Evelyn Tsai , linux-kernel@vger.kernel.org, MeiChia Chiu , Paolo Abeni , Sean Wang , Bo Jiao , Ryder Lee , Sujuan Chen , "Gustavo A. R. Silva" , linux-next@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Coverity: mt7996_mcu_rx_radar_detected(): Insecure data handling Message-ID: <202212021413.392BADAF@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Dec 1 17:29:14 2022 +0100 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Coverity reported the following: *** CID 1527812: Insecure data handling (TAINTED_SCALAR) drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:338 in mt7996_mcu_rx_radar_detected() 332 { 333 struct mt76_phy *mphy = &dev->mt76.phy; 334 struct mt7996_mcu_rdd_report *r; 335 336 r = (struct mt7996_mcu_rdd_report *)skb->data; 337 vvv CID 1527812: Insecure data handling (TAINTED_SCALAR) vvv Using tainted variable "r->band_idx" as an index into an array "(*dev).mt76.phys". 338 mphy = dev->mt76.phys[r->band_idx]; 339 if (!mphy) 340 return; 341 342 if (r->band_idx == MT_RX_SEL2) 343 cfg80211_background_radar_event(mphy->hw->wiphy, 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: 1527812 ("Insecure data handling") Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Thanks for your attention! -- Coverity-bot