From: Wei Liu <wei.liu2@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org,
Paul Durrant <paul.durrant@citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>
Subject: Re: [PATCH] xenforeignmemory: work around bug in older privcmd
Date: Tue, 28 Aug 2018 15:20:12 +0100 [thread overview]
Message-ID: <20180828142012.cprvk7r76i2psbbj@citrix.com> (raw)
In-Reply-To: <fcd947b7-844d-2ddf-71ee-45dfd6cf4566@citrix.com>
On Tue, Aug 28, 2018 at 03:12:32PM +0100, Andrew Cooper wrote:
> On 24/08/18 13:16, Paul Durrant wrote:
> > diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c
> > index 3686cf41e0..0368aa09f4 100644
> > --- a/tools/libs/foreignmemory/linux.c
> > +++ b/tools/libs/foreignmemory/linux.c
> > @@ -53,6 +53,23 @@ int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
> > return -1;
> > }
> >
> > + /*
> > + * Older versions of privcmd return -EINVAL for unimplemented ioctls
> > + * so we need to probe for the errno to use rather than just using
> > + * the conventional ENOTTY.
> > + */
> > + if ( ioctl(fd, IOCTL_PRIVCMD_UNIMPLEMENTED, NULL) >= 0 )
> > + {
> > + xtl_log(fmem->logger, XTL_ERROR, -1, "xenforeignmemory",
> > + "privcmd ioctl should not be implemented");
>
> This error path leaks fd.
Patch sent.
Wei.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
prev parent reply other threads:[~2018-08-28 14:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-24 12:16 [PATCH] xenforeignmemory: work around bug in older privcmd Paul Durrant
2018-08-24 13:24 ` Wei Liu
2018-08-24 15:16 ` Ian Jackson
2018-08-27 9:04 ` Jan Beulich
2018-08-27 9:11 ` Wei Liu
2018-08-28 14:12 ` Andrew Cooper
2018-08-28 14:20 ` Wei Liu [this message]
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=20180828142012.cprvk7r76i2psbbj@citrix.com \
--to=wei.liu2@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=paul.durrant@citrix.com \
--cc=xen-devel@lists.xenproject.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.