From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>, Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 1/4] common/sysctl: Don't leak status in SYSCTL_page_offline_op
Date: Tue, 7 Jan 2014 11:34:53 +0000 [thread overview]
Message-ID: <52CBE65D.90803@citrix.com> (raw)
In-Reply-To: <52CBF40D02000078001110CD@nat28.tlf.novell.com>
On 07/01/14 11:33, Jan Beulich wrote:
>>>> On 27.12.13 at 15:57, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> Also fix the indentation of the arguments to copy_to_guest() to help clarify
>> that the 'ret = -EFAULT' is not part of the condition.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> CC: Keir Fraser <keir@xen.org>
>> CC: Jan Beulich <JBeulich@suse.com>
>> ---
>> xen/common/sysctl.c | 10 ++++------
>> 1 file changed, 4 insertions(+), 6 deletions(-)
>>
>> diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
>> index 117e095..cd6184a 100644
>> --- a/xen/common/sysctl.c
>> +++ b/xen/common/sysctl.c
>> @@ -230,15 +230,13 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t)
>> u_sysctl)
>> }
>>
>> if ( copy_to_guest(
>> - op->u.page_offline.status, status,
>> - op->u.page_offline.end - op->u.page_offline.start + 1) )
>> - {
>> + op->u.page_offline.status, status,
>> + op->u.page_offline.end - op->u.page_offline.start + 1) )
>> ret = -EFAULT;
>> - break;
>> - }
>> + else
>> + copyback = 0;
>>
>> xfree(status);
>> - copyback = 0;
> This is wrong (and not covered by the title or description) - there's
> nothing to copy back here (apart from "status"), so this should
> remain unconditional.
>
> Jan
>
There is a 'break' removed from the if statement, so there is no change
to the conditions during which copyback gets set.
~Andrew
next prev parent reply other threads:[~2014-01-07 11:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-27 14:57 [PATCH 0/4] Coverity fixes relating to xmalloc()/xfree() Andrew Cooper
2013-12-27 14:57 ` [PATCH 1/4] common/sysctl: Don't leak status in SYSCTL_page_offline_op Andrew Cooper
2014-01-07 11:33 ` Jan Beulich
2014-01-07 11:34 ` Andrew Cooper [this message]
2014-01-07 11:48 ` Jan Beulich
2014-01-07 11:59 ` [Patch v2 " Andrew Cooper
2014-01-13 11:13 ` Andrew Cooper
2014-01-17 17:59 ` Keir Fraser
2013-12-27 14:57 ` [PATCH 2/4] AMD/iommu_detect: Don't leak iommu structure on error paths Andrew Cooper
2013-12-29 17:39 ` Suravee Suthikulpanit
2013-12-27 14:57 ` [PATCH 3/4] AMD/microcode: Avoid use-after-free for the microcode buffer Andrew Cooper
2013-12-27 15:30 ` Boris Ostrovsky
2013-12-27 15:36 ` Andrew Cooper
2013-12-27 15:50 ` Boris Ostrovsky
2013-12-27 15:57 ` [Patch v2 " Andrew Cooper
2013-12-27 22:43 ` Matthew Daley
2013-12-28 11:24 ` Andrew Cooper
2013-12-28 11:28 ` [Patch v3 " Andrew Cooper
2013-12-27 14:57 ` [PATCH 4/4] VTD/DMAR: free() correct pointer on error from acpi_parse_one_atsr() Andrew Cooper
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=52CBE65D.90803@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@xen.org \
--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.