Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3928983rwi; Sat, 22 Oct 2022 02:23:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4BWP+uTZ31ZDaXTWcxuOPbm4Xc8uiNtSd+iWx5sTIBIfkZgUrIUqWBWxqbsmt0REso3NyQ X-Received: by 2002:a17:902:ef47:b0:179:d18e:4262 with SMTP id e7-20020a170902ef4700b00179d18e4262mr22946150plx.22.1666430585306; Sat, 22 Oct 2022 02:23:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666430585; cv=none; d=google.com; s=arc-20160816; b=yE6RWibrLZzdzTt3IiPB6PgF9SAJZBTLDCnYp6xFfMpSlO9MKRdffISIemdHqMkxj5 pVnmeqr+j7DVix5+tdnOIuWzv16SBTl/DBtplMuteFGKfKncpchu0w4Svpd1Etm0rg8A v1jXbXXljYIP1z85XwyYWpOstHFAQsFmMLnEcv5unDC64C0Yyf6d1kx+pYQLiPTo0RxH qLVO9tcptjRAXlYW5SRq2e559X+EejHDcT+Ltoocz7TAIVUTDaRE1+Sh3z7Gwpv4dx/X LpcGMPH52OumexO/GzGNdzeFi+zYinAK0/cr50i6/tlilPr4k+/tTdkD1dXHaVafFNc4 eMnw== 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=FdcxSatmRsAbbJd0zxbWNdZ3jAtsh9vbCqFl2m25twufeAu78+BOXGG0yw5TetraOJ ZCNmjZHEstL3UIEc5nTryhQVeKylmyipr864PU4TSIU2Tfeye7Jo/djmt8yNqYvIoY0f YzkM0SFjrFKxINBmRK9+3xBwOvckNMTzlEYHViSnR4k5tn6NIpTQWn3g8hAZvCdArW40 Ym5QyVMDyJS8vqpd0hFgMAtZcJ53cCqdLDjCL9SFxZ2ecreg0EzXrosUkzfAuS/1ikcm 87VlRkGn6bwp4rOQcN33H+gNKR7YJgjDyCnE2dA5ad0ijSVDh0Vm7DXE2jgGoZF6LGTa J9rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="EMr/FNl+"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ls15-20020a17090b350f00b001eccaceca72si10977986pjb.1.2022.10.22.02.22.54; Sat, 22 Oct 2022 02:23:05 -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="EMr/FNl+"; 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 S232607AbiJVIFc (ORCPT + 99 others); Sat, 22 Oct 2022 04:05:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232447AbiJVH7A (ORCPT ); Sat, 22 Oct 2022 03:59:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA52355AF; Sat, 22 Oct 2022 00:49:19 -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 ams.source.kernel.org (Postfix) with ESMTPS id 87CB5B82DF6; Sat, 22 Oct 2022 07:49:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA82CC433D7; Sat, 22 Oct 2022 07:49:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424944; bh=t9a02up3UmCRf+tLpcInPigc4BFh75HEwd8CGe1RyE4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EMr/FNl+tB74Vh21bXjSBPWVIUMaUxmO9/qjBq3Qr4Bp6+irnrRf7e7AY89Q25f17 BZQ9kCxBX2UAt40FOKs00J3RX6Wu5UzXsFoQIGf8NHSWbvoCSjjSSHg7RVX57qgR96 aloK2LaGJ2alRmF0D8/nl+oxvWpvGLImz4PiIbik= 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 5.19 335/717] virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create() Date: Sat, 22 Oct 2022 09:23:34 +0200 Message-Id: <20221022072510.011098256@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.3 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 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); -- 2.35.1