From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [Patch v2 1/4] common/sysctl: Don't leak status in SYSCTL_page_offline_op Date: Mon, 13 Jan 2014 11:13:26 +0000 Message-ID: <52D3CA56.2000002@citrix.com> References: <52CBF78402000078001110E8@nat28.tlf.novell.com> <1389095946-11932-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1389095946-11932-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Keir Fraser , Jan Beulich , Xen-devel List-Id: xen-devel@lists.xenproject.org On 07/01/14 11:59, Andrew Cooper wrote: > In addition, 'copyback' should be cleared even in the error case. > > 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 > CC: Keir Fraser > CC: Jan Beulich Ping? > > --- > > Changes in v2: > * Still clear copyback even in the error case. > --- > xen/common/sysctl.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c > index 117e095..0cb6ee1 100644 > --- a/xen/common/sysctl.c > +++ b/xen/common/sysctl.c > @@ -230,12 +230,9 @@ 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; > - } > > xfree(status); > copyback = 0;