* [dpdk-dev] [PATCH] memory: fix segfault on rte_mem_virt2memseg() call with invalid addr
@ 2018-06-01 13:22 Dariusz Stojaczyk
2018-06-01 10:50 ` Burakov, Anatoly
2018-06-01 13:44 ` [dpdk-dev] [PATCH v2] " Dariusz Stojaczyk
0 siblings, 2 replies; 6+ messages in thread
From: Dariusz Stojaczyk @ 2018-06-01 13:22 UTC (permalink / raw)
To: dev, Anatoly Burakov; +Cc: Dariusz Stojaczyk
When trying to use it with an address that's not
managed by DPDK it would segfault due to a missing
check. The doc says this function returns either
a pointer or NULL, so let it do so.
Change-Id: Ib292f148914e67054f5d7b664077f19cba7000e4
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
---
lib/librte_eal/common/eal_common_memory.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
index 4f0688f..ecc5bb2 100644
--- a/lib/librte_eal/common/eal_common_memory.c
+++ b/lib/librte_eal/common/eal_common_memory.c
@@ -536,6 +536,9 @@ virt2memseg(const void *addr, const struct rte_memseg_list *msl)
void *start, *end;
int ms_idx;
+ if (msl == NULL)
+ return NULL;
+
/* a memseg list was specified, check if it's the right one */
start = msl->base_va;
end = RTE_PTR_ADD(start, (size_t)msl->page_sz * msl->memseg_arr.len);
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] memory: fix segfault on rte_mem_virt2memseg() call with invalid addr
2018-06-01 13:22 [dpdk-dev] [PATCH] memory: fix segfault on rte_mem_virt2memseg() call with invalid addr Dariusz Stojaczyk
@ 2018-06-01 10:50 ` Burakov, Anatoly
2018-06-01 13:44 ` [dpdk-dev] [PATCH v2] " Dariusz Stojaczyk
1 sibling, 0 replies; 6+ messages in thread
From: Burakov, Anatoly @ 2018-06-01 10:50 UTC (permalink / raw)
To: Dariusz Stojaczyk, dev
On 01-Jun-18 2:22 PM, Dariusz Stojaczyk wrote:
> When trying to use it with an address that's not
> managed by DPDK it would segfault due to a missing
> check. The doc says this function returns either
> a pointer or NULL, so let it do so.
>
> Change-Id: Ib292f148914e67054f5d7b664077f19cba7000e4
> Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
> ---
Generally speaking, if the commit is a bugfix, reference to the original
commit that introduces the issue should be part of the commit message.
See DPDK contribution guidelines [1] and "git fixline" [2].
[1] http://dpdk.org/doc/guides/contributing/patches.html
[2] http://dpdk.org/dev
Change-Id: is probably a leftover from Gerrit, this shouldn't be part of
the commit message.
On the substance of the patch itself:
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH v2] memory: fix segfault on rte_mem_virt2memseg() call with invalid addr
2018-06-01 13:22 [dpdk-dev] [PATCH] memory: fix segfault on rte_mem_virt2memseg() call with invalid addr Dariusz Stojaczyk
2018-06-01 10:50 ` Burakov, Anatoly
@ 2018-06-01 13:44 ` Dariusz Stojaczyk
2018-06-01 14:58 ` Burakov, Anatoly
2018-06-04 5:33 ` [dpdk-dev] [PATCH v3] " Dariusz Stojaczyk
1 sibling, 2 replies; 6+ messages in thread
From: Dariusz Stojaczyk @ 2018-06-01 13:44 UTC (permalink / raw)
To: dev, Anatoly Burakov; +Cc: Dariusz Stojaczyk, stable
When trying to use it with an address that's not
managed by DPDK it would segfault due to a missing
check. The doc says this function returns either
a pointer or NULL, so let it do so.
Changes from v1:
* removed gerrit change id
* added "git fixline" tags
Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")
Cc: anatoly.burakov@intel.com
Cc: stable@dpdk.org
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
---
lib/librte_eal/common/eal_common_memory.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
index 4f0688f..ecc5bb2 100644
--- a/lib/librte_eal/common/eal_common_memory.c
+++ b/lib/librte_eal/common/eal_common_memory.c
@@ -536,6 +536,9 @@ virt2memseg(const void *addr, const struct rte_memseg_list *msl)
void *start, *end;
int ms_idx;
+ if (msl == NULL)
+ return NULL;
+
/* a memseg list was specified, check if it's the right one */
start = msl->base_va;
end = RTE_PTR_ADD(start, (size_t)msl->page_sz * msl->memseg_arr.len);
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v2] memory: fix segfault on rte_mem_virt2memseg() call with invalid addr
2018-06-01 13:44 ` [dpdk-dev] [PATCH v2] " Dariusz Stojaczyk
@ 2018-06-01 14:58 ` Burakov, Anatoly
2018-06-04 5:33 ` [dpdk-dev] [PATCH v3] " Dariusz Stojaczyk
1 sibling, 0 replies; 6+ messages in thread
From: Burakov, Anatoly @ 2018-06-01 14:58 UTC (permalink / raw)
To: Dariusz Stojaczyk, dev; +Cc: stable
On 01-Jun-18 2:44 PM, Dariusz Stojaczyk wrote:
> When trying to use it with an address that's not
> managed by DPDK it would segfault due to a missing
> check. The doc says this function returns either
> a pointer or NULL, so let it do so.
>
> Changes from v1:
> * removed gerrit change id
> * added "git fixline" tags
>
> Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")
> Cc: anatoly.burakov@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
> ---
Please include Acks (Reviews, Tests...) in the commit message if they
were given for the previous version of the patchset. Also do not list
changes you've made in the commit message; instead, list changes in the
patch notes, after the first "---", like so:
area: fix blah
This patch fixes this and that.
Fixes: 123456 ("area: a buggy commit")
Cc: bug.author@example.com
Signed-off-by: Fix Author <fix.author@example.com>
Acked-by: fix.reviewer@example.com
---
v2:
- Fixed this
- Fixed that
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH v3] memory: fix segfault on rte_mem_virt2memseg() call with invalid addr
2018-06-01 13:44 ` [dpdk-dev] [PATCH v2] " Dariusz Stojaczyk
2018-06-01 14:58 ` Burakov, Anatoly
@ 2018-06-04 5:33 ` Dariusz Stojaczyk
2018-07-12 21:44 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
1 sibling, 1 reply; 6+ messages in thread
From: Dariusz Stojaczyk @ 2018-06-04 5:33 UTC (permalink / raw)
To: dev, Anatoly Burakov; +Cc: Dariusz Stojaczyk, stable
When trying to use it with an address that's not
managed by DPDK it would segfault due to a missing
check. The doc says this function returns either
a pointer or NULL, so let it do so.
Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")
Cc: anatoly.burakov@intel.com
Cc: stable@dpdk.org
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
Changes from v2:
* cleaned up commit msg
Changes from v1:
* removed gerrit change id
* added "git fixline" tags
lib/librte_eal/common/eal_common_memory.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
index 4f0688f..ecc5bb2 100644
--- a/lib/librte_eal/common/eal_common_memory.c
+++ b/lib/librte_eal/common/eal_common_memory.c
@@ -536,6 +536,9 @@ virt2memseg(const void *addr, const struct rte_memseg_list *msl)
void *start, *end;
int ms_idx;
+ if (msl == NULL)
+ return NULL;
+
/* a memseg list was specified, check if it's the right one */
start = msl->base_va;
end = RTE_PTR_ADD(start, (size_t)msl->page_sz * msl->memseg_arr.len);
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v3] memory: fix segfault on rte_mem_virt2memseg() call with invalid addr
2018-06-04 5:33 ` [dpdk-dev] [PATCH v3] " Dariusz Stojaczyk
@ 2018-07-12 21:44 ` Thomas Monjalon
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2018-07-12 21:44 UTC (permalink / raw)
To: Dariusz Stojaczyk; +Cc: stable, dev, Anatoly Burakov
04/06/2018 07:33, Dariusz Stojaczyk:
> When trying to use it with an address that's not
> managed by DPDK it would segfault due to a missing
> check. The doc says this function returns either
> a pointer or NULL, so let it do so.
>
> Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")
> Cc: anatoly.burakov@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-07-12 21:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-01 13:22 [dpdk-dev] [PATCH] memory: fix segfault on rte_mem_virt2memseg() call with invalid addr Dariusz Stojaczyk
2018-06-01 10:50 ` Burakov, Anatoly
2018-06-01 13:44 ` [dpdk-dev] [PATCH v2] " Dariusz Stojaczyk
2018-06-01 14:58 ` Burakov, Anatoly
2018-06-04 5:33 ` [dpdk-dev] [PATCH v3] " Dariusz Stojaczyk
2018-07-12 21:44 ` [dpdk-dev] [dpdk-stable] " 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).