patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Aviad Yehezkel <aviadye@dev.mellanox.co.il>
To: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>,
	Tomasz Duszynski <tdu@semihalf.com>,
	dev@dpdk.org
Cc: stable@dpdk.org
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] examples/ipsec-secgw: fix ip version check
Date: Mon, 16 Oct 2017 13:43:20 +0300	[thread overview]
Message-ID: <a22147bb-8eb5-a09b-876a-4330fbe6552f@dev.mellanox.co.il> (raw)
In-Reply-To: <89f28ab9-22c1-977e-c986-d691408d9a78@intel.com>

Reviewed-by: Aviad Yehezkel <aviadye@mellanox.com>


On 10/16/2017 12:56 PM, Sergio Gonzalez Monroy wrote:
> On 13/10/2017 13:50, Tomasz Duszynski wrote:
>> Since new_ip and ip4 are overlapping buffers copying ip4 over new_ip
>> using memmove() might overwrite memory at ip4. This could happen if
>> following condition holds:
>>
>> ip_hdr_len > sizeof(struct esp_hdr) + sa->iv_len
>>
>> Thus using ip4 to check ip version is wrong as it might not contain
>> proper value.
>>
>> Fixes: f159e70b0922 ("examples/ipsec-secgw: support transport mode")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
>> ---
>>   examples/ipsec-secgw/esp.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c
>> index 2897840..063e63f 100644
>> --- a/examples/ipsec-secgw/esp.c
>> +++ b/examples/ipsec-secgw/esp.c
>> @@ -307,8 +307,8 @@ esp_outbound(struct rte_mbuf *m, struct ipsec_sa 
>> *sa,
>>                   sizeof(struct esp_hdr) + sa->iv_len);
>>           memmove(new_ip, ip4, ip_hdr_len);
>>           esp = (struct esp_hdr *)(new_ip + ip_hdr_len);
>> +        ip4 = (struct ip *)new_ip;
>>           if (likely(ip4->ip_v == IPVERSION)) {
>> -            ip4 = (struct ip *)new_ip;
>>               ip4->ip_p = IPPROTO_ESP;
>>               ip4->ip_len = htons(rte_pktmbuf_data_len(m));
>>           } else {
>
> Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
>

  reply	other threads:[~2017-10-16 10:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 12:50 [dpdk-stable] " Tomasz Duszynski
2017-10-16  9:56 ` [dpdk-stable] [dpdk-dev] " Sergio Gonzalez Monroy
2017-10-16 10:43   ` Aviad Yehezkel [this message]
2017-10-16 14:46   ` De Lara Guarch, Pablo

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=a22147bb-8eb5-a09b-876a-4330fbe6552f@dev.mellanox.co.il \
    --to=aviadye@dev.mellanox.co.il \
    --cc=dev@dpdk.org \
    --cc=sergio.gonzalez.monroy@intel.com \
    --cc=stable@dpdk.org \
    --cc=tdu@semihalf.com \
    /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).