Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1592027ybv; Thu, 20 Feb 2020 23:54:33 -0800 (PST) X-Google-Smtp-Source: APXvYqy8CmoyrSgQrOoEVIaaBEsw0yt+1d30mqRvdZRB8P79wQ/9IiqL9E9aFTK5i4QFCcXaNMSr X-Received: by 2002:a05:6830:1d4:: with SMTP id r20mr12575989ota.107.1582271673244; Thu, 20 Feb 2020 23:54:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582271673; cv=none; d=google.com; s=arc-20160816; b=wQfEbXuYT/t+EwbX94h83h4PGRsbYk7e0lHq8PepMwjs6Mq88qSzyBewja9hifaKyy nPg2GQ6BTaWNAMJCXk6LFEJEHAvUfrUmY8bpGGN9Q8E1Z9KdEI3sy088Kh4YU7Os86qY 35lhyGqc+kia2CQuPjRuBMZEF/mtOaFkUWPZyw3EWY9lsCHvyxIMaPSt7VtVA8w/KyaZ jSNc1x3nqoGM0+5+Te2LA6LfZi05CBpRkBWWySmSq1m0YOzYdkH9GdH6T6WAv071v/rv 4OuXg++cnpY6NHfqupWArByaqIECc2euUmhT8QHnX8jQC23IX9w3KWACmwQ8kFi1oDMD 0Mag== 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=IJONtd3iSsiQQc8zl4eAajWL/aNxYb8yHaH7uW2jCb8=; b=C+F+swxQLgZVGqA0rXWxS0bQhHSmMu1imSrAhVOZJ2v1ifmO+rfgffpl4jsNcobHU0 f1QT43tZ+nSJBlowqZ7D5Yh+LWJfJIPOEkdYep6tQ9oyjyX7f+KLLXIT+g67lS30tQm2 Dx8EWZYHRFG3TIv1KBBnDTjKK/R3eryrYd0yydF4UGCcw+CS+blckskaup0kx6Uh0YWI VEZIjzeiN5Nj4ByfWAKSFqVX1/CmiAjccJIfl1JY6QCtRKHNxt2ax0PB6dMUq4lF2Q/W Ey3PknCTJgFVH2S9PJyo2qh8XJ3WgPZfsybMQorvTgxAZnCUKCb8MUlwzhqWvL66F9PR 2luQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="pE/Wuilm"; 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 a5si1072229oti.22.2020.02.20.23.54.21; Thu, 20 Feb 2020 23:54:33 -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="pE/Wuilm"; 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 S1730218AbgBUHyS (ORCPT + 99 others); Fri, 21 Feb 2020 02:54:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:52792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729510AbgBUHyP (ORCPT ); Fri, 21 Feb 2020 02:54:15 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 462672073A; Fri, 21 Feb 2020 07:54:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582271654; bh=hVrg8rRe/pnLXFS4sp1Q4wJtlR5vsf1nCybQKCaUqxU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pE/WuilmIDTtMQASThJkKUrIx6M9Ev/SITJZCjC1AX66Bwc4ti48Uqyg26jy5NFVp CNYzxuyyHuZMWNcjxp+HXn0k8pwEoRC0uzBfhQb+Fgh1t1K4OEPLGTCfZuWCbzavUL uSVw0LvGngHcjeUpN2WABIYWIt8y79BqVjYnQlLg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Sasha Levin Subject: [PATCH 5.5 249/399] visorbus: fix uninitialized variable access Date: Fri, 21 Feb 2020 08:39:34 +0100 Message-Id: <20200221072426.647069566@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072402.315346745@linuxfoundation.org> References: <20200221072402.315346745@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: Arnd Bergmann [ Upstream commit caf82f727e69b647f09d57a1fc56e69d22a5f483 ] The setup_crash_devices_work_queue function only partially initializes the message it sends to chipset_init, leading to undefined behavior: drivers/visorbus/visorchipset.c: In function 'setup_crash_devices_work_queue': drivers/visorbus/visorchipset.c:333:6: error: '((unsigned char*)&msg.hdr.flags)[0]' is used uninitialized in this function [-Werror=uninitialized] if (inmsg->hdr.flags.response_expected) Set up the entire structure, zero-initializing the 'response_expected' flag. This was apparently found by the patch that added the -O3 build option in Kconfig. Fixes: 12e364b9f08a ("staging: visorchipset driver to provide registration and other services") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20200107202950.782951-1-arnd@arndb.de Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/visorbus/visorchipset.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/visorbus/visorchipset.c b/drivers/visorbus/visorchipset.c index ca752b8f495fa..cb1eb7e05f871 100644 --- a/drivers/visorbus/visorchipset.c +++ b/drivers/visorbus/visorchipset.c @@ -1210,14 +1210,17 @@ static void setup_crash_devices_work_queue(struct work_struct *work) { struct controlvm_message local_crash_bus_msg; struct controlvm_message local_crash_dev_msg; - struct controlvm_message msg; + struct controlvm_message msg = { + .hdr.id = CONTROLVM_CHIPSET_INIT, + .cmd.init_chipset = { + .bus_count = 23, + .switch_count = 0, + }, + }; u32 local_crash_msg_offset; u16 local_crash_msg_count; /* send init chipset msg */ - msg.hdr.id = CONTROLVM_CHIPSET_INIT; - msg.cmd.init_chipset.bus_count = 23; - msg.cmd.init_chipset.switch_count = 0; chipset_init(&msg); /* get saved message count */ if (visorchannel_read(chipset_dev->controlvm_channel, -- 2.20.1