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 2428FC4332F for ; Fri, 2 Dec 2022 22:06:54 +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=StZ4+ZYj8ooTfhLG2JqC4CnJ8RCEiYYT6HKy4fjo/q0=; b=F+tkuO2HyY92cQ Ow+0VUCoCUPc0Zxa/mJ0N/A3HRryHQfD5RRObtRX5cdHlG/qGkPAJXWOdYPKHMAAlf2InyoyBr0SX V1htPeC2OiKa0h2eTXazSX1vQYont0a5PwYGxXfmZB1ixJPPzrmuiaU273vGg9uozoCi9ZipNxtwq H372XnhRLK7lAfw8PlCe/ziwnk81oSWhBAn/lnZQiZhKq+Yf4Vb0DDF22IWTT3QQxtDqW7S2hkBS7 qxBrukdcncfxT2DKdAOkjRLxem4Kf5g4hmVge3Erh5/E1XY1IHt7loKgK5khHafio9x+XDTnZ/MNu Eok9BNI6P8GrBmMEjWWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1EAO-001TSh-FW; Fri, 02 Dec 2022 22:05:56 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1EAL-001TQm-Ck for linux-arm-kernel@lists.infradead.org; Fri, 02 Dec 2022 22:05:54 +0000 Received: by mail-pf1-x42a.google.com with SMTP id c15so6102749pfb.13 for ; Fri, 02 Dec 2022 14:05:45 -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=YGmhfz9LKketteJ29KbDn67sA38cLHNS36kuvwxlMm8=; b=TSqUQgbjbBdg6dvDWR1KVKuTEI3gAe6/W+8DLD7nw2mWi+QX+pcwtPxwJFoxQmJGEe uNxgwfWgkBGeh75QcHsRkRMQfxOkr6GVNv7M9DU6N537BAZNupUYZmYR8DdUZWlAAwbR KMF3Htct7RWcrCqmWw5tW/Ic0PXvyQHTzFYVE= 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=YGmhfz9LKketteJ29KbDn67sA38cLHNS36kuvwxlMm8=; b=z8eb3bWoCExXKokMSbYMLRveW721hAsDOnT4JE5s9prfEzR713uBsXmp/rTNYNTdvz nB17IwBYFGlGsOIkqi15K+HfRMWwSrCS7280nNFXqSzGxpq7IwUNoaetJCAfapt4QsAy A1qrqkWz4hPO+WoVlp9wssvjfnNiRdRIOujNiWrK9SaipLLZQe6jXGuk1s1in7a+v/nx gCe7XVNuEGcIV6vBUMAllQkakcx2SiFokeZkoQbTHEYcFqjgabkbCS84VX1IKm1f1zac oqmtypr1qETiIlrBGor7p2o7f84/tuOmTewuCLYWh7BiPv1QrQRza9ytaAfJW7hrtF/r oFGQ== X-Gm-Message-State: ANoB5pmSLq6gHe8NwInwVGFsbW7soiJqhofsdigIlZfDSutPUXaNpISw UVZ/RZpYwCkx6sQQ8tPl/F4cwQ== X-Google-Smtp-Source: AA0mqf5DhG6zysI+aj3WH5KAazaNoxWHCLIcnDeHYGVOYKMWwq4jAur5eQGJ0+dbDGN2a+EriUvEoA== X-Received: by 2002:a05:6a00:4009:b0:563:2ada:30a3 with SMTP id by9-20020a056a00400900b005632ada30a3mr55402742pfb.27.1670018745233; Fri, 02 Dec 2022 14:05:45 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id s24-20020a17090ad49800b00210125b789dsm5170014pju.54.2022.12.02.14.05.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 14:05:44 -0800 (PST) From: coverity-bot X-Google-Original-From: coverity-bot Date: Fri, 2 Dec 2022 14:05:43 -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_rf_regval_set(): Integer handling issues Message-ID: <202212021405.93CF11D2A@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_140553_457277_0B3167B4 X-CRM114-Status: UNSURE ( 9.40 ) 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:14 2022 +0100 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Coverity reported the following: *** CID 1527816: Integer handling issues (INCOMPATIBLE_CAST) drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c:657 in mt7996_rf_regval_set() 651 652 static int 653 mt7996_rf_regval_set(void *data, u64 val) 654 { 655 struct mt7996_dev *dev = data; 656 vvv CID 1527816: Integer handling issues (INCOMPATIBLE_CAST) vvv Pointer "&val" points to an object whose effective type is "unsigned long long" (64 bits, unsigned) but is dereferenced as a narrower "unsigned int" (32 bits, unsigned). This may lead to unexpected results depending on machine endianness. 657 return mt7996_mcu_rf_regval(dev, dev->mt76.debugfs_reg, (u32 *)&val, true); 658 } 659 660 DEFINE_DEBUGFS_ATTRIBUTE(fops_rf_regval, mt7996_rf_regval_get, 661 mt7996_rf_regval_set, "0x%08llx\n"); 662 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: 1527816 ("Integer handling issues") Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") 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