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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BF9DC433DF for ; Fri, 9 Oct 2020 07:29:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D3C9422265 for ; Fri, 9 Oct 2020 07:29:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602228596; bh=6NqEgH7jCAozzOTeAP23BSVseZj67sgtBho4pW6CG50=; h=Subject:To:Cc:From:Date:List-ID:From; b=u1guyophPNgpj279pkmLZUuZGqexmFuoc0hVSHoXZ1mC5d9h49GEClGOzc+kp1N6S LUIHwfwB1sQ0Js3SYeQ564x4HJICHhLwnHsObU4beFuIaevt9rVIgklZly+2446JpA +CMtLhCXxncSeUSJ3e7FAkmBDGASGitC4goHJVCg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731919AbgJIH34 (ORCPT ); Fri, 9 Oct 2020 03:29:56 -0400 Received: from forward2-smtp.messagingengine.com ([66.111.4.226]:36931 "EHLO forward2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732006AbgJIH34 (ORCPT ); Fri, 9 Oct 2020 03:29:56 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailforward.nyi.internal (Postfix) with ESMTP id 496751940B1B; Fri, 9 Oct 2020 03:29:55 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 09 Oct 2020 03:29:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=8U6Acp iJIiMYczxU/AQMCBYddSViVenKclt6/gJCOgI=; b=o75v5+dsEomuixC6ywo9gl JIuEDnt9ze0rLupQJiy+zunsW/aOGMAm1ATocWPw4n7TlG8xG8+8Ir3U4jpOPp6A LF0U6FtUJsA8/qGs6r7hRlr+sufDakFkmn88qyGrR0u9teGvXAr7EdXejlSD1MsD lGLuF6T7ctfpiiinAmZnFMbOVWtbVafa19uu1ZjeiDlNwPFL1E+00FlksYMW4S+s ctBxMNZZ8TI3yra2Q0REWH168RdT30AXA4Le2w1sf1Rq4D2WOjMTAY7boQuhTiDy kdgWjCLLwsjB0w9ZpVPFVsG8ogIRDPtjSUR30E3uIBhn+8TOvSlT4NS/J2QbGULw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrhedtgdduudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecuggftrfgrthhtvghrnhepleelledvgeefleeltdetgedugeffgffhudffudduke egfeelgeeigeekjefhleevnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphep keefrdekiedrjeegrdeigeenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmh grihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomh X-ME-Proxy: Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) by mail.messagingengine.com (Postfix) with ESMTPA id D834B3064683; Fri, 9 Oct 2020 03:29:54 -0400 (EDT) Subject: FAILED: patch "[PATCH] vhost: Use vhost_get_used_size() in vhost_vring_set_addr()" failed to apply to 4.9-stable tree To: groug@kaod.org, mst@redhat.com Cc: From: Date: Fri, 09 Oct 2020 09:30:34 +0200 Message-ID: <160222863457229@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.9-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 71878fa46c7e3b40fa7b3f1b6e4ba3f92f1ac359 Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Sat, 3 Oct 2020 12:02:03 +0200 Subject: [PATCH] vhost: Use vhost_get_used_size() in vhost_vring_set_addr() The open-coded computation of the used size doesn't take the event into account when the VIRTIO_RING_F_EVENT_IDX feature is present. Fix that by using vhost_get_used_size(). Fixes: 8ea8cf89e19a ("vhost: support event index") Cc: stable@vger.kernel.org Signed-off-by: Greg Kurz Link: https://lore.kernel.org/r/160171932300.284610.11846106312938909461.stgit@bahia.lan Signed-off-by: Michael S. Tsirkin diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index c3b49975dc28..9d2c225fb518 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1519,8 +1519,7 @@ static long vhost_vring_set_addr(struct vhost_dev *d, /* Also validate log access for used ring if enabled. */ if ((a.flags & (0x1 << VHOST_VRING_F_LOG)) && !log_access_ok(vq->log_base, a.log_guest_addr, - sizeof *vq->used + - vq->num * sizeof *vq->used->ring)) + vhost_get_used_size(vq, vq->num))) return -EINVAL; }