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 E678CC4332F for ; Fri, 2 Dec 2022 22:12:36 +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=E/CXWx+Nzu0YNf0LPtEK+jbynd2TGM8kDG83RGlSG5s=; b=m2jxtsfzP3di3d CowZ9hQSF4TK1WArtIOKD/aAqEPQeYy47sytAFCH5/1qIoAv5v8Uw8aoaJkMppg+aWvUvQ963Uw9t X7q0JbfhUQNoxJmN2qm9nW1pjU8OhbCUrpgQtuHSI5fH8s265ZSF4TEtDVTqLQ2z0G4Yzb5o2bDik hjjdMMol6YQe8zpZbZKLYbf7OrD0M4MppGdU4quNeaTuF4Vaz+2rgb/vvUUbGKnggM+zNrz2UhaKC AGIh6SIUn+D6cWQJQcZ+9KxAzvwajTls5drjw/zYtVrplRg3hudJM9I2LH0cPTykkG3+lZl+/gSnY eZehp90HK/2OIe0Hc25A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1EFw-001UB6-FD; Fri, 02 Dec 2022 22:11:40 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1EFs-001U9o-Ex for linux-arm-kernel@lists.infradead.org; Fri, 02 Dec 2022 22:11:38 +0000 Received: by mail-pl1-x635.google.com with SMTP id k7so5855532pll.6 for ; Fri, 02 Dec 2022 14:11:35 -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=w0dcCRAw7breQBxRgO7vXMzRE1EKaCH1sm8fAccBDKk=; b=OwVi+W7xvxR/nGjj39pmX3oRQiji/LPiwOpKAVbcIfM5DiCUEx2CVjjGCPgXGrAYj2 5UoXRgnzXLZKAL8W05vLqFxBXlQ6XcoYM3KtBnvhqQMVng3lNY2A1Ac0VfEk1e+mkKH0 2KCcNECGN1AEN2hcX554Bmw8qWfXqc5l8cIxA= 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=w0dcCRAw7breQBxRgO7vXMzRE1EKaCH1sm8fAccBDKk=; b=wwKqWUnBF3n+YlJalgrFwtmWEHQIaNLNb5xwalQ+6iWaTWaL51C7mN+fKU1BpuCCd7 AzvXPEqE/nUmxG8fGOBWq/Ns8hGteSPf7jYbi2ky6dfpIUxJfMCGkwhE1oZL4lruzL9X vZ8wn0qUJ+m5c5ZpKVSrtvmQ+fcQLYSPV0DljrlsgwVcIQLAXr3Zdz7GdZEIHHMAU6aK rQes8ODHUxqSeo3zIB9IMd76dgF2tum+oFjeux9E1NzCCKYlx/9w4BZg01FYdahTIwUg gxu78NjxK9rBBfnighmSyTDymQXON8bNp0LlU6zSfsIDPo/UnRoG7KzD9C6vk9q/PiEO 0gZA== X-Gm-Message-State: ANoB5pl1uFIWMRTxp5N63ikOVOa/D82OFTL+6wTaHQhGNRs7UaQoD9Mu LCF3UZraqDvMMWv5g+1QdbSp5w== X-Google-Smtp-Source: AA0mqf6QTLbmI+X8jti2r+C7tdO68/bOJUECQQLNnuZG8zdOtdYlL2NT2bZgqzSjU6DeRIsbPY36zw== X-Received: by 2002:a17:90a:9e5:b0:219:5139:7fa8 with SMTP id 92-20020a17090a09e500b0021951397fa8mr20815064pjo.15.1670019094904; Fri, 02 Dec 2022 14:11:34 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id h131-20020a628389000000b0056bb36c047asm5510216pfe.105.2022.12.02.14.11.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 14:11:34 -0800 (PST) From: coverity-bot X-Google-Original-From: coverity-bot Date: Fri, 2 Dec 2022 14:11:33 -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_hw_queue_read(): Integer handling issues Message-ID: <202212021411.A5E618D3@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_141136_544171_615F0F8D X-CRM114-Status: GOOD ( 10.43 ) 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 1527813: Integer handling issues (SIGN_EXTENSION) drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c:460 in mt7996_hw_queue_read() 454 for (i = 0; i < size; i++) { 455 u32 ctrl, head, tail, queued; 456 457 if (val & BIT(map[i].index)) 458 continue; 459 vvv CID 1527813: Integer handling issues (SIGN_EXTENSION) vvv Suspicious implicit sign extension: "map[i].qid" with type "u8" (8 bits, unsigned) is promoted in "map[i].qid << 24" to type "int" (32 bits, signed), then sign-extended to type "unsigned long" (64 bits, unsigned). If "map[i].qid << 24" is greater than 0x7FFFFFFF, the upper bits of the result will all be 1. 460 ctrl = BIT(31) | (map[i].pid << 10) | (map[i].qid << 24); 461 mt76_wr(dev, MT_FL_Q0_CTRL, ctrl); 462 463 head = mt76_get_field(dev, MT_FL_Q2_CTRL, 464 GENMASK(11, 0)); 465 tail = mt76_get_field(dev, MT_FL_Q2_CTRL, 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: 1527813 ("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