From patchwork Sat Oct 22 07:23:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7393 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1096986wrr; Sat, 22 Oct 2022 01:06:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7zUgThDbnQY+v00tGLXGF1a3XeedRIkQPFZBFIAVoeIP1z7P6eSmcY7BRrvWSyOCPumOTc X-Received: by 2002:a63:444f:0:b0:464:3985:3c92 with SMTP id t15-20020a63444f000000b0046439853c92mr19880166pgk.412.1666425994873; Sat, 22 Oct 2022 01:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425994; cv=none; d=google.com; s=arc-20160816; b=q+1WHwnB3qzwhHTB3U2wQendMN249mQqTBYQMTIj3bRrY2ldXPAPHe6k2kpc11+iH3 V3rf8CwPzW2mVI2uT/QLwoYRmv0kXgEChm5XX9fSpKV7dBuaiDy4T/mZE92sLnDQ0/00 01vKAR3ptBONRILvqX4Pdj3U2vttOekeDmhGyE8IlBhcQVup2FOS2TyM2l8PGktNc+jM +FivY6y6zyZJxNrJN8s4k65rGDTU33jNiXHbJ9nqpfIH80Ee3drav7MbtSKvtRUpkVbL BCe5GatI9nRWLjApZZ1ceZlXhJzmyfmobkcA0DtiXaFQk4CGiTvOEiUzsRlYivrXaMto XVYA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a63df49000000b0042b90c1d31dsi28005282pgj.829.2022.10.22.01.06.20; Sat, 22 Oct 2022 01:06:34 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747374303946615407?= X-GMAIL-MSGID: =?utf-8?q?1747374303946615407?= 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);