From patchwork Thu Feb 18 10:45:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corneliu ZUZU X-Patchwork-Id: 8348601 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 24F94C0553 for ; Thu, 18 Feb 2016 10:47:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4012D20376 for ; Thu, 18 Feb 2016 10:47:52 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5F87C2037F for ; Thu, 18 Feb 2016 10:47:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aWM5Z-00082M-Cx; Thu, 18 Feb 2016 10:45:37 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aWM5Y-00081w-50 for xen-devel@lists.xen.org; Thu, 18 Feb 2016 10:45:36 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id D5/4F-02745-FC0A5C65; Thu, 18 Feb 2016 10:45:35 +0000 X-Env-Sender: czuzu@bitdefender.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1455792334!23336038!1 X-Originating-IP: [91.199.104.161] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 17804 invoked from network); 18 Feb 2016 10:45:34 -0000 Received: from mx01.buh.bitdefender.com (HELO mx01.buh.bitdefender.com) (91.199.104.161) by server-5.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 18 Feb 2016 10:45:34 -0000 Comment: DomainKeys? See http://domainkeys.sourceforge.net/ DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=zUkL+ZI4zZ+oB2KbwLE8WZPmWII2kGSig8AUkEdlJmeR2HhcgumEuORuavFsAulMsgU4Fuw+mu6aVOY3Ejzy/1YpcxKi8HhNpEF05+A/N9n4+yJkbdTxZ7LJwRpy/JPnmkiY4vBFgiFTU2P7SpnRciHkrEMaMRWvbYVv3WI7ZjMgt438C8Drr7iCcJWBAbbxvFqYgG7DQ/1NVlhTqWM9hkJx7YquhsiVRqP01xkQspSby2UESWeADhwngylcTJZ4cK9aZKW8I3WDaX53wCHvzRzH+gy3yjl6KhpMxXEjAQuqn2YRpL4BXCta0vNWzdfhxkh8MVY62/hciS6ldbCrJw==; h=Received:Received:Received:Received:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp; DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bitdefender.com; h=from:to :cc:subject:date:message-id; s=default; bh=985DtpZlSXqh5BAGJTkct IeK6JE=; b=Nsu+pWZzr4TDjKYsuzpBNjLhTR/dKkfSiEPuz6H/9oDEEU4gTSRIo eIeADOJhjFsCbF1yfm4/5GyKV1gQPy+jqoFSFg7u75hwvNVwrvqw07I6m96CTcIt Cwc62pC+ZlRVaSTzZ9cNKGHUxFQizmdENp2x/SnYRxrwbKHTvh99UZKhOxltC12d WuUTcqqXRGWr1G4iHGhyA0e8FDDwDGbZpwiI5e4ndIFhT5G+r/dXc0SqXhLdyP4F qPIxW62s6JtEwaW3rV8SMBO5AVbgtP/7+dOY93HLx9KJIZqPB8pYJw2D1PjjrytF PT26vOs2QafD+3R016tuF4xl5JTH2ShAw== Received: (qmail 965 invoked from network); 18 Feb 2016 12:45:33 +0200 Received: from unknown (HELO mx-sr.buh.bitdefender.com) (10.17.80.103) by mx01.buh.bitdefender.com with AES256-GCM-SHA384 encrypted SMTP; 18 Feb 2016 12:45:33 +0200 Received: from smtp02.buh.bitdefender.net (unknown [10.17.80.76]) by mx-sr.buh.bitdefender.com (Postfix) with ESMTP id 3FE927FBE4 for ; Thu, 18 Feb 2016 12:45:33 +0200 (EET) Received: (qmail 28576 invoked from network); 18 Feb 2016 12:45:33 +0200 Received: from unknown (HELO czuzu-dev-vm.clj.bitdefender.biz) (czuzu@bitdefender.com@91.199.104.243) by smtp02.buh.bitdefender.net with AES128-SHA256 encrypted SMTP; 18 Feb 2016 12:45:32 +0200 From: Corneliu ZUZU To: xen-devel@lists.xen.org Date: Thu, 18 Feb 2016 12:45:28 +0200 Message-Id: <1455792328-28855-1-git-send-email-czuzu@bitdefender.com> X-Mailer: git-send-email 2.5.0 X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.4 on smtp02.buh.bitdefender.net, sigver: 7.64544 X-BitDefender-Spam: No (0) X-BitDefender-SpamStamp: Build: [Engines: 2.15.6.743, Dats: 414464, Stamp: 3], Multi: [Enabled, t: (0.000007, 0.001312)], BW: [Enabled, t: (0.000006)], RBL DNSBL: [Disabled], APM: [Enabled, Score: 500, t: (0.004527), Flags: 2A917CE3; NN_NO_CONTENT_TYPE; NN_NO_LINK_NMD; NN_LEGIT_BITDEFENDER; NN_LEGIT_S_SQARE_BRACKETS; NN_LEGIT_MAILING_LIST_TO], SGN: [Enabled, t: (0.005773)], URL: [Enabled, t: (0.000005)], RTDA: [Enabled, t: (0.025497), Hit: No, Details: v2.3.3; Id: 2m1ghdo.1abpv654k.4ri], total: 0(775) X-BitDefender-CF-Stamp: none Cc: Andrew Cooper , Tamas K Lengyel , Keir Fraser , Jan Beulich , Razvan Cojocaru Subject: [Xen-devel] [PATCH] x86/hvm_event: fix uninitialized struct field usage introduced by c/s f5365e6 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP c/s f5365e6: "xen/vm-events: Move parts of monitor_domctl code to common-side", introduced a use without initialization issue. hvm_event_breakpoint calls hvm_event_traps(&req) and if sync is true that ors some bits into req->flags which was never initialised. Reported by Coverity Scan. Initializes req @ hvm_event_breakpoint entry. Signed-off-by: Corneliu ZUZU Acked-by: Razvan Cojocaru Reviewed-by: Andrew Cooper --- xen/arch/x86/hvm/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/event.c b/xen/arch/x86/hvm/event.c index 874a36c..cb9c152 100644 --- a/xen/arch/x86/hvm/event.c +++ b/xen/arch/x86/hvm/event.c @@ -173,7 +173,7 @@ int hvm_event_breakpoint(unsigned long rip, { struct vcpu *curr = current; struct arch_domain *ad = &curr->domain->arch; - vm_event_request_t req; + vm_event_request_t req = {}; switch ( type ) {