From patchwork Wed Oct 19 08:28:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4716 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp213907wrs; Wed, 19 Oct 2022 02:11:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM44oCHQqkB3UVy0TeO36HoajdVG3z4hUtFkAfGX/b749lKMyUtwQceoEF5rFOU7bc4yHbQ7 X-Received: by 2002:aa7:c919:0:b0:459:55b:57e7 with SMTP id b25-20020aa7c919000000b00459055b57e7mr6595845edt.20.1666170684637; Wed, 19 Oct 2022 02:11:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170684; cv=none; d=google.com; s=arc-20160816; b=G4z2eLuhfQ6qAO+WDv4b7IkpEOQRdSCygsNlHKhrCYfOAiahz8ncIoGxF14pBeNQLf jG4q1IkShPc4IFo4wpx+fum3KFIIiY66KRiBanycN8lEMlgMl8bXK7hjLObNH2bqRihg MymhwMVOnK/rgpfxEvWHehuqzrZKh/SwFvrLl/rotGWP34P14JQFCyF01tuuC9b/5cgo RwqoMQB3vVeyXcAPoP6Rg+kY2kO3b8ln4GcTcaYUHWn2ymWWZgR8kSxcjJGDzuMrhLUL KK2ULzYpoIvmseDcBlKINE2DLHKQNXrBsFe4/cRLOx4oQOCLal3XocRpHZx1XuqCJvWM 4ZYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kKssT54iXdTw+sGEw/GYDLI/l88X8MfuNzcPo5RXrI4=; b=H/zXe8jBvACZUP1gxHuUCkjrQZh02XmiYH5eewkX2wIV5JySg++QU+FLoBPoFDNYhq q3FI/AJXmU4WwpdA19yEFNkLrOeAYfi/y5/YUldwbB4HjhwHPcxhKhLuokiTb3iLAR9+ Z6bu1xqvhmQisIfJr8dI6NKrVtrSuN6AL5p5q1nAeCtDUyK3e0lMKm4p9RFf8jMHud8b Pjme+81mteAPpsgdnoON/XWAGyBIIlc324GaA7iFyBHVRRrpoTz/pvFAPH5H6WA9HieB ZV99hG0//ZKZNEbwWQP0LMNE9gl9dJ2Rf6DJwz6kqsQBANgzjiAQtUjomToGocIBCm7w RgPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tXcpx7py; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga29-20020a1709070c1d00b00772fe97b31esi13839716ejc.901.2022.10.19.02.10.58; Wed, 19 Oct 2022 02:11:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=tXcpx7py; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232477AbiJSJG3 (ORCPT + 99 others); Wed, 19 Oct 2022 05:06:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232561AbiJSJEf (ORCPT ); Wed, 19 Oct 2022 05:04:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 202CBAD992; Wed, 19 Oct 2022 01:57:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2568F61866; Wed, 19 Oct 2022 08:56:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37B9BC433C1; Wed, 19 Oct 2022 08:56:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169766; bh=t9a02up3UmCRf+tLpcInPigc4BFh75HEwd8CGe1RyE4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tXcpx7pyg75ZzoT7VTji7YbPPS/CaOzkbW1PdFaOM3bL/cjqsaAT+zsELiKgq4Xbu Gvq5Uj1/W6l28d+DI6rfJbyLJ+hABj9S/B/eDZkETFNgGbT2UJRrVv5nIhnG3YE2sz hulWqaGCURat3SBXgFF4mYbX2PVDgpJ+cHXmHeHQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Chia-I Wu , Gerd Hoffmann , Sasha Levin Subject: [PATCH 6.0 400/862] virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create() Date: Wed, 19 Oct 2022 10:28:07 +0200 Message-Id: <20221019083307.607796677@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747106591634771224?= X-GMAIL-MSGID: =?utf-8?q?1747106591634771224?= From: Dan Carpenter [ Upstream commit 37a78445763a5921bb54e9bad01937d0dfa521c1 ] The ->ring_idx_mask variable is a u64 so static checkers, Smatch in this case, complain if the BIT() is not also a u64. drivers/gpu/drm/virtio/virtgpu_ioctl.c:50 virtio_gpu_fence_event_create() warn: should '(1 << ring_idx)' be a 64 bit type? Fixes: cd7f5ca33585 ("drm/virtio: implement context init: add virtio_gpu_fence_event") Signed-off-by: Dan Carpenter Reviewed-by: Chia-I Wu Link: http://patchwork.freedesktop.org/patch/msgid/YygN7jY0GdUSQSy0@kili Signed-off-by: Gerd Hoffmann Signed-off-by: Sasha Levin --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 3b1701607aae..5d05093014ac 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -47,7 +47,7 @@ static int virtio_gpu_fence_event_create(struct drm_device *dev, struct virtio_gpu_fence_event *e = NULL; int ret; - if (!(vfpriv->ring_idx_mask & (1 << ring_idx))) + if (!(vfpriv->ring_idx_mask & BIT_ULL(ring_idx))) return 0; e = kzalloc(sizeof(*e), GFP_KERNEL);