patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] vfio: fix read-after-free on getting container fd
@ 2018-10-25 10:49 Darek Stojaczyk
  2018-10-26 14:04 ` Burakov, Anatoly
  0 siblings, 1 reply; 3+ messages in thread
From: Darek Stojaczyk @ 2018-10-25 10:49 UTC (permalink / raw)
  To: dev; +Cc: Darek Stojaczyk, jianfeng.tan, anatoly.burakov, stable

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);
 	}
-- 
2.17.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [PATCH] vfio: fix read-after-free on getting container fd
  2018-10-25 10:49 [dpdk-stable] [PATCH] vfio: fix read-after-free on getting container fd Darek Stojaczyk
@ 2018-10-26 14:04 ` Burakov, Anatoly
  2018-10-29  0:46   ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Burakov, Anatoly @ 2018-10-26 14:04 UTC (permalink / raw)
  To: Darek Stojaczyk, dev; +Cc: jianfeng.tan, stable

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] vfio: fix read-after-free on getting container fd
  2018-10-26 14:04 ` Burakov, Anatoly
@ 2018-10-29  0:46   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-10-29  0:46 UTC (permalink / raw)
  To: Darek Stojaczyk; +Cc: dev, Burakov, Anatoly, jianfeng.tan, stable

26/10/2018 16:04, Burakov, Anatoly:
> 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>
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-29  0:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-25 10:49 [dpdk-stable] [PATCH] vfio: fix read-after-free on getting container fd Darek Stojaczyk
2018-10-26 14:04 ` Burakov, Anatoly
2018-10-29  0:46   ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon

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).