Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3699996ybv; Mon, 10 Feb 2020 04:58:06 -0800 (PST) X-Google-Smtp-Source: APXvYqwTxsN2eLXJmvxHutZH5VLfLbJNaF+dcCt6Xvs4j4SiURU8YKWI2ddagFusjVksWGK3cj+X X-Received: by 2002:aca:af49:: with SMTP id y70mr763262oie.162.1581339486610; Mon, 10 Feb 2020 04:58:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581339486; cv=none; d=google.com; s=arc-20160816; b=bLnB9ksTmvR0+37V0mlMdEmb/s4UuWI695XuE8Qb8UP8tZvkmV27pGLpMowOhsIeq2 7nkF4PnDQusvXMADQ4zGhSGfe2GnuS+ZFICODBzGaJPKi2qSQxirIsLdxuzwvj4EmGk2 bHeEUUluG2wevvCVEYnpTM2K8cnU51FhY06dTnaosKYv8R9212fmg7tyQ+r84+8eqW7k dfh/2j940Z13Dkn7Lw381V61M6gPv0XJhApW6dOlT2YfhFmwjHYR24nhbTXjnYF/Mf10 pZTKvQ1uDwgZW0WCc13awDZrtgtzbO8m3c9Cvu4wziPAtLGS26CHzEJ8HvadiM+4FSH8 U9xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LP6TfAbbkFEaTDZDIVZpKvf/BbR2+fTP2PBGGG/f4Fw=; b=UhvYO6OEK4WLJZtDUgjs1/eGt8XjdScQet+67vYgwCetr6X8HLxrHbuNEE2Et1Zg5w n2GchuY6cx2EjfDs1CXEC6YKjNXaCQw3LLgsAM6KL3XJ7sSc0jAgi9TDjHVk+ve51pMF 4JFe7BRRwlAdVfHfzpeRFyfyjtVPld0o4Gls9Ai6qzzSKYAZwY7R3kSXs6n8TRTIVO2O sLkLg3Lm+Fsu1ERLmGgwgTwnXUs5Kad5F17Ai3uIFmL+Zs41GLsTE12DrWhNxrVkTn3r TzDsrfc6a/RsHLeYJvl58VY+FK5jULBov9MLTfgj0/G33rttXM9R3MNle8UHZAShSXHZ Q21A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zGYbbZDP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2si173602otk.126.2020.02.10.04.57.55; Mon, 10 Feb 2020 04:58:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zGYbbZDP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730016AbgBJM5W (ORCPT + 99 others); Mon, 10 Feb 2020 07:57:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:43758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729337AbgBJMla (ORCPT ); Mon, 10 Feb 2020 07:41:30 -0500 Received: from localhost (unknown [209.37.97.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 048D9208C4; Mon, 10 Feb 2020 12:41:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338490; bh=SbCIt7burNVjQ+p/Wtx/l3fzjQLeNUpp9lMGlGWjqvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zGYbbZDPHeK9EaLj0SSCwmPP1XXql5vwXZtFgZ+uvAYPjpim+M1QGp+Eq/F986V0W 0In8Nel6OSFASqvK5SMCm9oOn62iWsyxNm8+hOxnMWgM0FszdpatbLaF6YRG0g2HuC VmztzHNWocm3wkTJkg4ZWpAvTGdZO84VgE3HrBA4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Cornelia Huck , Daniel Verkamp , "Michael S. Tsirkin" Subject: [PATCH 5.5 274/367] virtio-balloon: initialize all vq callbacks Date: Mon, 10 Feb 2020 04:33:07 -0800 Message-Id: <20200210122449.510494704@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Verkamp commit 5790b53390e18fdd21e70776e46d058c05eda2f2 upstream. Ensure that elements of the callbacks array that correspond to unavailable features are set to NULL; previously, they would be left uninitialized. Since the corresponding names array elements were explicitly set to NULL, the uninitialized callback pointers would not actually be dereferenced; however, the uninitialized callbacks elements would still be read in vp_find_vqs_msix() and used to calculate the number of MSI-X vectors required. Cc: stable@vger.kernel.org Fixes: 86a559787e6f ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT") Reviewed-by: Cornelia Huck Signed-off-by: Daniel Verkamp Signed-off-by: Michael S. Tsirkin Signed-off-by: Greg Kroah-Hartman --- drivers/virtio/virtio_balloon.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -475,7 +475,9 @@ static int init_vqs(struct virtio_balloo names[VIRTIO_BALLOON_VQ_INFLATE] = "inflate"; callbacks[VIRTIO_BALLOON_VQ_DEFLATE] = balloon_ack; names[VIRTIO_BALLOON_VQ_DEFLATE] = "deflate"; + callbacks[VIRTIO_BALLOON_VQ_STATS] = NULL; names[VIRTIO_BALLOON_VQ_STATS] = NULL; + callbacks[VIRTIO_BALLOON_VQ_FREE_PAGE] = NULL; names[VIRTIO_BALLOON_VQ_FREE_PAGE] = NULL; if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_STATS_VQ)) {