DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Darek Stojaczyk <dariusz.stojaczyk@intel.com>, dev@dpdk.org
Cc: jianfeng.tan@intel.com, stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] vfio: fix read-after-free on getting container fd
Date: Fri, 26 Oct 2018 15:04:27 +0100	[thread overview]
Message-ID: <c6c06157-6e96-9f39-90d3-9278b437e4e2@intel.com> (raw)
In-Reply-To: <20181025104911.137496-1-dariusz.stojaczyk@intel.com>

On 25-Oct-18 11:49 AM, Darek Stojaczyk wrote:
> We were reading some memory just after freeing it.
> 
> Fixes: 83a73c5fef66 ("vfio: use generic multi-process channel")
> Cc: jianfeng.tan@intel.com
> Cc: anatoly.burakov@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
> ---
>   lib/librte_eal/linuxapp/eal/eal_vfio.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
> index d7268e4ce..fc3c7b870 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
> @@ -1034,8 +1034,9 @@ rte_vfio_get_container_fd(void)
>   		mp_rep = &mp_reply.msgs[0];
>   		p = (struct vfio_mp_param *)mp_rep->param;
>   		if (p->result == SOCKET_OK && mp_rep->num_fds == 1) {
> +			vfio_container_fd = mp_rep->fds[0];
>   			free(mp_reply.msgs);
> -			return mp_rep->fds[0];
> +			return vfio_container_fd;
>   		}
>   		free(mp_reply.msgs);
>   	}
> 

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

  reply	other threads:[~2018-10-26 14:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25 10:49 Darek Stojaczyk
2018-10-26 14:04 ` Burakov, Anatoly [this message]
2018-10-29  0:46   ` Thomas Monjalon

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=c6c06157-6e96-9f39-90d3-9278b437e4e2@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dariusz.stojaczyk@intel.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=stable@dpdk.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).