04/09/2017 12:12, Sergio Gonzalez Monroy: > On 04/08/2017 19:53, Patrick MacArthur wrote: > > Normally, command line argument strings are considered immutable, but > > SPDK [1] and urdma [2] construct argv arrays to pass to rte_eal_init(). > > These strings are allocated using malloc() and freed after DPDK > > initialization with free(). However, in the case of --file-prefix and > > --huge-dir, DPDK takes the pointer to these strings in argv directly. If > > a secondary process calls rte_eal_pci_probe() after rte_eal_init() > > returns, as is done by SPDK, this causes a use-after-free error because > > the strings have been freed by the calling code immediately after > > rte_eal_init() returns. [...] > > Fix this by using strdup() to create separate memory buffers for these > > strings. Note that this patch will cause valgrind to report memory > > leaks of these buffers as there is nowhere to free them. Using static > > buffers is an option but would make these strings have a fixed maximum > > length whereas there is currently no limit defined by the API. > > > > [1] http://spdk.io > > [2] https://github.com/zrlio/urdma > > > > Fixes: af75078fece3 ("first public release") > > Cc: sta...@dpdk.org > > > > Signed-off-by: Patrick MacArthur <patr...@patrickmacarthur.net> > > Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.mon...@intel.com>
Applied, thanks