From: Razvan Cojocaru <rcojocaru@bitdefender.com>
To: Corneliu ZUZU <czuzu@bitdefender.com>,
Ian Campbell <ian.campbell@citrix.com>
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
Jan Beulich <jbeulich@suse.com>,
xen-devel <xen-devel@lists.xen.org>
Subject: Re: Uninitialized variables in hvm_event_breakpoint (Re: New Defects reported by Coverity Scan for XenProject)
Date: Thu, 18 Feb 2016 12:17:39 +0200 [thread overview]
Message-ID: <56C59A43.3080000@bitdefender.com> (raw)
In-Reply-To: <56C59931.9010100@bitdefender.com>
On 02/18/2016 12:13 PM, Corneliu ZUZU wrote:
> On 2/18/2016 12:01 PM, Ian Campbell wrote:
>> On Wed, 2016-02-17 at 16:02 -0800, scan-admin@coverity.com wrote:
>>> Hi,
>>>
>>> Please find the latest report on new defect(s) introduced to XenProject
>>> found with Coverity Scan.
>>>
>>> 1 new defect(s) introduced to XenProject found with Coverity Scan.
>>> 4 defect(s), reported by Coverity Scan earlier, were marked fixed in the
>>> recent build analyzed by Coverity Scan.
>>>
>>> New defect(s) Reported-by: Coverity Scan
>>> Showing 1 of 1 defect(s)
>>>
>>>
>>> ** CID 1353192: Uninitialized variables (UNINIT)
>>> /xen/arch/x86/hvm/event.c: 176 in hvm_event_breakpoint()
>> This appears to have been introduced by:
>> commit
>> 557c7873f35aa39bd84977b28948457b1b342f92
>> Author: Corneliu ZUZU <czuzu@bitdef
>> ender.com>
>> Date: Mon Feb 15 14:14:16 2016 +0100
>>
>> x86: merge 2 hvm_event_... functions into 1
>> This patch merges almost identical functions
>> hvm_event_int3 and
>> hvm_event_single_step into a single function called
>> hvm_event_breakpoint.
>> Also fixes event.c file header comment in the process.
>> Signed-off-by: Corneliu ZUZU <
>> czuzu@bitdefender.com >
>> Acked-by: Razvan Cojocaru < rcojocaru@bitdefender.com >
>> Acked-by: Jan Beulich < jbeulich@suse.com >
>>
>>
>> hvm_event_breakpoint calls hvm_event_traps(&req) and if sync is true that
>> ors some bits into req->flags which was never initialised.
>>
>>>
>>> _________________________________________________________________________
>>>
>>> _______________________________
>>> *** CID 1353192: Uninitialized variables (UNINIT)
>>> /xen/arch/x86/hvm/event.c: 176 in hvm_event_breakpoint()
>>> 170
>>> 171 int hvm_event_breakpoint(unsigned long rip,
>>> 172 enum hvm_event_breakpoint_type type)
>>> 173 {
>>> 174 struct vcpu *curr = current;
>>> 175 struct arch_domain *ad = &curr->domain->arch;
>>>>>> CID 1353192: Uninitialized variables (UNINIT)
>>>>>> Declaring variable "req" without initializer.
>>> 176 vm_event_request_t req;
>>> 177
>>> 178 switch ( type )
>>> 179 {
>>> 180 case HVM_EVENT_SOFTWARE_BREAKPOINT:
>>> 181 if ( !ad->monitor.software_breakpoint_enabled )
>>>
>>>
>>> _________________________________________________________________________
>>>
>>> _______________________________
>>> To view the defects in Coverity Scan visit,
>>> https://scan.coverity.com/pro
>>> jects/xenproject?tab=overview
>>>
>>> To manage Coverity Scan email notifications for
>>> "ian.campbell@citrix.com", click
>>> https://scan.coverity.com/subscriptions/
>>> edit?email=ian.campbell%40citrix.com&token=1ce0fc428b9f94f66fd8d1ecf6cbb7
>>>
>>> 6a
>>>
>
> Sorry, my bad, I didn't know struct-initialization using labels sets all
> the other fields to zero.
> Shall I submit a fix for this issue?
Right, req->flags. Good catch. Yes, please do, req = {}; should do.
Thanks,
Razvan
next prev parent reply other threads:[~2016-02-18 10:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <56c509fa208ab_3596f5b338144b@ss1435.mail>
2016-02-18 10:01 ` Uninitialized variables in hvm_event_breakpoint (Re: New Defects reported by Coverity Scan for XenProject) Ian Campbell
2016-02-18 10:13 ` Corneliu ZUZU
2016-02-18 10:17 ` Razvan Cojocaru [this message]
2016-02-18 10:13 ` Razvan Cojocaru
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56C59A43.3080000@bitdefender.com \
--to=rcojocaru@bitdefender.com \
--cc=Andrew.Cooper3@citrix.com \
--cc=czuzu@bitdefender.com \
--cc=ian.campbell@citrix.com \
--cc=jbeulich@suse.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.