* Re: [dpdk-dev] [RFC 3/3] app/testpmd: fix hex string parser in flow commands
@ 2021-09-29 12:22 Singh, Aman Deep
2021-09-29 13:30 ` Slava Ovsiienko
0 siblings, 1 reply; 3+ messages in thread
From: Singh, Aman Deep @ 2021-09-29 12:22 UTC (permalink / raw)
To: viacheslavo; +Cc: dev, orika, stable
Hi Ovsiienko,
Can you please provide the flow command which causes "segmentation fault".
Thanks
Aman
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [RFC 3/3] app/testpmd: fix hex string parser in flow commands
2021-09-29 12:22 [dpdk-dev] [RFC 3/3] app/testpmd: fix hex string parser in flow commands Singh, Aman Deep
@ 2021-09-29 13:30 ` Slava Ovsiienko
0 siblings, 0 replies; 3+ messages in thread
From: Slava Ovsiienko @ 2021-09-29 13:30 UTC (permalink / raw)
To: Singh, Aman Deep; +Cc: dev, Ori Kam, stable
Hi, Aman
An example:
testpmd> flow create 0 ingress pattern eth / end actions rss key 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef queues 0 end / end
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5de366d in __memset_sse2 () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install elfutils-libelf-0.170-4.el7.x86_64 glibc-2.17-222.el7.x86_64 jansson-2.10-1.el7.x86_64 libnl3-3.2.28-4.el7.x86_64 numactl-libs-2.0.9-7.el7.x86_64 openssl-libs-1.0.2k-12.el7.x86_64 zlib-1.2.7-17.el7.x86_64
(gdb)
With best regards,
Slava
From: Singh, Aman Deep <aman.deep.singh@intel.com>
Sent: Wednesday, September 29, 2021 15:23
To: Slava Ovsiienko <viacheslavo@nvidia.com>
Cc: dev@dpdk.org; Ori Kam <orika@nvidia.com>; stable@dpdk.org
Subject: Re: [dpdk-dev] [RFC 3/3] app/testpmd: fix hex string parser in flow commands
Hi Ovsiienko,
Can you please provide the flow command which causes "segmentation fault".
Thanks
Aman
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dpdk-dev] [RFC 3/3] app/testpmd: fix hex string parser in flow commands
2021-09-10 14:16 [dpdk-dev] [RFC 1/3] ethdev: update modify field flow action Viacheslav Ovsiienko
@ 2021-09-10 14:16 ` Viacheslav Ovsiienko
0 siblings, 0 replies; 3+ messages in thread
From: Viacheslav Ovsiienko @ 2021-09-10 14:16 UTC (permalink / raw)
To: dev; +Cc: orika, stable
The hexadecimal string parser does not check the target
field buffer size, buffer overflow happens and might
cause the application failure (segmentation fault
is observed usually).
Fixes: 169a9fed1f4c ("app/testpmd: fix hex string parser support for flow API")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
app/test-pmd/cmdline_flow.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 529ead6b2a..9e7fe1ae9f 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -7291,10 +7291,13 @@ parse_hex(struct context *ctx, const struct token *token,
hexlen -= 2;
}
if (hexlen > length)
- return -1;
+ goto error;
ret = parse_hex_string(str, hex_tmp, &hexlen);
if (ret < 0)
goto error;
+ /* Check the converted binary fits into data buffer. */
+ if (hexlen > size)
+ goto error;
/* Let parse_int() fill length information first. */
ret = snprintf(tmp, sizeof(tmp), "%u", hexlen);
if (ret < 0)
--
2.18.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-29 13:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29 12:22 [dpdk-dev] [RFC 3/3] app/testpmd: fix hex string parser in flow commands Singh, Aman Deep
2021-09-29 13:30 ` Slava Ovsiienko
-- strict thread matches above, loose matches on Subject: below --
2021-09-10 14:16 [dpdk-dev] [RFC 1/3] ethdev: update modify field flow action Viacheslav Ovsiienko
2021-09-10 14:16 ` [dpdk-dev] [RFC 3/3] app/testpmd: fix hex string parser in flow commands Viacheslav Ovsiienko
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).